MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Automated Trading Language Documentation

Averaging Price Series for Intermediate Calculations Without Using Additional Buffers Averaging Price Series for Intermediate Calculations Without... Screenshot
GBPJPY, D1
Demo
GMACD Indicator
GMACD
Author: GODZILLA
Subscribe to signal
Golden4x Super Robot IamFx
49.11%, 1 200.70 USD
Average True VolumeAverage True Volume Try product
Average True Volume
Author: VincentX
MQL5 ReferenceMarket InfoSymbolInfoString 

SymbolInfoString

Returns the corresponding property of a specified symbol. There are 2 variants of the function.

1. Immediately returns the property value.

string  SymbolInfoString(
   string                   name,        // Symbol
   ENUM_SYMBOL_INFO_STRING  prop_id      // Identifier properties
   );

2. Returns true or false, depending on the success of a function. If successful, the value of the property is placed in a placeholder variable passed by reference in the last parameter.

bool  SymbolInfoString(
   string                   name,        // Symbol
   ENUM_SYMBOL_INFO_STRING  prop_id,     // Identifier properties
   string&                  string_var   // Here we assume the property value
   );

Parameters

name

[in] Symbol name.

prop_id

[in] Identifier of a symbol property. The value can be one of the values of the ENUM_SYMBOL_INFO_STRING enumeration.

string_var

[out] Variable of the string type receiving the value of the requested property.

Return Value

The value of string type. In case of execution failure, information about the error can be obtained using GetLastError() function:

5040 – invalid string parameter for specifying a symbol name,

4301 – unknown symbol (financial instrument),

4302 – symbol is not selected in "Market Watch" (not found in the list of available ones),

4303 – invalid identifier of a symbol property.

Note

It is recommended to use SymbolInfoTick() if the function is used for getting information about the last tick. It may well be that not a single quote has appeared yet since the terminal is connected to a trading account. In such a case, the requested value will be indefinite.

In most cases, it is enough to use SymbolInfoTick() function allowing a user to receive the values of Ask, Bid, Last, Volume and the time of the last tick's arrival during a single call.


Updated: 2013.03.05