E.g. A strategy buys a contract at 100, and wants to set the initial stop at 5% (95). Once the price reaches 101, a trailing stop of 1% must be engaged.
Using SetStopLoss(...) and SetTrailStop() together does not seem to work because the SetStopLoss() overrides the SetTrailStop.
So what is a better solution ?
The documentation talks about "reset" the trailing stop.
Question 2) How do I reset the trailing stop loss ?
OnBarUpdate() method, you should always reset the trail stop price/offset value when your
strategy is flat otherwise, the last price/offset value set will be used to generate your trail
stop order on your next open position
Is it possible ?
Comment