I'm confused on how to dynamically reset a stop loss.for an active position.
In my code, I'm trying to code a trailing stop. I'm using SetStopLoss(CalculationMode.Price). In the help section:
I read:
"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"
but the next bullet point says,
"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"
This seems contradictory. I only want to reset my StopLoss when I'm in an active (open) position, which the first point says I can do, but the next point says I need to be flat?
How can I dynamically reset a stop loss and profit target to implement a trailing stop? Thanks,

Comment