//@version=2 strategy("GetTrendStrategy", overlay=true) tim=input('160') out1 = security(tickerid, tim, open) out2 = security(tickerid, tim, close) plot(out1,color=red) plot(out2,color=green) longCondition = crossover(security(tickerid, tim, close),security(tickerid, tim, open)) if (longCondition) strategy.entry("long", strategy.long) shortCondition = crossunder(security(tickerid, tim, close),security(tickerid, tim, open)) if (shortCondition) strategy.entry("short", strategy.short)
Only thing behind is this security TIM. I'm not sure what it is. I searched for it and there is a TIM as well but it doesn't really look related. Also it wouldn't explain why the backtest creates clean and profitable trades while it stumbles around when going live. It looks like the security is repainted, but then again it also looks like a normal behaviour of tradingview.
Quite confusing. Not sure if something can be done with it.