Page 1 of 1

how to remove the delay?

Posted: 09 Mar 2011
by arnie
Hi.

How can I remove the delay that this countdown sometimes have when compared with the build in countdown?
This is for volume bar charts.

Is it possible?

I tried the intrabarpersist, but the delay continued.

Code: Select all

Variables:
TextSize (14),
txtCountdown (-1),
volumeCountdown (0);


if CurrentBar = 1 then begin
txtCountdown = Text_New_S(Date, Time, 0, " ");
Text_SetSize(txtCountdown, TextSize);
Text_SetStyle(txtCountdown, 0, 0);
end;

volumeCountdown = barinterval - ticks;

text_setlocation_s(txtCountdown, date, time_s, low);
text_setstring(txtCountdown, numtostr(volumeCountdown, 0) + "V");

Re: how to remove the delay?

Posted: 09 Mar 2011
by SP
Reset the counter at the opening tick of each new bar

Code: Select all

inputs:
HOffset (2),
VOffset (2),
TextSize (8),
AlertLevel (50),
TextColor (White);

vars:
txt (0),
str (" "),
Count (0),
CountTotal(0);


if BarStatus(1) = 0 then //Reset the counter at the opening tick of each new bar
begin
count = 0;
CountTotal = 0;
str = " ";
end;

count = upticks + downticks;
CountTotal = BarInterval - count;
str = " "+numtostr(CountTotal,0);

if Barnumber = 1 then
begin
txt = text_new(date,Calctime( Time, HOffset),close ,str);
text_SetStyle(txt,0,VOffset);
text_SetColor(txt,TextColor);
text_setsize (txt,textsize);

end else begin

text_SetString(txt,str);
text_SetColor(txt,TextColor);
text_SetLocation_s(txt,date,time_s, (h+l)/2);

end;

Re: how to remove the delay?

Posted: 09 Mar 2011
by arnie
Thanks for the reply SP, but I'm sorry to say that the problem continues.

Having both plots side by side, sometimes my code updates in front of yours, other times your updates in front of mine, but both have from time to time delay when compared with MC's countdown.

Re: how to remove the delay?

Posted: 09 Mar 2011
by TJ
Hi.

How can I remove the delay that this countdown sometimes have when compared with the build in countdown?
This is for volume bar charts.

Is it possible?

I tried the intrabarpersist, but the delay continued.
how much delay you are observing?
1 tick? multiple ticks?

I have tested your code on my computer,
sometimes I can see a minuscule delay, but not all the time.
eg. the built-in timer moves, then followed immediately by the indicator.
the delay seems like a worm dragging its behind,
but the delay is never a tick difference.

Re: how to remove the delay?

Posted: 10 Mar 2011
by arnie
Hi TJ.

From time to time I can see 10 ticks delay.
Fast moves for example, where 1000 contracts are traded in 1 second the delay can go higher then 10 ticks, though this same delay can disappear right at the next traded tick.