Skip to content
Predefined Variables

Predefined Variables

The predefined Variables

For each executable mql5-program a set of predefined variables is supported, which reflect the state of the current price chart by the moment a mql5-program (Expert Advisor, script or custom indicator) is started.

Values of predefined variables are set by the client terminal before a mql5-program is started. Predefined variables are constant and cannot be changed from a mql5-program. As exception, there is a special variable _LastError, which can be reset to 0 by the ResetLastError function.

VariableValue
_AppliedToThe _AppliedTo variable allows finding out the type of data, used for indicator calculation
_DigitsNumber of decimal places
_PointSize of the current symbol point in the quote currency
_LastErrorThe last error code
_PeriodTimeframe of the current chart
_RandomSeedCurrent status of the generator of pseudo-random integers
_StopFlagProgram stop flag
_SymbolSymbol name of the current chart
_UninitReasonUninitialization reason code
_IsX64The _IsX64 variable allows finding out the bit version of the terminal, in which an MQL5 application is running

Predefined variables cannot be defined in a library. A library uses such variables that are defined in program from which this library is called.

Last updated on