@cheaponreay01
You can use flags to control different sections of your ea , for example if you use different strategies in raging and trend market
https://fxdreema.com/shared/JDNl3jAGc
In this one i made it easy , if the body of the candle is > 10 pips it take that as a trend , switches the flag trend to true and the flag range to false , and if the opposite happends it turns the range flag to true and the trend flag to false .
It does that before checking the condtions for buy/sell , if that conditions are true it goes down and checks the flag in this case '' trend '' if that is true or false , if its true it continues for the trade .


(never looker at it myself).