Bullish Engulfing Entries with Trend Filters and Equity-Based Exits
Summary
This script turns a bullish engulfing candle pattern into a long-only trading strategy. It recognizes the pattern after a downtrend, defined either by price below the 50-period simple moving average or by the 50-period average below the 200-period average with price below both. The engulfing candle must have a larger-than-average body and cover the prior candle’s smaller bearish body. A signal opens a position sized as a percentage of starting capital, provided no trade is already open.
The script sets profit and stop thresholds from strategy equity, then submits exit orders when equity crosses those thresholds. Its settings include a default 2% profit target, a 2% stop threshold, and a commission assumption; these are simulation parameters, not evidence of profitability. The document provides code but no performance report, market, timeframe, or comparison. The equity-based triggers and exit orders priced at the current close warrant careful review before interpreting backtests or using the strategy live.
Key ideas
- The strategy looks for a bullish engulfing pattern after a configurable moving-average downtrend.
- A signal requires a bullish candle with a larger body than its recent average and an engulfing relationship to the prior candle.
- The script enters only when no position is open and sizes orders from a percentage of starting capital.
- Profit and stop triggers are based on strategy equity, so their behavior should be checked against intended price-based exits.
- The document includes no backtest results or evidence of live performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.