LastBarOnChart (Function)

image\trumpet2.gif Disclaimer

The LastBarOnChart function is used to determine if the current bar being evaluated is the last bar on the chart.

Syntax

LastBarOnChart

Returns (Boolean)

True if LastBarOnChart is the last charted bar. False if not.

Parameters

None

Example

In order to play a wave (sound) file only in the last bar of the chart you can write:

If LastBarOnChart Then
 Condition1 = PlaySound("C:\window\ding.wav");

  This function will return True for all bars on a chart with tick-based interval, which have the same date and time as the last bar of the chart.