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

Flat Channels - MetaTrader 5 Expert - MQL5 #23139 - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

Flat Channel - expert for MetaTrader 5

Flat Channel - expert for MetaTrader 5

Idea by JS_Sergey

mq5 code author - Bara Bashkakon

The Expert Advisor uses the standard deviation smoothed custom indicator, which is a smoothed standard deviation . Determine whether a trend exists based on the indicator values ​​on bars #0, #1, #2, #3 and #4:

(StdDev #0 > StdDev #1) && (StdDev #1 > StdDev #2) && (StdDev #2 > StdDev #3) && (StdDev #3 > StdDev #4) -> Trending

It also determines the flat state within the "Minimum Number of Bars" bar. Flat areas are represented by two lines:

Flat Channel - expert for MetaTrader 5

If there is currently no flat area in the market, the EA will not place a pending order. Additionally, if there is no flat line, the appropriate line is removed from the chart. When any pending order is triggered, other pending orders will be deleted and trailing stop will be further applied to the position.

Stop Loss and Take Profit can be set to constant or dynamic values. This depends on the Stop Loss and Take Profit parameters. Lot size can also be constant ("Enable Money Management Features" set to "False") or dynamic. This depends on the number of trades with Stop Loss and Take Profit closing.

Flat Channel - expert for MetaTrader 5


Attachment download

📎 flat_channel.mq5 (88.53 KB)

📎 standard_deviation_smoothing.mq5 (15.18 KB)

Source: MQL5 #23139

Verification code Refresh