I’m trying to figure out how to use candles to define the initial stop as well as the exit. I have attached what I have coded so far, which runs though doesn’t quite capture what I am trying to do.
For long positions, the initial stop would be the low of the opening candle or previous candle and for short positions the stop would be the high of the opening candle or previous candle.
For long positions, the exit is a stop order below a bull candle with a body > 50% ATR and for short positions, the exit is a stop order above a bear candle with a body >50% ATR. The obvious problem is the stop order expires after the close of the following candle – is there some way to keep the stop at that level? I have done the video training on loops though am not yet experienced or smart enough to figure it out 🙂
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.