A decision tree for alertcondition problems
Start with the actual compiler result. A missing alert option and a compiler error need different fixes. Do not infer the error from the search phrase alone.
| Observed result | Check | Next action |
|---|---|---|
| Compilation fails at an indented alertcondition() | Is it inside an if, loop, or function? | Move the call to global scope and pass a globally accessible boolean condition. |
| Compilation reports an argument type mismatch | condition needs bool; title and message need const string. | Use a constant message with placeholders, or alert() for a runtime message. |
| Strategy compiles; named alert condition is unavailable | Does the script use strategy()? | Choose alert() events or simulated order fill events instead. |
| Indicator condition is available but no notification arrives | Is the alert active, and does the condition occur on a realtime bar? | Check the alert log, frequency, expiry, runtime errors, and notification destination. |