الوصف
Strategy & Trading Approach
Candle Engulfing Retracement Bot is a price-action cBot designed to trade retracements following confirmed bullish or bearish engulfing candle patterns.
The strategy analyzes closed candles and identifies:
- Bullish engulfing setups — a bearish candle followed by a bullish candle that engulfs the previous candle's body.
- Bearish engulfing setups — a bullish candle followed by a bearish candle that engulfs the previous candle's body.
- A configurable displacement requirement is used to avoid very small engulfing bodies.
The cBot can optionally use H4 order blocks as a higher-timeframe directional filter. It searches recent H4 candles for potential bullish or bearish order blocks followed by displacement and checks whether the order block remains fresh and valid.
Entry Logic
When a valid setup is detected, the cBot places two pending limit orders designed to enter on a retracement:
- First entry: at the high of the signal/OB candle for a bullish setup or the low for a bearish setup.
- Second entry: at the midpoint of the relevant candle/order-block range.
When a matching H4 order block is available and the H4 OB entry option is enabled, the pending orders are based on the H4 order-block zone.
If an applicable H4 order block is not available, the cBot can fall back to the original engulfing-candle retracement setup rather than remaining inactive.
The cBot also checks that a pending limit order is placed on the correct retracement side of the current market price.
Stop Loss & Take Profit
Stop loss is positioned beyond the relevant signal/order-block zone, with an adjustable SL Buffer.
A configurable Maximum SL limits the distance between entry and stop loss.
Take profit is calculated using configurable risk-to-reward ratios:
- First Trade RR: default 1:1
- Second Trade RR: default 1:1
Each entry can therefore have its own risk-to-reward setting.
When the first trade reaches take profit, the cBot can cancel the remaining second-entry pending order for that direction.
Risk & Capital Management
The cBot supports two position-sizing methods:
Fixed Lot
- Uses a user-defined fixed volume.
Risk Based
- Calculates position size from account equity and the configured percentage risk per trade.
- Includes a small-account fallback volume.
- Automatically respects the broker's minimum, maximum and volume-step requirements.
The default risk-based setting is 2% per trade.
Users should note that when both pending orders are filled, each position is sized independently according to the configured risk settings.
Prop-Firm Protection
An optional Prop Firm trading mode provides additional account-level controls, including:
- Maximum total loss percentage
- Daily loss percentage
- Profit target percentage
- Optional closing of positions when loss limits are reached
- Cancellation of pending orders when protection limits are triggered
- Optional stopping after reaching a configured number of profitable days
- Configurable maximum-loss calculation based on initial balance, initial equity or trailing equity peak
- Optional inclusion of floating P/L when calculating daily loss
These controls are intended to help traders configure the cBot around their own account or prop-firm risk parameters.
Key Parameters
Important configurable parameters include:
- Position sizing mode
- Fixed volume
- Risk per trade
- Small-account fallback volume
- Displacement multiplier
- H4 order-block enable/disable
- H4 lookback period
- H4 impulse multiplier
- H4 order-block maximum age
- Signal-in-order-block requirement
- Order-block tolerance
- Order-block entry usage
- Stop-loss buffer
- Maximum stop-loss
- First-trade RR
- Second-trade RR
- Prop-firm risk limits
Who This cBot Is Suited For
This cBot is intended for traders who understand XAUUSD price action, engulfing patterns, retracement entries, order blocks and risk management.
It can be configured for different account sizes and trading styles through fixed-lot or percentage-based position sizing.
It is particularly suited to traders who prefer pending-limit retracement entries rather than entering immediately at market.
Important Limitations & Usage Notes
The cBot does not guarantee profits and should not be considered a low-risk or guaranteed-income system.
Trading results can vary depending on the symbol, broker conditions, spread, execution, slippage, account size and parameter settings.
The H4 order-block component is optional. When no matching H4 order block is found, the strategy can use the engulfing retracement setup as a fallback.
Risk settings should be tested and adjusted for the specific trading account and broker before live deployment. Backtesting and forward testing are recommended before using real funds.
One important point about the wording
I would not advertise this bot as a "high-frequency", "high-profit", "low-drawdown", "guaranteed", or "high-win-rate" cBot based on this code alone. The source code establishes the strategy and risk-management mechanics, but it doesn't establish those performance claims.
Also, the code's H4 OB detection is somewhat specific: it identifies a bearish candle followed by a bullish displacement, or a bullish candle followed by bearish displacement, and then checks freshness.
The two-entry structure and RR-based exits are directly reflected in the order creation logic.
