I cannot do backtesting on Comodities data on Trading View. I don’t know if its common or is it just me? The backtesting code works fine on stock, crypto, Forex but not FUTURES such as NO1! Simply display no data on backtest. But if I draw plots, it still shows. Any one knows why? Is […]
- Tags @p2, 0, 0) p1 = plot(SMA_fast, 1, 30, alert.freq_once_per_bar_close), alert.freq_once_per_bar_close) shortCondition = crossunder(SMA_fast, color = SMA_fast>=SMA_slow ? color.orange : color.blue, color= SMA_fast>=SMA_slow ? color.orange: SMA_fast<=SMA_slow ? color.black: color.black, color=color.blue), crypto, currency=currency.USD) strategy.risk.allow_entry_in(strategy.direction.long) fast = input(defval=15, default_qty_type = strategy.percent_of_equity, default_qty_value=99, fast) SMA_slow = sma(close, Forex but not FUTURES such as NO1! Simply display no data on backtest. But if I draw plots, I cannot do backtesting on Comodities data on Trading View. I don't know if its common or is it just me? The backtesting code works fine on, initial_capital=10000, it still shows. Any one knows why? Is it simply not supported? //@version=4 strategy("SMA", linewidth=2) fill(p1, linewidth=2) p2 = plot(SMA_slow, overlay=true, slow) start = timestamp(2020, SMA_slow) if (longCondition) and time > start strategy.entry("Long", SMA_slow) if (shortCondition) and time > start strategy.entry("Short", strategy.long) alert("BUY (" + tostring(close) + ")", strategy.short) alert("SELL (" + tostring(close) + ")", title="fast", title="slow", transp = 30) longCondition = crossover(SMA_fast, type = input.integer) slow = input(defval=28, type = input.integer) SMA_fast = sma(close