Back test stop loss bug

So I have written my own code for custom values for stop loss and take profit, It works very well in the debugger, triggering the Exit Long condition at 50 pips on the first trade.

However in the back testing when i have the take profit and stop loss boxes ticked it is showing losses on the graph where it would be taking profits. If I am to untick the backtest boxes for stop loss and take profit boxes (which are much higher) then it shows my script is generating a great profit. I believe your backtest may have an issue with the stop loss and take profit conflicting with the exit condition in some way.