Difference between revisions of "Cancel Alert"
Jump to navigation
Jump to search
(Created page with "The expression deactivates alerts. This is necessary if a script contains multiple alert statements and they need to be turned off under certain conditions. ==== Usage ==== ...") |
|||
Line 10: | Line 10: | ||
Alerts are only generated for the last bar | Alerts are only generated for the last bar | ||
− | |||
==== Example ==== | ==== Example ==== | ||
The example shows how all alerts can be turned off depending on time. The alerts will not be displayed after 10:00 pm. | The example shows how all alerts can be turned off depending on time. The alerts will not be displayed after 10:00 pm. | ||
− | |||
<syntaxhighlight> | <syntaxhighlight> | ||
If Close > Close[1] Then | If Close > Close[1] Then | ||
− | Alert("Price is going up"); | + | Alert("Price is going up"); |
If Volume > Volume[1] Then | If Volume > Volume[1] Then | ||
− | Alert("Volume is increasing"); | + | Alert("Volume is increasing"); |
If Volatility(5) > Volatility(5)[1] Then | If Volatility(5) > Volatility(5)[1] Then | ||
− | Alert("Volatility is rising"); | + | Alert("Volatility is rising"); |
If OpenInt > OpenInt[1] Then | If OpenInt > OpenInt[1] Then | ||
− | Alert("Open interest is growing"); | + | Alert("Open interest is growing"); |
If Time >= 2200 Then Cancel Alert; | If Time >= 2200 Then Cancel Alert; | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 19:49, 16 January 2012
The expression deactivates alerts. This is necessary if a script contains multiple alert statements and they need to be turned off under certain conditions.
Usage
Cancel Alert
Notes
Alerts are only generated for the last bar
Example
The example shows how all alerts can be turned off depending on time. The alerts will not be displayed after 10:00 pm.
If Close > Close[1] Then
Alert("Price is going up");
If Volume > Volume[1] Then
Alert("Volume is increasing");
If Volatility(5) > Volatility(5)[1] Then
Alert("Volatility is rising");
If OpenInt > OpenInt[1] Then
Alert("Open interest is growing");
If Time >= 2200 Then Cancel Alert;