While working on a bot I came across something weird.
In the screenshot below is shown how my long position of 1 lot hits the stop loss of 20 pips just a bit after entering the position.
HOWEVER, my position is not closed upon hitting the stop loss. Instead, it closes a bit later with a loss of 20.7 pips...
I made a very simple bot to try to reproduce this error. It indeed seems that it happens more often that a position is not closed immediately after hitting the stop loss.
Can somebody explain what is going on?
During the backtesting I use tick data and I put 0 per million commision costs, so the extra costs cannot be due to comissions...
It's normal ..
The Stop loss is executed always to price or worse, and Take Profit is executed always to price or better.