Expert advisor great results when spread is low and total disaster when spread is high

Fabio Cavalloni  
Juan Pablo Ciceri Rios:
Does anyone know how to take into account spread in your EA logic? how to overcome the loses because of this? any guidelines or articles to follow

Working on MT5 firstly.

Having accurate data secondly.

Avoiding trading in times with high spreads, thirdly.

Then, if you are really interested in trading in these times you  should consider to use SL big enough compared to average spread (for example, if average spread in my trading time is of 5 pips, i will never use a SL near to 5 pips, but at least 5 times bigger).

Trading in high spread time is the most risky and building solid strategies in these times is not easy, but most of people like that because it's easy to make fake backtests with fixed low spread in hours around midnight and let people to think that these are profitable strategies. As you know (that probably is the reason why you come here) reality is totally different.