I am trying to write a strategy that moves the SL to BE once an initial TP is hit. Crucially the SL is defined by the low (assuming long trade) of the candle close prior to entry. I have tried adopting Robert’s code from the PRT article on this subject –
https://www.prorealcode.com/blog/learning/breakeven-code-automated-trading-strategy/
But encounter difficulties as I can’t easily define the variables at the beginning of the code as they are not constant. Typically my attempts have resulted in the first trade of the day running smoothly but second not adhering to the desired structure as I presume the reset criteria is not functioning as intended.
Any help/thoughts on the matter would be greatly appreciated!
Thanks
Tom