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

Re[2]: TS2k LastBarOnChart??



PureBytes Links

Trading Reference Links

On Wednesday, December 12, 2001, 10:58:40 AM, Brian wrote:

B> For whatever reason it's processing the last bar twice when using
B> LastBarOnChart (or LastCalcDate).

Thanks for the confirmation. Note that in my code it does this even
using the LBinit flag which is TURNED OFF after the first execution of
lastbar!! Should NOT happen in any case.

B> When you run the code posted by ztrader, EL seems to return the
B> correct answer (Highest of last 11 bars).

I used this only as a very simple example to illustrate the problem in
a simple way. It is not what I really want to do. The real problem is
much more complex and the double execution TOTALLY DESTROYS what I'm
trying to do. It DOES NOT return the correct answer.

B> All in all, TS may process things twice on the last bar internally
B> which is not expected but it doesn't seem to yield innacurate
B> results.

Depends on what you are trying to do. The HiHi was only a trivial
problem to illustrate the bug.

I need a way to work around the double execution. It seems to occur if
there is *any* look back when at the end of the chart. For example, if
I substitute an array for the high[x] lookback, it does NOT execute
twice. However, keeping large arrays of many variables is, at least, a
PITA, and setting them up to simulate a lookback adds even more code.

Thanks much for looking at this. Any ideas for a work around for the
double execution? Any idea what TS is really doing?

ztrader