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.
 

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;
}
Reason: