CheckAlert (Reserved Word)

image\trumpet2.gif Disclaimer

This reserved word determines whether or not the current bar is the last bar on the price chart (or grid) and whether or not the alert is enabled for the indicator or study.

When the alert is enabled and it is the last bar on the chart (or grid), this reserved word returns a value of True. This reserved word will return a value of False for all other bars on the price chart, and on the last bar of the price chart if the alert is not enabled.

Remarks

  • CheckAlert differs from AlertEnabled by only checking the value in the Properties tab of the study to see if alerts are enabled on the last bar.

  • Alerts are only generated for the last bar.

Example

CheckAlert will return True if alerts have been enabled and the bar is the last bar.

Additional Example

the following statements can be used to trigger an alert when the volume is twice the average volume, and to display the ratio between the current volume and the average. Because CheckAlert is used, the calculations are ignored for all historical bars as well as when the alert is not enabled.

If CheckAlert Then Begin
Value1
= Volume / Average(Volume, 10);
If
Volume >= 2 * Average(Volume, 10) Then
 
Alert ("Volume is" + NumtoStr(Value1, 2) );
End
;