Reputation: 11
messing around with a breakout strategy, cant figure out how to write close > highest high in last 20 candles without the current one. I think that this:
hh = ta.highest(high, 20)
if (close > hh)
strategy.entry('long', strategy.long)
doesnt work as the candle that closes past the range is the one becoming the highest one by definition, any tips?
cheers
Upvotes: 1
Views: 287
Reputation: 865
hh = ta.highest(high, 20)[1]
if (close > hh)
strategy.entry('long', strategy.long)
Upvotes: 0