You can call SetStopLoss within OnBarUpdate to dynamically change your stop. Set Calculation mode to CalculationMode.Price and then pass in the EMA value for the current bar, so that would be something like:
SetStopLoss(CalculationMode.Price, EMA3[0]);
One thing to note will be if you are long or short. If you are long you would want to make sure you are placing the sell stop below the market price and opposite that for short positions.
Please let me know if I can assist any further with this.". Now if I am following correctly, the setting could be anywhere in OnBarUpdate, and even have two one in the execution block of code for long entry, and also short entry. It would have to first line in the execution code. Thanks in advance for your reply.
Thanks John
Comment