TL_GetAlert (Reserved Word)
This reserved word obtains the alert setting for the specified trendline.
Value1 = TL_GetAlert(Tl_ID)
Tl_ID is a numeric expression representing the ID number of the trendline whose alert status you want to obtain.
Value1 can be any numeric variable or array, and holds the alert status. This reserved word returns one of these three values:
Value |
Description |
0 |
None - no alert enabled |
1 |
Breakout Intrabar |
2 |
Breakout on Close |
Remarks
When the reserved word performs its operation successfully, it returns a value of 0, 1 or 2, indicating the alert status. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see EasyLanguage Drawing Object Error Codes.
An alert set to Breakout on Close is triggered when on a previous bar, the close of the symbol lies on one side of the trendline, and on the current bar, the close ends up on the other side of the trendline. This type of alert is only evaluated once the bar is closed.
An alert set to Breakout Intrabar is triggered if the high crosses over the trendline or if the low crosses under the trendline. This alert is triggered at the moment the trendline is broken.
Example
To obtain the alert status returned by the reserved word, you need to assign the reserved word to a numeric variable. The following obtains the alert status for the trendline referenced by Value99.
Value1 = TL_GetAlert(Value99);
Additional Example
The following statement checks the alert status for the trendline referenced by Value99 and if it is not set to Breakout on Close, it enables it and sets it to Breakout on Close:
If TL_GetAlert(Value99) <> 2 Then
Value1 = TL_SetAlert(Value99, 2);