CheckAlert: Difference between revisions
From MultiCharts
m
no edit summary
(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...") |
mNo edit summary |
||
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 == | |||
<syntaxhighlight> | <syntaxhighlight> | ||
CheckAlert | CheckAlert | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== 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 == | |||
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]] |