Idea by: Vlad.
MQL5 code by: barabashkakvn.
Introducing the Candle Shadows EA, designed specifically for your MetaTrader 5 trading platform. This expert advisor waits for the candlestick size to meet or exceed a specified Candle Size Minimum within a timeframe defined by The Position Can Be Opened Within N Minutes. Additionally, it takes into account the Length Opposite Shadow Max—where the lower shadow is used for Sell positions and the upper shadow for Buy positions.

Here’s a crucial rule: only one position can be opened on the current bar. If your last trade was stopped out (where the DEAL_ENTRY_OUT property indicates DEAL_REASON_SL), the next position will open with a Factor of Reduction of Lot at SL—meaning it will be a smaller lot size to manage your risk better.
There are also two nifty parameters worth noting:
- Position Lives N Bars: This sets how long a position can stay open in terms of bars before it's forcibly closed.
- Close the Profitable Position on Bar N: Automatically close a profitable position on bar N.
Don’t forget, positions can only be opened within the hours specified by Start Hour and End Hour. You also have options for position size management:
- Constant position volume (set Lots > 0, and Risk = 0).
- Dynamic position volume (set Lots = 0, and Risk > 0).
Plus, you have the flexibility to disable Stop Loss and Take Profit levels or even trailing if you want more control over your trades.
Related Posts
- Mastering Trading Signals with MQL5 Wizard: Bullish and Bearish Engulfing Strategies
- Mastering Bullish and Bearish Harami Patterns with Stochastic in MT5
- Creating Powerful Trade Signals with MQL5 Wizard: Bullish and Bearish Engulfing Patterns + RSI
- Harnessing MQL5 Wizard for Bullish and Bearish Harami Signals with CCI Confirmation
- Harnessing MQL5 Wizard for Trading Signals: 3 Black Crows & 3 White Soldiers with MFI