"· It is suggested to call this method from within the strategy Initialize() method if your stop loss price/offset is static
· You may call this method from within the strategy OnBarUpdate() method should you wish to dynamically change the stop loss price while in an open position
· Should you call this method to dynamically change the stop loss price in the strategy OnBarUpdate() method, you should always reset the stop loss price/offset value when your strategy is flat otherwise, the last price/offset value set will be used to generate your stop loss order on your next open position."
I am calculating a value that will need to be reset as the market moves.
My code currently looks like this:
SetProfitTarget("SellShort", CalculationMode.Price, (Position.AvgPrice - shortProfit));
SetStopLoss("SellShort", CalculationMode.Price, (Position.AvgPrice + shortStopLoss), false);
How do reset said value as mentioned above so that when I flatten i can begin the process completely anew...?
Thanks in advance,
Andrew
Comment