T
Trendman
Guest
I wrote what I thought was an easy code to count and display accumulative tick count. The display for some reason does not include the first bar. I am using the secondsTill Time function to say every new day set the counter to zero as I am only interested in viewing the cumulative tick for each day. I included the code on a 15 minute bar chart of the $TICK chart and at the end of the day the total tick count displayed does not balance, it is missing the value of the first 15 minute bar.
I think I need a fresh pair of eyes on this!
def TickValue = close(symbol = "$TICK");
def CumTickValue = if secondsTillTime(930) < 0 and secondsTillTime(1600) > 0 then TickValue + CumTickValue[1] else 0;
AddLabel(yes, "Cum Tick: " + CumTickValue, if CumTickValue < 0 then Color.Red else Color.green);
# End Code
Thank
Frank
I think I need a fresh pair of eyes on this!
def TickValue = close(symbol = "$TICK");
def CumTickValue = if secondsTillTime(930) < 0 and secondsTillTime(1600) > 0 then TickValue + CumTickValue[1] else 0;
AddLabel(yes, "Cum Tick: " + CumTickValue, if CumTickValue < 0 then Color.Red else Color.green);
# End Code
Thank
Frank