Predefined variables
Each MQL program has a certain general set of global variables provided by the terminal: we have already covered most of them in the previous sections, and below is a summary table. Almost all variables are read-only. The exception is the variable _LastError, which can be reset by the ResetLastError function.
In addition, for MQL programs running in the chart context of a chart, such as Expert Advisors, scripts, and indicators, the language provides predefined variables with chart properties (they also cannot be changed from the program).
Variable
|
Value
|
_Symbol
|
Name of the current chart symbol, an analog of the Symbol function
|
_Period
|
Current chart timeframe, an analog of the Period function
|
_Digits
|
The number of decimal places in the price of the current chart symbol, an analog of the Digits function
|
_Point
|
Point size in the prices of the current symbol (in the quote currency), an analog of the Point function
|
_AppliedTo
|
Type of data on which the indicator is calculated (only for indicators)
|