Max spread

To add comments, please log in or register
AlexeyRoss
9
AlexeyRoss  
Hello guys, help me please, what mt4 script Should looks like if i need this option for expert:
MaxSpread=30
Step for spread=10
So if spread is going more then 40 or below 20 - ea stop trading
Thanks in advance

lippmaje
609
lippmaje  

Like this maybe?

int spread=SymbolInfoInteger(_Symbol,SYMBOL_SPREAD);
if(MathAbs(spread-MaxSpread)<=SpreadStep) OpenTrade();
To add comments, please log in or register