- Getting available symbols and Market Watch lists
- Editing the Market Watch list
- Checking if a symbol exists
- Checking the symbol data relevance
- Getting the last tick of a symbol
- Schedules of trading and quoting sessions
- Symbol margin rates
- Overview of functions for getting symbol properties
- Checking symbol status
- Price type for building symbol charts
- Base, quote, and margin currencies of the instrument
- Price representation accuracy and change steps
- Permitted volumes of trading operations
- Trading permission
- Symbol trading conditions and order execution modes
- Margin requirements
- Pending order expiration rules
- Spreads and order distance from the current price
- Getting swap sizes
- Current market information (tick)
- Descriptive symbol properties
- Depth of Market
- Custom symbol properties
- Specific properties (stock exchange, derivatives, bonds)
Current market information (tick)
In the section Getting the last tick of a symbol, we have already seen the SymbolInfoTick function, which provides complete information about the last tick (price change event) in the form of the MqlTick structure. If necessary, the MQL program can request the values of prices and volumes corresponding to the fields of this structure separately. All of them are denoted by properties of different types that are part of the ENUM_SYMBOL_INFO_INTEGER and ENUM_SYMBOL_INFO_DOUBLE enumerations.
Identifier |
Description |
Property type |
---|---|---|
SYMBOL_TIME |
Last quote time |
datetime |
SYMBOL_BID |
Bid price; the best sell offer |
double |
SYMBOL_ASK |
Ask price; the best buy offer |
double |
SYMBOL_LAST |
Last; the price of the last deal |
double |
SYMBOL_VOLUME |
The volume of the last deal |
long |
SYMBOL_TIME_MSC |
The time of the last quote in milliseconds since 1970.01.01 |
long |
SYMBOL_VOLUME_REAL |
The volume of the last deal with increased accuracy |
double |
Note that the code for the two volume-related properties, SYMBOL_VOLUME and SYMBOL_VOLUME_REAL, is the same in both enumerations. This is the only case where the element IDs of different enumerations overlap. The thing is that they return essentially the same tick property, but with different representation accuracy.
Unlike a structure, properties do not provide an analog to the uint flags field, which tells what kind of changes in the market caused the tick generation. This field is only meaningful within a structure.
Let's try to request tick properties separately and compare them with the result of the SymbolInfoTick call. In a fast market, there is a possibility that the results will differ. A new tick (or even several ticks) may come between function calls.
void OnStart()
|
It is easy to verify that in a particular case, the information coincided.
TimeToString(SymbolInfoInteger(_Symbol,SYMBOL_TIME),TIME_DATE|TIME_SECONDS)
|