Difference between revisions of "RaiseRunTimeError"
Jump to navigation
Jump to search
(Created page with "Generates a run-time error and displays the specified error message. A run-time error will cause the execution of the study to be aborted. ==== Usage ==== <syntaxhighligh...") |
|||
(One intermediate revision by one other user not shown) | |||
Line 3: | Line 3: | ||
A run-time error will cause the execution of the study to be aborted. | A run-time error will cause the execution of the study to be aborted. | ||
− | + | == Usage == | |
<syntaxhighlight>RaiseRunTimeError("Message")</syntaxhighlight> | <syntaxhighlight>RaiseRunTimeError("Message")</syntaxhighlight> | ||
− | Where: | + | Where: |
+ | |||
+ | :'''Message''' - a string expression specifying the error message. | ||
− | + | == Example == | |
− | + | Generate a run-time error and display the message "Strategy Stopped": | |
− | RaiseRunTimeError("Strategy Stopped");</syntaxhighlight> | + | <syntaxhighlight>RaiseRunTimeError("Strategy Stopped");</syntaxhighlight> |
− | + | Or to generate a run-time error when the user adds an indicator to an unsuited market: | |
+ | <syntaxhighlight>if (Category = 12) then | ||
+ | RaiseRunTimeError("This indicator isn't suitable for Forex!");</syntaxhighlight> | ||
[[Category:Execution Control]] | [[Category:Execution Control]] |
Latest revision as of 05:55, 9 February 2012
Generates a run-time error and displays the specified error message.
A run-time error will cause the execution of the study to be aborted.
Usage
RaiseRunTimeError("Message")
Where:
- Message - a string expression specifying the error message.
Example
Generate a run-time error and display the message "Strategy Stopped":
RaiseRunTimeError("Strategy Stopped");
Or to generate a run-time error when the user adds an indicator to an unsuited market:
if (Category = 12) then
RaiseRunTimeError("This indicator isn't suitable for Forex!");