buy at -close limit
timeframe (5 minute, updateonclose)
m5 = -1
if average[20] > average[50] then
m5 = 1
endif
timeframe (15 minute, updateonclose)
m15 = -2
if average[20] > average[50] then
m15 = 2
endif
timeframe (30 minute, updateonclose)
m30 = -3
if average[20] > average[50] then
m30 = 3
endif
timeframe (1 hour, updateonclose)
h1 = -4
if average[20] > average[50] then
h1 = 4
endif
//result = m5 + m15 + m30 + h1
//graph result
graph m5 coloured(128,0,0)
graph m15 coloured(0,128,0)
graph m30 coloured(128,128,0)
graph h1 coloured(0,0,255)
graph 0