Due to an error in the implementation on my strategy I am looking a very strange calculation of the Stop Loss.
I have the next code for the protection:
SetStopLoss(CalculationMode.Currency, SL);
In the current implementation the value of SL goes negative, so it is working as a profit target.
What I do not understand is how the value is set.
In the image attached you can see the information of the candle where the code of the order and SL are launched (green candle at 15:00:00).
At this candle, I printed the value of SL, being this -16250,41.
The calculation mode is Currency, and the instrument is NQ, so I understand that the protection should be of 16250/20 = 812$, however the trade has a profit of 45$.
What am I misunderstanding?
Comment