„MetaQuotes Language MQL4/MQL5“ – Versionsunterschied

[ungesichtete Version][ungesichtete Version]
Inhalt gelöscht Inhalt hinzugefügt
Vgbyp (Diskussion | Beiträge)
Issues
Smallbones (Diskussion | Beiträge)
Client terminal events in the event model of the Language: removed trivia without independent source
Zeile 69:
==Operations and expressions==
All common operations - arithmetic, bool, binary etc. are present in MQL4/MQL5. The precedence of operations corresponds to that adopted in С++.
 
==Client terminal events in the event model of the Language==
The MQL4 and MQL5 languages allow writing programs handling client terminal events. Unlike procedural languages using the flat functional model, MQL uses an [[Event-driven programming|event model]]. There are several event types in MQL4 and MQL5.
* Init (event of a program loading, or beginning of work after a financial instrument has been changed, or input parameters have been altered, or the account has been switched);
* DeInit (event generated when the terminal has finished work, before a change of a financial instrument, a chart timeframe, an account or input parameters);
* Start (event starting a script after the latter has been loaded);
* NewTick (event generated upon receiving new quotes);
* Calculate (generated only for indicators when price data gets changed or immediately after the Init event has been generated);
* Timer (generated periodically if the user has activated the timer with a specific function);
* Tester (generated immediately after testing of an Expert Advisor on historical data has finished);
* Chart Event (generated when a user is working with a chart, namely, when graphical objects are created and deleted, when a graphical object gets clicked on or moved with a mouse or when text on a chart gets edited etc.);
* BookEvent (generated after the Depth Of Market is changed, only in MQL5).
Each of the above events is handled by the functions provided in the language.<ref>{{Cite web|url=https://www.mql5.com/en/docs/runtime/event_fire|title=MQL5 programs / Client Terminal Events|last=|first=|date=|website=MQL5 Reference|archive-url=|archive-date=|dead-url=|access-date=August 23, 2017}}</ref>
 
==Criticism==