What is your point Herman? I use RequestTimedRefresh(1) in the program I traced
to determine when TimeNum changed. TimeNum changed when the first tick arrived,
as I stated, regardless of the actual time of day. The following trace
statement shows TimeNum did not change until 4 seconds into the new bar.
Earlier today before the market opened TimeNum did not change until 20 seconds
into the new bar.
4939 10:26:04 AM [184] #, Main, BarCtrl, NewBar = True, OldBarTime = 102500,
NewBarTime = 102600
This is the code I use to test for a new bar
// Check if new bar
OldBarTime = StaticVarGet(VarPfx + "BarTime");
NewBarTime = LastValue(TimeNum());
if( OldBarTime != NewBarTime )
NewBar = True;
else
NewBar = False;
if(DebugOn) _TRACE("#, Main, BarCtrl" + WriteIf(newBar, ", NewBar = True", ",
NewBar = False") + ", OldBarTime = " + NumToStr(OldBarTime, 1, False) + ",
NewBarTime = " + NumToStr(NewBarTime , 1, False) );
StaticVarSet(VarPfx + "BarTime", LastValue(TimeNum()));
I set the static var BarTime to LastValue(TimeNum())in my init routine to
prevent signaling a new bar in the middle of a bar. It will not signal a new
bar until the next bar starts.
Barry