Difference between revisions of "CheckAlert"

From MultiCharts
Jump to navigation Jump to search
(Created page with "Returns True if the alerts have been turned on in Formatting Studies > Alerts. True/False is returned on the last bar only. For the bars other than the last False is always...")
 
m
 
Line 1: Line 1:
Returns True if the alerts have been turned on in Formatting Studies > Alerts.  
+
Returns True if the alerts have been turned on in Formatting Studies > Alerts. True/False is returned on the last bar only.  
True/False is returned on the last bar only.  
 
  
 
For the bars other than the last False is always returned.  
 
For the bars other than the last False is always returned.  
 
   
 
   
==== Usage ====
+
== Usage ==
 
<syntaxhighlight>
 
<syntaxhighlight>
 
CheckAlert  
 
CheckAlert  
 
</syntaxhighlight>
 
</syntaxhighlight>
  
==== Notes ====
+
== Notes ==
* There is a difference between AlertEnabled and CheckAlert. AlertEnabled checks the status on all the bars while CheckAlert does so for the last bar only.  
+
* There is a difference between [[AlertEnabled]] and CheckAlert. AlertEnabled checks the status on all the bars while CheckAlert does so for the last bar only.  
 
* Alerts are only generated for the last bar.  
 
* Alerts are only generated for the last bar.  
 
   
 
   
==== Example ====
+
== Example ==
 
The example below shows how CheckAlert can help eliminate redundant calculations on historic bars as well as in cases when alerts are not turned on:  
 
The example below shows how CheckAlert can help eliminate redundant calculations on historic bars as well as in cases when alerts are not turned on:  
  
 
<syntaxhighlight>
 
<syntaxhighlight>
 
If CheckAlert Then Begin  
 
If CheckAlert Then Begin  
If Volume >= 2 * Average(Volume, 10) Then Alert ("Volume is going up");  
+
    If Volume >= 2 * Average(Volume, 10) Then Alert ("Volume is going up");  
 
End;  
 
End;  
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Alerts]]
 
[[Category:Alerts]]

Latest revision as of 12:42, 7 February 2012

Returns True if the alerts have been turned on in Formatting Studies > Alerts. True/False is returned on the last bar only.

For the bars other than the last False is always returned.

Usage

CheckAlert

Notes

  • There is a difference between AlertEnabled and CheckAlert. AlertEnabled checks the status on all the bars while CheckAlert does so for the last bar only.
  • Alerts are only generated for the last bar.

Example

The example below shows how CheckAlert can help eliminate redundant calculations on historic bars as well as in cases when alerts are not turned on:

If CheckAlert Then Begin 
    If Volume >= 2 * Average(Volume, 10) Then Alert ("Volume is going up"); 
End;