Program type determines available events
The terminal generates NewTick events only for Expert Advisors. A function named OnTick inside a script or custom indicator does not turn that program into an EA. Scripts receive Start and custom indicators receive Calculate events.
Initialization and deinitialization handlers describe lifecycle boundaries. They are the right places to validate inputs, allocate or release resources, subscribe to timers, and explain why the program stopped.
| Handler | Program type | Event |
|---|---|---|
| OnStart | Script | One script run |
| OnTick | Expert Advisor | New quote for the chart symbol |
| OnCalculate | Custom indicator | Indicator calculation |
| OnTimer | EA or indicator | Subscribed timer interval |
