Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Candle Shadow v1 - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources

author EAcpu | 5 reads | 0 comments |

Candle shadows v1 - expert for MetaTrader 5

MQL5 code by : Balabashka Kong .

The EA waits for the candlestick size to become higher than or equal to the " minimum size of the candle " within "N minutes to open a position " minutes. At the same time, the " maximum shadow length " can also be considered (the lower shadow is considered as a selling position, and the upper shadow is considered as a buying position).

Candle shadows v1 - expert for MetaTrader 5

One rule also applies here: only one position can be opened on the current bar. If the last position is closed via stop loss (the transaction DEAL_ENTRY_OUT with the DEAL_REASON_SL attribute is intercepted in OnTradeTransaction) and there is a loss, the next position is closed with a " SL batch reduction factor " times smaller batch size.

There are two more interesting position-related parameters: " Position lives N bars" - the position lifetime is set in bars before force closing, and " Close profitable position on N bars " - the position is closed on N bars, if the position is profitable.

Oh, I almost forgot to mention that position opening can only be done within the following time intervals: " Start Time " and " End Time ", as well as position size management:

Additionally, you can disable Stop Loss and Take Profit levels as well as trailing.


Attachment download

📎 candle_shadows_v1.mq5 (47.42 KB)

Source: MQL5 #21147

Verification code Refresh