i'VE ADDED the following to try furthur debugging
It seems like the bid is changing during the processing of the onTick function. Is this right? I thought Price only changes once per tick. How do I handle this?
Print("SELL"); Print("bid: ", bid); Print("entry price: ", SymbolInfoDouble(_Symbol, SYMBOL_BID) ); Print("SL: ", _sl); Print("tp: ", _tp); Print("Freeze Level: ", SymbolInfoInteger(_Symbol, SYMBOL_TRADE_FREEZE_LEVEL) * _Point); Print("Stop Level: ", stop_level); TesterStop();I attached a picture with the messages.
It seems like the bid is changing during the processing of the onTick function. Is this right? I thought Price only changes once per tick. How do I handle this?
Files:
invalid_stops_2.PNG
15 kb

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I've tried Normalizing Price, both using NormalizeDouble and Normalizing with tick size. I also made sure the stoploss is placed further than spread + stop level.
Implimenting this got rid of most of the errors but some still persist.
Here is the code assosiated with entry.
I can provide the whole EA to make testing easier.
I've also added a file containing the errors printed by the journal. Just in case it helps, pips is the distance of the stoploss from the entry price and min pips is spread + stop level
Could this be caused by my history data? it really only started being this bad after reinstalling mt5.
Thanks for taking a look.