1) Plot 4H close line and open line on the chart
2) Do following based on chart resolution :
a) 15Min chart
15Min close > 4H Close -> Go Long on next candle open
b) 1Hr chart
1Hr close > 4H Close -> Go Long on next candle open
So based on chart resolution it should check for close with 4Hr close.
3) If 15Min close < 4H Open-> Go Short on next candle open
I have this strategy in TradingView pinescript just need to convert it in ninjascript :
PineScript Code :
================================================== ===============
imeF=input('240') //4H
precision=input(0.05)
openPrice = security(tickerid, timeF, open)
closePrice = security(tickerid, timeF, close)
plot(openPrice,color=red,linewidth=4)
plot(closePrice,color=green,linewidth=4)
goLongValue=(closePrice - openPrice)*100/openPrice
goShortValue=(openPrice - closePrice)*100/closePrice
longCondition = goLongValue > precision
shortCondition = goShortValue > precision
if (longCondition)
strategy.entry("long", strategy.long)
if (shortCondition)
strategy.entry("short", strategy.short)
================================================== ===============
Comment