Skip to content

Symbol Properties

Symbol Properties

To obtain the current market information there are several functions: SymbolInfoInteger(), SymbolInfoDouble() and SymbolInfoString(). The first parameter is the symbol name, the values of the second function parameter can be one of the identifiers of ENUM_SYMBOL_INFO_INTEGER, ENUM_SYMBOL_INFO_DOUBLE and ENUM_SYMBOL_INFO_STRING.

For function SymbolInfoInteger()

ENUM_SYMBOL_INFO_INTEGER

IdentifierDescriptionType
SYMBOL_SUBSCRIPTION_DELAYSymbol data arrives with a delay. The property can be requested only for symbols selected in MarketWatch (SYMBOL_SELECT = true). The ERR_MARKET_NOT_SELECTED (4302) error is generated for other symbolsbool
SYMBOL_SECTORThe sector of the economy to which the asset belongsENUM_SYMBOL_SECTOR
SYMBOL_INDUSTRYThe industry or the economy branch to which the symbol belongsENUM_SYMBOL_INDUSTRY
SYMBOL_CUSTOMIt is a custom symbol – the symbol has been created synthetically based on other symbols from the Market Watch and/or external data sourcesbool
SYMBOL_BACKGROUND_COLORThe color of the background used for the symbol in Market Watchcolor
SYMBOL_CHART_MODEThe price type used for generating symbols bars, i.e. Bid or LastENUM_SYMBOL_CHART_MODE
SYMBOL_EXISTSymbol with this name existsbool
SYMBOL_SELECTSymbol is selected in Market Watchbool
SYMBOL_VISIBLESymbol is visible in Market Watch.

Some symbols (mostly, these are cross rates required for calculation of margin requirements or profits in deposit currency) are selected automatically, but may not be visible in Market Watch. To be displayed such symbols have to be explicitly selected.
bool
SYMBOL_SESSION_DEALSNumber of deals in the current sessionlong
SYMBOL_SESSION_BUY_ORDERSNumber of Buy orders at the momentlong
SYMBOL_SESSION_SELL_ORDERSNumber of Sell orders at the momentlong
SYMBOL_VOLUMEVolume of the last deallong
SYMBOL_VOLUMEHIGHMaximal day volumelong
SYMBOL_VOLUMELOWMinimal day volumelong
SYMBOL_TIMETime of the last quotedatetime
SYMBOL_TIME_MSCTime of the last quote in milliseconds since 1970.01.01long
SYMBOL_DIGITSDigits after a decimal pointint
SYMBOL_SPREAD_FLOATIndication of a floating spreadbool
SYMBOL_SPREADSpread value in pointsint
SYMBOL_TICKS_BOOKDEPTHMaximal number of requests shown in Depth of Market. For symbols that have no queue of requests, the value is equal to zero.int
SYMBOL_TRADE_CALC_MODEContract price calculation modeENUM_SYMBOL_CALC_MODE
SYMBOL_TRADE_MODEOrder execution typeENUM_SYMBOL_TRADE_MODE
SYMBOL_START_TIMEDate of the symbol trade beginning (usually used for futures)datetime
SYMBOL_EXPIRATION_TIMEDate of the symbol trade end (usually used for futures)datetime
SYMBOL_TRADE_STOPS_LEVELMinimal indention in points from the current close price to place Stop ordersint
SYMBOL_TRADE_FREEZE_LEVELDistance to freeze trade operations in pointsint
SYMBOL_TRADE_EXEMODEDeal execution modeENUM_SYMBOL_TRADE_EXECUTION
SYMBOL_SWAP_MODESwap calculation modelENUM_SYMBOL_SWAP_MODE
SYMBOL_SWAP_ROLLOVER3DAYSThe day of week to charge 3-day swap rolloverENUM_DAY_OF_WEEK
SYMBOL_MARGIN_HEDGED_USE_LEGCalculating hedging margin using the larger leg (Buy or Sell)bool
SYMBOL_EXPIRATION_MODEFlags of allowed order expiration modesint
SYMBOL_FILLING_MODEFlags of allowed order filling modesint
SYMBOL_ORDER_MODEFlags of allowed order typesint
SYMBOL_ORDER_GTC_MODEExpiration of Stop Loss and Take Profit orders, if SYMBOL_EXPIRATION_MODE=SYMBOL_EXPIRATION_GTC (Good till canceled)ENUM_SYMBOL_ORDER_GTC_MODE
SYMBOL_OPTION_MODEOption typeENUM_SYMBOL_OPTION_MODE
SYMBOL_OPTION_RIGHTOption right (Call/Put)ENUM_SYMBOL_OPTION_RIGHT

For function SymbolInfoDouble()

ENUM_SYMBOL_INFO_DOUBLE

IdentifierDescriptionType
SYMBOL_BIDBid - best sell offerdouble
SYMBOL_BIDHIGHMaximal Bid of the daydouble
SYMBOL_BIDLOWMinimal Bid of the daydouble
SYMBOL_ASKAsk - best buy offerdouble
SYMBOL_ASKHIGHMaximal Ask of the daydouble
SYMBOL_ASKLOWMinimal Ask of the daydouble
SYMBOL_LASTPrice of the last dealdouble
SYMBOL_LASTHIGHMaximal Last of the daydouble
SYMBOL_LASTLOWMinimal Last of the daydouble
SYMBOL_VOLUME_REALVolume of the last dealdouble
SYMBOL_VOLUMEHIGH_REALMaximum Volume of the daydouble
SYMBOL_VOLUMELOW_REALMinimum Volume of the daydouble
SYMBOL_OPTION_STRIKEThe strike price of an option. The price at which an option buyer can buy (in a Call option) or sell (in a Put option) the underlying asset, and the option seller is obliged to sell or buy the appropriate amount of the underlying asset.double
SYMBOL_POINTSymbol point valuedouble
SYMBOL_TRADE_TICK_VALUEValue of SYMBOL_TRADE_TICK_VALUE_PROFITdouble
SYMBOL_TRADE_TICK_VALUE_PROFITCalculated tick price for a profitable positiondouble
SYMBOL_TRADE_TICK_VALUE_LOSSCalculated tick price for a losing positiondouble
SYMBOL_TRADE_TICK_SIZEMinimal price changedouble
SYMBOL_TRADE_CONTRACT_SIZETrade contract sizedouble
SYMBOL_TRADE_ACCRUED_INTERESTAccrued interest – accumulated coupon interest, i.e. part of the coupon interest calculated in proportion to the number of days since the coupon bond issuance or the last coupon interest paymentdouble
SYMBOL_TRADE_FACE_VALUEFace value – initial bond value set by the issuerdouble
SYMBOL_TRADE_LIQUIDITY_RATELiquidity Rate is the share of the asset that can be used for the margin.double
SYMBOL_VOLUME_MINMinimal volume for a dealdouble
SYMBOL_VOLUME_MAXMaximal volume for a dealdouble
SYMBOL_VOLUME_STEPMinimal volume change step for deal executiondouble
SYMBOL_VOLUME_LIMITMaximum allowed aggregate volume of an open position and pending orders in one direction (buy or sell) for the symbol. For example, with the limitation of 5 lots, you can have an open buy position with the volume of 5 lots and place a pending order Sell Limit with the volume of 5 lots. But in this case you cannot place a Buy Limit pending order (since the total volume in one direction will exceed the limitation) or place Sell Limit with the volume more than 5 lots.double
SYMBOL_SWAP_LONGLong swap valuedouble
SYMBOL_SWAP_SHORTShort swap valuedouble
SYMBOL_SWAP_SUNDAYSwap calculation ratio (SYMBOL_SWAP_LONG or SYMBOL_SWAP_SHORT) for overnight positions rolled over from SUNDAY to the next day. There following values are supported:

- 0 – no swap is charged
- 1 – single swap
- 3 – triple swap
double
SYMBOL_SWAP_MONDAYSwap calculation ratio (SYMBOL_SWAP_LONG or SYMBOL_SWAP_SHORT) for overnight positions rolled over from Monday to Tuesdaydouble
SYMBOL_SWAP_TUESDAYSwap calculation ratio (SYMBOL_SWAP_LONG or SYMBOL_SWAP_SHORT) for overnight positions rolled over from Tuesday to Wednesdaydouble
SYMBOL_SWAP_WEDNESDAYSwap calculation ratio (SYMBOL_SWAP_LONG or SYMBOL_SWAP_SHORT) for overnight positions rolled over from Wednesday to Thursdaydouble
SYMBOL_SWAP_THURSDAYSwap calculation ratio (SYMBOL_SWAP_LONG or SYMBOL_SWAP_SHORT) for overnight positions rolled over from Thursday to Fridaydouble
SYMBOL_SWAP_FRIDAYSwap calculation ratio (SYMBOL_SWAP_LONG or SYMBOL_SWAP_SHORT) for overnight positions rolled over from Friday to Saturdaydouble
SYMBOL_SWAP_SATURDAYSwap calculation ratio (SYMBOL_SWAP_LONG or SYMBOL_SWAP_SHORT) for overnight positions rolled over from Saturday to Sundaydouble
SYMBOL_MARGIN_INITIALInitial margin means the amount in the margin currency required for opening a position with the volume of one lot. It is used for checking a client’s assets when he or she enters the market.

The SymbolInfoMarginRate() function provides data on the amount of charged margin depending on the order type and direction.
double
SYMBOL_MARGIN_MAINTENANCEThe maintenance margin. If it is set, it sets the margin amount in the margin currency of the symbol, charged from one lot. It is used for checking a client’s assets when his/her account state changes. If the maintenance margin is equal to 0, the initial margin is used.

The SymbolInfoMarginRate() function provides data on the amount of charged margin depending on the order type and direction.
double
SYMBOL_SESSION_VOLUMESummary volume of current session dealsdouble
SYMBOL_SESSION_TURNOVERSummary turnover of the current sessiondouble
SYMBOL_SESSION_INTERESTSummary open interestdouble
SYMBOL_SESSION_BUY_ORDERS_VOLUMECurrent volume of Buy ordersdouble
SYMBOL_SESSION_SELL_ORDERS_VOLUMECurrent volume of Sell ordersdouble
SYMBOL_SESSION_OPENOpen price of the current sessiondouble
SYMBOL_SESSION_CLOSEClose price of the current sessiondouble
SYMBOL_SESSION_AWAverage weighted price of the current sessiondouble
SYMBOL_SESSION_PRICE_SETTLEMENTSettlement price of the current sessiondouble
SYMBOL_SESSION_PRICE_LIMIT_MINMinimal price of the current sessiondouble
SYMBOL_SESSION_PRICE_LIMIT_MAXMaximal price of the current sessiondouble
SYMBOL_MARGIN_HEDGEDContract size or margin value per one lot of hedged positions (oppositely directed positions of one symbol). Two margin calculation methods are possible for hedged positions. The calculation method is defined by the broker.

Basic calculation:

- If the initial margin (SYMBOL_MARGIN_INITIAL) is specified for a symbol, the hedged margin is specified as an absolute value (in monetary terms).
- If the initial margin is not specified (equal to 0), SYMBOL_MARGIN_HEDGED is equal to the size of the contract, that will be used to calculate the margin by the appropriate formula in accordance with the type of the financial instrument (SYMBOL_TRADE_CALC_MODE).

Calculation for the largest position:

- The SYMBOL_MARGIN_HEDGED value is not taken into account.
- The volume of all short and all long positions of a symbol is calculated.
- For each direction, a weighted average open price and a weighted average rate of conversion to the deposit currency is calculated.
- Next, using the appropriate formula chosen in accordance with the symbol type (SYMBOL_TRADE_CALC_MODE) the margin is calculated for the short and the long part.
- The largest one of the values is used as the margin.
double
SYMBOL_PRICE_CHANGEChange of the current price relative to the end of the previous trading day in %double
SYMBOL_PRICE_VOLATILITYPrice volatility in %double
SYMBOL_PRICE_THEORETICALTheoretical option pricedouble
SYMBOL_PRICE_DELTAOption/warrant delta shows the value the option price changes by, when the underlying asset price changes by 1double
SYMBOL_PRICE_THETAOption/warrant theta shows the number of points the option price is to lose every day due to a temporary breakup, i.e. when the expiration date approachesdouble
SYMBOL_PRICE_GAMMAOption/warrant gamma shows the change rate of delta – how quickly or slowly the option premium changesdouble
SYMBOL_PRICE_VEGAOption/warrant vega shows the number of points the option price changes by when the volatility changes by 1%double
SYMBOL_PRICE_RHOOption/warrant rho reflects the sensitivity of the theoretical option price to the interest rate changing by 1%double
SYMBOL_PRICE_OMEGAOption/warrant omega. Option elasticity shows a relative percentage change of the option price by the percentage change of the underlying asset pricedouble
SYMBOL_PRICE_SENSITIVITYOption/warrant sensitivity shows by how many points the price of the option’s underlying asset should change so that the price of the option changes by one pointdouble

For function SymbolInfoString()

ENUM_SYMBOL_INFO_STRING

IdentifierDescriptionType
SYMBOL_BASISThe underlying asset of a derivativestring
SYMBOL_CATEGORYThe name of the sector or category to which the financial symbol belongsstring
SYMBOL_COUNTRYThe country to which the financial symbol belongsstring
SYMBOL_SECTOR_NAMEThe sector of the economy to which the financial symbol belongsstring
SYMBOL_INDUSTRY_NAMEThe industry branch or the industry to which the financial symbol belongsstring
SYMBOL_CURRENCY_BASEBasic currency of a symbolstring
SYMBOL_CURRENCY_PROFITProfit currencystring
SYMBOL_CURRENCY_MARGINMargin currencystring
SYMBOL_BANKFeeder of the current quotestring
SYMBOL_DESCRIPTIONSymbol descriptionstring
SYMBOL_EXCHANGEThe name of the exchange in which the financial symbol is tradedstring
SYMBOL_FORMULAThe formula used for the custom symbol pricing. If the name of a financial symbol used in the formula starts with a digit or contains a special character (">" “, “.”, “-”, “&”, “#” and so on) quotation marks should be used around this symbol name.

- Synthetic symbol: “@ESU19”/EURCAD
- Calendar spread: “Si-9.13”-“Si-6.13”
- Euro index: 34.38805726 * pow(EURUSD,0.3155) * pow(EURGBP,0.3056) * pow(EURJPY,0.1891) * pow(EURCHF,0.1113) * pow(EURSEK,0.0785)
string
SYMBOL_ISINThe name of a symbol in the ISIN system (International Securities Identification Number). The International Securities Identification Number is a 12-digit alphanumeric code that uniquely identifies a security. The presence of this symbol property is determined on the side of a trade server.string
SYMBOL_PAGEThe address of the web page containing symbol information. This address will be displayed as a link when viewing symbol properties in the terminalstring
SYMBOL_PATHPath in the symbol treestring

A symbol price chart can be based on Bid or Last prices. The price selected for symbol charts also affects the generation and display of bars in the terminal. Possible values of the SYMBOL_CHART_MODE property are described in ENUM_SYMBOL_CHART_MODE

ENUM_SYMBOL_CHART_MODE

IdentifierDescription
SYMBOL_CHART_MODE_BIDBars are based on Bid prices
SYMBOL_CHART_MODE_LASTBars are based on Last prices

For each symbol several expiration modes of pending orders can be specified. A flag is matched to each mode. Flags can be combined using the operation of logicalOR (|), for example, SYMBOL_EXPIRATION_GTC|SYMBOL_EXPIRATION_SPECIFIED. In order to check whether a certain mode is allowed for the symbol, the result of the logical AND (&) should be compared to the mode flag.

If flag SYMBOL_EXPIRATION_SPECIFIED is specified for a symbol, then while sending a pending order, you may specify the moment this pending order is valid till.

IdentifierValueDescription
SYMBOL_EXPIRATION_GTC1The order is valid during the unlimited time period, until it is explicitly canceled
SYMBOL_EXPIRATION_DAY2The order is valid till the end of the day
SYMBOL_EXPIRATION_SPECIFIED4The expiration time is specified in the order
SYMBOL_EXPIRATION_SPECIFIED_DAY8The expiration date is specified in the order

Example:

//+------------------------------------------------------------------+
//| Checks if the specified expiration mode is allowed               |
//+------------------------------------------------------------------+
bool IsExpirationTypeAllowed(string symbol,int exp_type)
  {
//--- Obtain the value of the property that describes allowed expiration modes
   int expiration=(int)SymbolInfoInteger(symbol,SYMBOL_EXPIRATION_MODE);
//--- Return true, if mode exp_type is allowed
   return((expiration&exp_type)==exp_type);
  }

If the SYMBOL_EXPIRATION_MODE property is set to SYMBOL_EXPIRATION_GTC (good till canceled), the expiration of pending orders, as well as of Stop Loss/Take Profit orders should be additionally set using the ENUM_SYMBOL_ORDER_GTC_MODE enumeration.

ENUM_SYMBOL_ORDER_GTC_MODE

IdentifierDescription
SYMBOL_ORDERS_GTCPending orders and Stop Loss/Take Profit levels are valid for an unlimited period until their explicit cancellation
SYMBOL_ORDERS_DAILYOrders are valid during one trading day. At the end of the day, all Stop Loss and Take Profit levels, as well as pending orders are deleted.
SYMBOL_ORDERS_DAILY_EXCLUDING_STOPSWhen a trade day changes, only pending orders are deleted, while Stop Loss and Take Profit levels are preserved.

When sending an order, we can specify the filling policy of a volume set in the order. The possible volume-based order execution options for each symbol are specified in the table. It is possible to set several modes for each instrument via a combination of flags. The combination of flags is expressed by the logical OR (|) operation, for example SYMBOL_FILLING_FOK|SYMBOL_FILLING_IOC. To check if a specific mode is allowed for an instrument, compare the logical AND (&) result with the mode flag - example.

Fill policyIDValueDescription
Fill or KillSYMBOL_FILLING_FOK1An order can be executed in the specified volume only.

If the necessary amount of a financial instrument is currently unavailable in the market, the order will not be executed. The desired volume can be made up of several available offers.

When sending an order, the ORDER_FILLING_FOK filling type should be specified for this policy.

The possibility of using FOK orders is determined at the trade server.
Immediate or CancelSYMBOL_FILLING_IOC2A trader agrees to execute a deal with the volume maximally available in the market within that indicated in the order. If the request cannot be filled completely, an order with the available volume will be executed, and the remaining volume will be canceled.

When sending an order, the ORDER_FILLING_IOC filling type should be specified for this policy.

The possibility of using IOC orders is determined at the trade server.
PassiveSYMBOL_FILLING_BOC4The BOC (Book-or-Cancel) policy assumes that an order can only be placed in the Depth of Market and cannot be immediately executed. If the order can be executed immediately when placed, then it is canceled.
In fact, this execution policy can only be specified when the price of the placed order is to be worse than the current market. BoC orders are used to implement passive trading, so that the order is not executed immediately when placed and does not affect current liquidity.
Only limit and stop limit orders are supported, i.e. the SYMBOL_ORDER_MODE flag should contain the SYMBOL_ORDER_LIMIT and/or SYMBOL_ORDER_STOP_LIMIT values.
ReturnNo identifierIn case of partial filling, a market or limit order with remaining volume is not canceled but processed further.

When sending an order, the ORDER_FILLING_RETURN filling type should be specified for this policy.

Return orders are not allowed in the Market Execution mode (market execution — SYMBOL_TRADE_EXECUTION_MARKET).

When sending a trade request using the OrderSend() function, the necessary volume execution policy can be set in the type_filling field, namely in the special MqlTradeRequest structure. The values from the ENUM_ORDER_TYPE_FILLING enumeration are available. If no filling type is specified, ORDER_FILLING_RETURN is automatically set in the trade request. The ORDER_FILLING_RETURN filling type is enabled in any execution mode except for “Market execution” (SYMBOL_TRADE_EXECUTION_MARKET).

While sending a trade request for execution at the current time (time in force), we should keep in mind that financial markets provide no guarantee that the entire requested volume is available for a certain financial instrument at the desired price. Therefore, trading operations in real time are regulated using the price and volume execution modes. The modes, or execution policies, define the rules for cases when the price has changed or the requested volume cannot be completely fulfilled at the moment.

Execution modeDescriptionThe value in ENUM_SYMBOL_TRADE_EXECUTION
Execution mode
(Request Execution)
Executing a market order at the price previously received from the broker.
Prices for a certain market order are requested from the broker before the order is sent. Upon receiving the prices, order execution at the given price can be either confirmed or rejected.
SYMBOL_TRADE_EXECUTION_REQUEST
Instant ExecutionExecuting a market order at the specified price immediately.
When sending a trade request to be executed, the platform automatically adds the current prices to the order.
- If the broker accepts the price, the order is executed.
- If the broker does not accept the requested price, a “Requote” is sent — the broker returns prices, at which this order can be executed.
SYMBOL_TRADE_EXECUTION_INSTANT
Market ExecutionA broker makes a decision about the order execution price without any additional discussion with the trader.
Sending the order in such a mode means advance consent to its execution at this price.
SYMBOL_TRADE_EXECUTION_MARKET
Exchange ExecutionTrade operations are executed at the prices of the current market offers.SYMBOL_TRADE_EXECUTION_EXCHANGE

Before sending an order with the current execution time, for the correct setting of the ORDER_TYPE_FILLING value (volume execution type), you can use the SymbolInfoInteger() function with each financial instrument to get the SYMBOL_FILLING_MODE property value, which shows volume execution types allowed for the symbol as a combination of flags. The ORDER_FILLING_RETURN filling type is enabled at all times except for the “Market execution” mode (SYMBOL_TRADE_EXECUTION_MARKET).

The use of filling types depending on the execution mode can be shown as the following table:

Type of Execution\Fill PolicyFill or Kill (FOK ORDER_FILLING_FOK)Immediate or Cancel (IOC ORDER_FILLING_IOC)Return (Return ORDER_FILLING_RETURN)
Instant Execution
(SYMBOL_TRADE_EXECUTION_INSTANT)
+ (regardless of a symbol setting)+ (regardless of a symbol setting)+ (always)
Request Execution
SYMBOL_TRADE_EXECUTION_REQUEST
+ (regardless of a symbol setting)+ (regardless of a symbol setting)+ (always)
Market Execution
SYMBOL_TRADE_EXECUTION_MARKET
+ (set in the symbol settings)+ (set in the symbol settings)- (disabled regardless of the symbol settings)
Exchange Execution
SYMBOL_TRADE_EXECUTION_EXCHANGE
+ (set in the symbol settings)+ (set in the symbol settings)+ (always)

In case of pending orders, the ORDER_FILLING_RETURN filling type should be used regardless of an execution type (SYMBOL_TRADE_EXEMODE), since such orders are not meant for execution at the time of sending. When using pending orders, a trader agrees in advance that, when conditions for a deal on this order are met, the broker will use the filling type supported by the exchange.

Example:

//+------------------------------------------------------------------+
//| check if a given filling mode is allowed                         |
//+------------------------------------------------------------------+
bool IsFillingTypeAllowed(string symbol,int fill_type)
  {
//--- get the value of the property describing the filling mode
   int filling=(int)SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE);
//--- return 'true' if the fill_type mode is allowed
   return((filling&fill_type)==fill_type);
  }

When sending a trade request using OrderSend() function, an order type from ENUM_ORDER_TYPE enumeration should be specified for some operations. Not all types of orders may be allowed for a specific symbol. SYMBOL_ORDER_MODE property describes the flags of the allowed order types.

IdentifierValueDescription
SYMBOL_ORDER_MARKET1Market orders are allowed (Buy and Sell)
SYMBOL_ORDER_LIMIT2Limit orders are allowed (Buy Limit and Sell Limit)
SYMBOL_ORDER_STOP4Stop orders are allowed (Buy Stop and Sell Stop)
SYMBOL_ORDER_STOP_LIMIT8Stop-limit orders are allowed (Buy Stop Limit and Sell Stop Limit)
SYMBOL_ORDER_SL16Stop Loss is allowed
SYMBOL_ORDER_TP32Take Profit is allowed
SYMBOL_ORDER_CLOSEBY64Close By operation is allowed, i.e. closing a position by another open position on the same instruments but in the opposite direction. The property is set for accounts with the hedging accounting system (ACCOUNT_MARGIN_MODE_RETAIL_HEDGING)

Example:

//+------------------------------------------------------------------+
//| The function prints out order types allowed for a symbol         |
//+------------------------------------------------------------------+
void Check_SYMBOL_ORDER_MODE(string symbol)
  {
//--- receive the value of the property describing allowed order types
   int symbol_order_mode=(int)SymbolInfoInteger(symbol,SYMBOL_ORDER_MODE);
//--- check for market orders (Market Execution)
   if((SYMBOL_ORDER_MARKET&symbol_order_mode)==SYMBOL_ORDER_MARKET)
      Print(symbol+": Market orders are allowed (Buy and Sell)");
//--- check for Limit orders
   if((SYMBOL_ORDER_LIMIT&symbol_order_mode)==SYMBOL_ORDER_LIMIT)
      Print(symbol+": Buy Limit and Sell Limit orders are allowed");
//--- check for Stop orders
   if((SYMBOL_ORDER_STOP&symbol_order_mode)==SYMBOL_ORDER_STOP)
      Print(symbol+": Buy Stop and Sell Stop orders are allowed");
//--- check for Stop Limit orders
   if((SYMBOL_ORDER_STOP_LIMIT&symbol_order_mode)==SYMBOL_ORDER_STOP_LIMIT)
      Print(symbol+": Buy Stop Limit and Sell Stop Limit orders are allowed");
//--- check if placing a Stop Loss orders is allowed
   if((SYMBOL_ORDER_SL&symbol_order_mode)==SYMBOL_ORDER_SL)
      Print(symbol+": Stop Loss orders are allowed");
//--- check if placing a Take Profit orders is allowed
   if((SYMBOL_ORDER_TP&symbol_order_mode)==SYMBOL_ORDER_TP)
      Print(symbol+": Take Profit orders are allowed");
//--- check if closing a position by an opposite one is allowed
   if((SYMBOL_ORDER_TP&symbol_order_mode)==SYMBOL_ORDER_CLOSEBY)
      Print(symbol+": Close by allowed");
//---
  }

The ENUM_SYMBOL_CALC_MODE enumeration is used for obtaining information about how the margin requirements for a symbol are calculated.

ENUM_SYMBOL_CALC_MODE

IdentifierDescriptionFormula
SYMBOL_CALC_MODE_FOREXForex mode - calculation of profit and margin for ForexMargin: Lots * Contract_Size / Leverage * Margin_Rate

Profit: (close_price - open_price) * Contract_Size*Lots
SYMBOL_CALC_MODE_FOREX_NO_LEVERAGEForex No Leverage mode – calculation of profit and margin for Forex symbols without taking into account the leverageMargin: Lots * Contract_Size * Margin_Rate

Profit: (close_price - open_price) * Contract_Size * Lots
SYMBOL_CALC_MODE_FUTURESFutures mode - calculation of margin and profit for futuresMargin: Lots * InitialMargin * Margin_Rate

Profit: (close_price - open_price) * TickPrice / TickSize*Lots
SYMBOL_CALC_MODE_CFDCFD mode - calculation of margin and profit for CFDMargin: Lots * ContractSize * MarketPrice * Margin_Rate

Profit: (close_price - open_price) * Contract_Size * Lots
SYMBOL_CALC_MODE_CFDINDEXCFD index mode - calculation of margin and profit for CFD by indexesMargin: (Lots * ContractSize * MarketPrice) * TickPrice / TickSize * Margin_Rate

Profit: (close_price - open_price) * Contract_Size * Lots
SYMBOL_CALC_MODE_CFDLEVERAGECFD Leverage mode - calculation of margin and profit for CFD at leverage tradingMargin: (Lots * ContractSize * MarketPrice) / Leverage * Margin_Rate

Profit: (close_price-open_price) * Contract_Size * Lots
SYMBOL_CALC_MODE_EXCH_STOCKSExchange mode – calculation of margin and profit for trading securities on a stock exchangeMargin: Lots * ContractSize * LastPrice * Margin_Rate

Profit: (close_price - open_price) * Contract_Size * Lots
SYMBOL_CALC_MODE_EXCH_FUTURESFutures mode – calculation of margin and profit for trading futures contracts on a stock exchangeMargin: Lots * InitialMargin * Margin_Rate or Lots * MaintenanceMargin * Margin_Rate

Profit: (close_price - open_price) * Lots * TickPrice / TickSize
SYMBOL_CALC_MODE_EXCH_FUTURES_FORTSFORTS Futures mode – calculation of margin and profit for trading futures contracts on FORTS. The margin may be reduced by the amount of MarginDiscount deviation according to the following rules:

1. If the price of a long position (buy order) is less than the estimated price, MarginDiscount = Lots*((PriceSettle-PriceOrder)TickPrice/TickSize)

2. If the price of a short position (sell order) exceeds the estimated price, MarginDiscount = Lots
((PriceOrder-PriceSettle)*TickPrice/TickSize)

where:

- - PriceSettle – estimated (clearing) price of the previous session;
- PriceOrder – average weighted position price or open price set in the order (request);
- TickPrice – tick price (cost of the price change by one point)
- TickSize – tick size (minimum price change step)
Margin: Lots * InitialMargin * Margin_Rate or Lots * MaintenanceMargin * Margin_Rate

Profit: (close_price - open_price) * Lots * TickPrice / TickSize
SYMBOL_CALC_MODE_EXCH_BONDSExchange Bonds mode – calculation of margin and profit for trading bonds on a stock exchangeMargin: Lots * ContractSize * FaceValue * open_price * /100

Profit: Lots * close_price * FaceValue * Contract_Size + AccruedInterest * Lots * ContractSize
SYMBOL_CALC_MODE_EXCH_STOCKS_MOEXExchange MOEX Stocks mode – calculation of margin and profit for trading securities on MOEXMargin: Lots * ContractSize * LastPrice * Margin_Rate

Profit: (close_price - open_price) * Contract_Size * Lots
SYMBOL_CALC_MODE_EXCH_BONDS_MOEXExchange MOEX Bonds mode – calculation of margin and profit for trading bonds on MOEXMargin: Lots * ContractSize * FaceValue * open_price * /100

Profit: Lots * close_price * FaceValue * Contract_Size + AccruedInterest * Lots * ContractSize
SYMBOL_CALC_MODE_SERV_COLLATERALCollateral mode - a symbol is used as a non-tradable asset on a trading account. The market value of an open position is calculated based on the volume, current market price, contract size and liquidity ratio. The value is included into Assets, which are added to Equity. Open positions of such symbols increase the Free Margin amount and are used as additional margin (collateral) for open positions of tradable instruments.Margin: no

Profit: no

Market Value: LotsContractSizeMarketPrice*LiqudityRate

There are several symbol trading modes. Information about trading modes of a certain symbol is reflected in the values of enumeration ENUM_SYMBOL_TRADE_MODE.

ENUM_SYMBOL_TRADE_MODE

IdentifierDescription
SYMBOL_TRADE_MODE_DISABLEDTrade is disabled for the symbol
SYMBOL_TRADE_MODE_LONGONLYAllowed only long positions
SYMBOL_TRADE_MODE_SHORTONLYAllowed only short positions
SYMBOL_TRADE_MODE_CLOSEONLYAllowed only position close operations
SYMBOL_TRADE_MODE_FULLNo trade restrictions

Possible deal execution modes for a certain symbol are defined in enumeration ENUM_SYMBOL_TRADE_EXECUTION.

ENUM_SYMBOL_TRADE_EXECUTION

IdentifierDescription
SYMBOL_TRADE_EXECUTION_REQUESTExecution by request
SYMBOL_TRADE_EXECUTION_INSTANTInstant execution
SYMBOL_TRADE_EXECUTION_MARKETMarket execution
SYMBOL_TRADE_EXECUTION_EXCHANGEExchange execution

Methods of swap calculation at position transfer are specified in enumeration ENUM_SYMBOL_SWAP_MODE. The method of swap calculation determines the units of measure of the SYMBOL_SWAP_LONG and SYMBOL_SWAP_SHORT parameters. For example, if swaps are charged in the client deposit currency, then the values of those parameters are specified as an amount of money in the client deposit currency.

ENUM_SYMBOL_SWAP_MODE

IdentifierDescription
SYMBOL_SWAP_MODE_DISABLEDSwaps disabled (no swaps)
SYMBOL_SWAP_MODE_POINTSSwaps are charged in points
SYMBOL_SWAP_MODE_CURRENCY_SYMBOLSwaps are charged in money in base currency of the symbol
SYMBOL_SWAP_MODE_CURRENCY_MARGINSwaps are charged in money in margin currency of the symbol
SYMBOL_SWAP_MODE_CURRENCY_DEPOSITSwaps are charged in money, in client deposit currency
SYMBOL_SWAP_MODE_CURRENCY_PROFITSwaps are charged in money in profit calculation currency
SYMBOL_SWAP_MODE_INTEREST_CURRENTSwaps are charged as the specified annual interest from the instrument price at calculation of swap (standard bank year is 360 days)
SYMBOL_SWAP_MODE_INTEREST_OPENSwaps are charged as the specified annual interest from the open price of position (standard bank year is 360 days)
SYMBOL_SWAP_MODE_REOPEN_CURRENTSwaps are charged by reopening positions. At the end of a trading day the position is closed. Next day it is reopened by the close price +/- specified number of points (parameters SYMBOL_SWAP_LONG and SYMBOL_SWAP_SHORT)
SYMBOL_SWAP_MODE_REOPEN_BIDSwaps are charged by reopening positions. At the end of a trading day the position is closed. Next day it is reopened by the current Bid price +/- specified number of points (parameters SYMBOL_SWAP_LONG and SYMBOL_SWAP_SHORT)

Values of the ENUM_DAY_OF_WEEK enumeration are used for specifying days of week.

ENUM_DAY_OF_WEEK

IdentifierDescription
SUNDAYSunday
MONDAYMonday
TUESDAYTuesday
WEDNESDAYWednesday
THURSDAYThursday
FRIDAYFriday
SATURDAYSaturday

An option is a contract, which gives the right, but not the obligation, to buy or sell an underlying asset (goods, stocks, futures, etc.) at a specified price on or before a specific date. The following enumerations describe option properties, including the option type and the right arising from it.

ENUM_SYMBOL_OPTION_RIGHT

IdentifierDescription
SYMBOL_OPTION_RIGHT_CALLA call option gives you the right to buy an asset at a specified price
SYMBOL_OPTION_RIGHT_PUTA put option gives you the right to sell an asset at a specified price

ENUM_SYMBOL_OPTION_MODE

IdentifierDescription
SYMBOL_OPTION_MODE_EUROPEANEuropean option may only be exercised on a specified date (expiration, execution date, delivery date)
SYMBOL_OPTION_MODE_AMERICANAmerican option may be exercised on any trading day or before expiry. The period within which a buyer can exercise the option is specified for it

Financial instruments are categorized by sectors of the economy. An economic sector is a part of economic activity which has specific characteristics, economic goals, functions and behavior, which allow separating this sector from other parts of the economy. ENUM_SYMBOL_SECTOR lists the economic sectors which a trading instruments can belong to.

ENUM_SYMBOL_SECTOR

IDDescription
SECTOR_UNDEFINEDUndefined
SECTOR_BASIC_MATERIALSBasic materials
SECTOR_COMMUNICATION_SERVICESCommunication services
SECTOR_CONSUMER_CYCLICALConsumer cyclical
SECTOR_CONSUMER_DEFENSIVEConsumer defensive
SECTOR_CURRENCYCurrencies
SECTOR_CURRENCY_CRYPTOCryptocurrencies
SECTOR_ENERGYEnergy
SECTOR_FINANCIALFinance
SECTOR_HEALTHCAREHealthcare
SECTOR_INDUSTRIALSIndustrials
SECTOR_REAL_ESTATEReal estate
SECTOR_TECHNOLOGYTechnology
SECTOR_UTILITIESUtilities

Each financial instrument can be assigned to a specific type of industry or economy branch. An industry is a branch of an economy that produces a closely related set of raw materials, goods, or services. ENUM_SYMBOL_INDUSTRY lists industries which a trading instrument can belong to.

ENUM_SYMBOL_INDUSTRY

IDDescription
INDUSTRY_UNDEFINEDUndefined
Basic materials
INDUSTRY_AGRICULTURAL_INPUTSAgricultural inputs
INDUSTRY_ALUMINIUMAluminium
INDUSTRY_BUILDING_MATERIALSBuilding materials
INDUSTRY_CHEMICALSChemicals
INDUSTRY_COKING_COALCoking coal
INDUSTRY_COPPERCopper
INDUSTRY_GOLDGold
INDUSTRY_LUMBER_WOODLumber and wood production
INDUSTRY_INDUSTRIAL_METALSOther industrial metals and mining
INDUSTRY_PRECIOUS_METALSOther precious metals and mining
INDUSTRY_PAPERPaper and paper products
INDUSTRY_SILVERSilver
INDUSTRY_SPECIALTY_CHEMICALSSpecialty chemicals
INDUSTRY_STEELSteel
Communication services
INDUSTRY_ADVERTISINGAdvertising agencies
INDUSTRY_BROADCASTINGBroadcasting
INDUSTRY_GAMING_MULTIMEDIAElectronic gaming and multimedia
INDUSTRY_ENTERTAINMENTEntertainment
INDUSTRY_INTERNET_CONTENTInternet content and information
INDUSTRY_PUBLISHINGPublishing
INDUSTRY_TELECOMTelecom services
Consumer cyclical
INDUSTRY_APPAREL_MANUFACTURINGApparel manufacturing
INDUSTRY_APPAREL_RETAILApparel retail
INDUSTRY_AUTO_MANUFACTURERSAuto manufacturers
INDUSTRY_AUTO_PARTSAuto parts
INDUSTRY_AUTO_DEALERSHIPAuto and truck dealerships
INDUSTRY_DEPARTMENT_STORESDepartment stores
INDUSTRY_FOOTWEAR_ACCESSORIESFootwear and accessories
INDUSTRY_FURNISHINGSFurnishing, fixtures and appliances
INDUSTRY_GAMBLINGGambling
INDUSTRY_HOME_IMPROV_RETAILHome improvement retail
INDUSTRY_INTERNET_RETAILInternet retail
INDUSTRY_LEISURELeisure
INDUSTRY_LODGINGLodging
INDUSTRY_LUXURY_GOODSLuxury goods
INDUSTRY_PACKAGING_CONTAINERSPackaging and containers
INDUSTRY_PERSONAL_SERVICESPersonal services
INDUSTRY_RECREATIONAL_VEHICLESRecreational vehicles
INDUSTRY_RESIDENT_CONSTRUCTIONResidential construction
INDUSTRY_RESORTS_CASINOSResorts and casinos
INDUSTRY_RESTAURANTSRestaurants
INDUSTRY_SPECIALTY_RETAILSpecialty retail
INDUSTRY_TEXTILE_MANUFACTURINGTextile manufacturing
INDUSTRY_TRAVEL_SERVICESTravel services
Consumer defensive
INDUSTRY_BEVERAGES_BREWERSBeverages - Brewers
INDUSTRY_BEVERAGES_NON_ALCOBeverages - Non-alcoholic
INDUSTRY_BEVERAGES_WINERIESBeverages - Wineries and distilleries
INDUSTRY_CONFECTIONERSConfectioners
INDUSTRY_DISCOUNT_STORESDiscount stores
INDUSTRY_EDUCATION_TRAINIGEducation and training services
INDUSTRY_FARM_PRODUCTSFarm products
INDUSTRY_FOOD_DISTRIBUTIONFood distribution
INDUSTRY_GROCERY_STORESGrocery stores
INDUSTRY_HOUSEHOLD_PRODUCTSHousehold and personal products
INDUSTRY_PACKAGED_FOODSPackaged foods
INDUSTRY_TOBACCOTobacco
Energy
INDUSTRY_OIL_GAS_DRILLINGOil and gas drilling
INDUSTRY_OIL_GAS_EPOil and gas extraction and processing
INDUSTRY_OIL_GAS_EQUIPMENTOil and gas equipment and services
INDUSTRY_OIL_GAS_INTEGRATEDOil and gas integrated
INDUSTRY_OIL_GAS_MIDSTREAMOil and gas midstream
INDUSTRY_OIL_GAS_REFININGOil and gas refining and marketing
INDUSTRY_THERMAL_COALThermal coal
INDUSTRY_URANIUMUranium
Finance
INDUSTRY_EXCHANGE_TRADED_FUNDExchange traded fund
INDUSTRY_ASSETS_MANAGEMENTAssets management
INDUSTRY_BANKS_DIVERSIFIEDBanks - Diversified
INDUSTRY_BANKS_REGIONALBanks - Regional
INDUSTRY_CAPITAL_MARKETSCapital markets
INDUSTRY_CLOSE_END_FUND_DEBTClosed-End fund - Debt
INDUSTRY_CLOSE_END_FUND_EQUITYClosed-end fund - Equity
INDUSTRY_CLOSE_END_FUND_FOREIGNClosed-end fund - Foreign
INDUSTRY_CREDIT_SERVICESCredit services
INDUSTRY_FINANCIAL_CONGLOMERATEFinancial conglomerates
INDUSTRY_FINANCIAL_DATA_EXCHANGEFinancial data and stock exchange
INDUSTRY_INSURANCE_BROKERSInsurance brokers
INDUSTRY_INSURANCE_DIVERSIFIEDInsurance - Diversified
INDUSTRY_INSURANCE_LIFEInsurance - Life
INDUSTRY_INSURANCE_PROPERTYInsurance - Property and casualty
INDUSTRY_INSURANCE_REINSURANCEInsurance - Reinsurance
INDUSTRY_INSURANCE_SPECIALTYInsurance - Specialty
INDUSTRY_MORTGAGE_FINANCEMortgage finance
INDUSTRY_SHELL_COMPANIESShell companies
Healthcare
INDUSTRY_BIOTECHNOLOGYBiotechnology
INDUSTRY_DIAGNOSTICS_RESEARCHDiagnostics and research
INDUSTRY_DRUGS_MANUFACTURERSDrugs manufacturers - general
INDUSTRY_DRUGS_MANUFACTURERS_SPECDrugs manufacturers - Specialty and generic
INDUSTRY_HEALTHCARE_PLANSHealthcare plans
INDUSTRY_HEALTH_INFORMATIONHealth information services
INDUSTRY_MEDICAL_FACILITIESMedical care facilities
INDUSTRY_MEDICAL_DEVICESMedical devices
INDUSTRY_MEDICAL_DISTRIBUTIONMedical distribution
INDUSTRY_MEDICAL_INSTRUMENTSMedical instruments and supplies
INDUSTRY_PHARM_RETAILERSPharmaceutical retailers
Industrials
INDUSTRY_AEROSPACE_DEFENSEAerospace and defense
INDUSTRY_AIRLINESAirlines
INDUSTRY_AIRPORTS_SERVICESAirports and air services
INDUSTRY_BUILDING_PRODUCTSBuilding products and equipment
INDUSTRY_BUSINESS_EQUIPMENTBusiness equipment and supplies
INDUSTRY_CONGLOMERATESConglomerates
INDUSTRY_CONSULTING_SERVICESConsulting services
INDUSTRY_ELECTRICAL_EQUIPMENTElectrical equipment and parts
INDUSTRY_ENGINEERING_CONSTRUCTIONEngineering and construction
INDUSTRY_FARM_HEAVY_MACHINERYFarm and heavy construction machinery
INDUSTRY_INDUSTRIAL_DISTRIBUTIONIndustrial distribution
INDUSTRY_INFRASTRUCTURE_OPERATIONSInfrastructure operations
INDUSTRY_FREIGHT_LOGISTICSIntegrated freight and logistics
INDUSTRY_MARINE_SHIPPINGMarine shipping
INDUSTRY_METAL_FABRICATIONMetal fabrication
INDUSTRY_POLLUTION_CONTROLPollution and treatment controls
INDUSTRY_RAILROADSRailroads
INDUSTRY_RENTAL_LEASINGRental and leasing services
INDUSTRY_SECURITY_PROTECTIONSecurity and protection services
INDUSTRY_SPEALITY_BUSINESS_SERVICESSpecialty business services
INDUSTRY_SPEALITY_MACHINERYSpecialty industrial machinery
INDUSTRY_STUFFING_EMPLOYMENTStuffing and employment services
INDUSTRY_TOOLS_ACCESSORIESTools and accessories
INDUSTRY_TRUCKINGTrucking
INDUSTRY_WASTE_MANAGEMENTWaste management
Real estate
INDUSTRY_REAL_ESTATE_DEVELOPMENTReal estate - Development
INDUSTRY_REAL_ESTATE_DIVERSIFIEDReal estate - Diversified
INDUSTRY_REAL_ESTATE_SERVICESReal estate services
INDUSTRY_REIT_DIVERSIFIEDREIT - Diversified
INDUSTRY_REIT_HEALTCAREREIT - Healthcase facilities
INDUSTRY_REIT_HOTEL_MOTELREIT - Hotel and motel
INDUSTRY_REIT_INDUSTRIALREIT - Industrial
INDUSTRY_REIT_MORTAGEREIT - Mortgage
INDUSTRY_REIT_OFFICEREIT - Office
INDUSTRY_REIT_RESIDENTALREIT - Residential
INDUSTRY_REIT_RETAILREIT - Retail
INDUSTRY_REIT_SPECIALITYREIT - Specialty
Technology
INDUSTRY_COMMUNICATION_EQUIPMENTCommunication equipment
INDUSTRY_COMPUTER_HARDWAREComputer hardware
INDUSTRY_CONSUMER_ELECTRONICSConsumer electronics
INDUSTRY_ELECTRONIC_COMPONENTSElectronic components
INDUSTRY_ELECTRONIC_DISTRIBUTIONElectronics and computer distribution
INDUSTRY_IT_SERVICESInformation technology services
INDUSTRY_SCIENTIFIC_INSTRUMENTSScientific and technical instruments
INDUSTRY_SEMICONDUCTOR_EQUIPMENTSemiconductor equipment and materials
INDUSTRY_SEMICONDUCTORSSemiconductors
INDUSTRY_SOFTWARE_APPLICATIONSoftware - Application
INDUSTRY_SOFTWARE_INFRASTRUCTURESoftware - Infrastructure
INDUSTRY_SOLARSolar
Utilities
INDUSTRY_UTILITIES_DIVERSIFIEDUtilities - Diversified
INDUSTRY_UTILITIES_POWERPRODUCERSUtilities - Independent power producers
INDUSTRY_UTILITIES_RENEWABLEUtilities - Renewable
INDUSTRY_UTILITIES_REGULATED_ELECTRICUtilities - Regulated electric
INDUSTRY_UTILITIES_REGULATED_GASUtilities - Regulated gas
INDUSTRY_UTILITIES_REGULATED_WATERUtilities - Regulated water
INDUSTRY_UTILITIES_FIRSTStart of the utilities services types enumeration. Corresponds to INDUSTRY_UTILITIES_DIVERSIFIED.
INDUSTRY_UTILITIES_LASTEnd of the utilities services types enumeration. Corresponds to INDUSTRY_UTILITIES_REGULATED_WATER.
Last updated on