If I change the candlestick type to heiken ashi, then in the strategy all indicators begin to be calculated on the basis of heiken ashi, but entry and exit from the deal is taken on the opening of a regular candle or heiken ashi?
For example code of strategy
//@version=5
strategy(“Supertrend Strategy”, overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=15)
atrPeriod = input(10, “ATR Length”)
factor = input.float(3.0, “Factor”, step = 0.01)
[_, direction] = ta.supertrend(factor, atrPeriod)
if ta.change(direction) < 0
strategy.entry(“My Long Entry Id”, strategy.long)
if ta.change(direction) > 0
strategy.entry(“My Short Entry Id”, strategy.short)
//plot(strategy.equity, title=”equity”, color=color.red, linewidth=2, style=plot.style_areabr)
Антон Емельянов is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.