• Returns various data about securities listed in the "Market Watch" window.


double  MarketInfo(
string symbol,     // symbol
int      type          // information type
);

Parameters

symbol :[in]  Symbol name.

type     :[in]  Request identifier that defines the type of information to be returned. Can be any of values of request identifiers.



Market information identifiers, used with MarketInfo() function. It can be any of the following values:

ID

Value

Description

MODE_LOW

1

Low day price

MODE_HIGH

2

High day price

MODE_TIME

5

The last incoming tick time (last known server time)

MODE_BID

9

Last incoming bid price. For the current symbol, it is stored in the predefined variable Bid

MODE_ASK

10

Last incoming ask price. For the current symbol, it is stored in the predefined variable Ask

MODE_POINT

11

Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point

MODE_DIGITS

12

Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits

MODE_SPREAD

13

Spread value in points

MODE_STOPLEVEL

14

Stop level in points

A zero value of MODE_STOPLEVEL means either absence of any restrictions on the minimal distance for Stop Loss/Take Profit or the fact that a trade server utilizes some external mechanisms for dynamic level control, which cannot be translated in the client terminal. In the second case, GetLastError() can return error 130, because MODE_STOPLEVEL is actually "floating" here.

MODE_LOTSIZE

15

Lot size in the base currency

MODE_TICKVALUE

16

Tick value in the deposit currency

MODE_TICKSIZE

17

Tick size in points

MODE_SWAPLONG

18

Swap of the buy order

MODE_SWAPSHORT

19

Swap of the sell order

MODE_STARTING

20

Market starting date (usually used for futures)

MODE_EXPIRATION

21

Market expiration date (usually used for futures)

MODE_TRADEALLOWED

22

Trade is allowed for the symbol

MODE_MINLOT

23

Minimum permitted amount of a lot

MODE_LOTSTEP

24

Step for changing lots

MODE_MAXLOT

25

Maximum permitted amount of a lot

MODE_SWAPTYPE

26

Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency

MODE_PROFITCALCMODE

27

Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures

MODE_MARGINCALCMODE

28

Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices

MODE_MARGININIT

29

Initial margin requirements for 1 lot

MODE_MARGINMAINTENANCE

30

Margin to maintain open orders calculated for 1 lot

MODE_MARGINHEDGED

31

Hedged margin calculated for 1 lot

MODE_MARGINREQUIRED

32

Free margin required to open 1 lot for buying

MODE_FREEZELEVEL

33

Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed