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

Re: LastBarOnChart work-around?



PureBytes Links

Trading Reference Links

The reason for this is that TradeStation checks for the last date and
the last time. If you have several bars with the same last-time
stamp, as you can with tick-based charts, you get the condition true
on all the bars with the same last-time stamp.

Your solution will be true for the first bar of the last date and
last time which is the best I have come up with. (We really would
like the true last bar.)

I usually use:

  Vars: LBInit(TRUE);

  if LastBarOnChart and LBInit then begin
      LBInit = FALSE;
      ......
  end;

This gives the same result.

Also note that the LastBarOnChart function will never be true if you
refer to "Open of next bar" on a time-based chart. This is because it
waits for the next open to do the calculation which never comes on
the LastBarOnChart function.

As PO might say, just another workaround in a buggy application...

Bob Fulks



At 7:18 AM -0700 10/13/01, ztrader wrote:

>LastBarOnChart seems to execute more than once on tick charts. If
>anyone has found a way to get it to work reliably, but just once on the
>'real' last bar, I'd appreciate knowing how.
>
>Otherwise, would the following work-around eliminate the multiple
>executions in real time? I realize it would not execute on each 'last
>bar' - I'm trying to avoid multiple executions on the same bar.
>
>if LastBarOnChart and time <> LastLBtime then begin
>   LastLBtime = time;
>end;
>
>Any potential problems with this?