[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Time Compared to Time[1] Problem



PureBytes Links

Trading Reference Links

I recently ran into a problem in some code of mine
which is not working as I expect.  This has me
stumped, but I've narrowed the source of the problem
down to the issue I'll describe below:

If I write a comparison such as

TM = Time;
If TM<>TM[1] then Print(Time, "New Bar");

I would anticipate this to work properly when written
in an indicator, even when that indicator is set up to
"Update Every Tick".

I'm experimenting with this simple expression used in
an indicator on a 1 minute chart of NQ.  What I'm
watching being printed in my Debug window is
1012 New Bar
1012 New Bar
1012 New Bar
1012 New Bar
1012 New Bar
1012 New Bar
1013 New Bar
1013 New Bar
 with every tick a new line is added.
 
 So, I'm also printing the difference of TM-TM[1],
which turns out to be nonzero within the same one
minute timeframe???

Clearly, I'm missing some understanding about the way
that TS2000 handles time.  Can someone enlighten me on
what's causing this unexpected behaviour?

Thanks!

--
Dave Nadeau
Fort Collins, CO