Home System Trading Post

Mastering Candle Shadows: Your Go-To EA for MetaTrader 5

Attachments
21147.zip (5.85 KB, Download 0 times)

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.

Candle Shadows v1 Sell

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

Comments (0)