EA that measures spread?
Is it possible to make an EA that will not make a trade despite all the requirements being fulfilled because the spread widens? This would prevent being stopped out for some reason like news or stop hunting.
- Floating spread or fixed spread ?
- Spread in MT5
- Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6.
Yes, it is possible
monitor MarketInfo(Symbol(), MODE_SPREAD)
... or
spread = Ask - Bid
before taking action. You wouldn't want to have a stoploss set on the server in this case.
Spread = (Ask-Bid)*10000;
if (Spread > 20 )
{
Spread = Spread/100;
}
if (Spread > 20 )
{
Spread = Spread/100;
}