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

Re: Problems with "Update at every tick" in ts2000i



PureBytes Links

Trading Reference Links

At 04:27 PM 6/2/2004, DH wrote:

>Are you sure? I thought it would remember DaInit from the previous bar,
>not the value you set on a previous tick of this bar.


After sent this I started thinking about it and decided it couldn't work. Otherwise counters would get screwed up counting multiple times on each new tick.

It has to evaluate all expressions on a tick-within-a-bar to be able to correctly plot but must not store the results back in memory.

I use that trick to prevent multiple executions on tick-based charts all the time and it works fine, but a tick-based bar is a real bar. The most common case is the LastBarOnChart function that is true for all bars with the same date/time as the last bar.

I wondered if you could store values in a plot since plots obviously have to be updated to plot correctly.

I will tried the following code and got the printout below.

Clearly Print statements are executed on each tick but the resulting values are not stored until the next bar completes, even for the Plot1 statement...

Bob Fulks

--------------

if Time > Time[1] then begin
   Plot1(Cnt, "1");
   Print(Date:7:0, Time:5:0, " A", Cnt:9:0, Plot1:9:0);
end;

Cnt = Cnt + 1;
Plot1(Plot1 + 1, "1");
Print(Date:7:0, Time:5:0, " B", Cnt:9:0, Plot1:9:0);

--------------- 

1040602 1833 A     2209     2209
1040602 1833 B     2210     2210
1040602 1833 A     2209     2209
1040602 1833 B     2210     2210
1040602 1834 A     2210     2210
1040602 1834 B     2211     2211
1040602 1834 A     2210     2210
1040602 1834 B     2211     2211
1040602 1834 A     2210     2210
1040602 1834 B     2211     2211
1040602 1839 A     2211     2211
1040602 1839 B     2212     2212
1040602 1839 A     2211     2211
1040602 1839 B     2212     2212
1040602 1840 A     2212     2212
1040602 1840 B     2213     2213
1040602 1840 A     2212     2212
1040602 1840 B     2213     2213
1040602 1842 A     2213     2213
1040602 1842 B     2214     2214
1040602 1842 A     2213     2213
1040602 1842 B     2214     2214
1040602 1843 A     2214     2214