1.- I make a purchase using EnterLong(22)
2.- I establish a StopLoss (model.price, price). This command makes two Stop Loss orders of type "Stop Market" appear in the Ninja Trader Orders tab, one with quantity 19 and the other with quantity 3. In any case, in the Chart Trader I see a Stop Loss line with quantity 22. All right!!
3.- When the market price reaches a certain value, I do an ExitLong(10) and it is done correctly.
4.- The problem is that the Stop Loss is still set at 22, when what I want is to change it to 22-10 = 12.
I have tried to change the the stop loss quantity property, but it does not allow me to set them to 0 depending on their status. I have tried to cancel the stop loss orders, but it doesn't cancel them. I have tried setting another stop loss, but it doesn't work either. I'm a bit desperate, but I understand that there must be some way, especially since through the user interface, deleting a Stop Loss and re-creating another is as simple as using a couple of clicks.
How could I do it using Ninja Script?
Thanks in advance.
A greating.
Comment