A simple strategy is to determine the trend. Do not use it for real-time transactions. Use it as a Reaffirmation trade entry.
//@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)