MQL4 How to know the currency margin of a Stock or Index?

 

Hello, while I am calculating the Contra value of portolio (all the positions that I have) in forex and stock, I found this problem ...

In Forex I can know the deposit currency and the currency in which I am trading for its symbol (EURUSD, AUDJPY, USDCAD), so I have lots and base currency to calculate the Counter Value, the financial exposure in that trade.

In the case of Forex, as I know the deposit currency, I only recover the first 3 characters "CAD" / JPY then convert 100.000 CAD * lots / "EURCAD"

Simple example:

Currency Margin is "CAD" the first 3 characters

But when I find an action or Index in my portfolio, some of them are in EUR, but others in USD, so I do not find a function that gives me the margin Currency  ...

Example ITALY40 is calculated in EUR, UK100 in GBP.


Any ideas? Using MarketInfo () at the moment I can not get this margin currency.

Thank you so much.

 
What is this/????
 

If you just need to get the margin currency you can use:

SymbolInfoString(symbol,SYMBOL_CURRENCY_MARGIN)

But if you need to calculate margin then the calculation for Indexes is different from calculation for Forex.
 

For function SymbolInfoString():

ENUM_SYMBOL_INFO_STRING

Identifier

Description

Type

SYMBOL_CURRENCY_BASE

Basic currency of a symbol

string

SYMBOL_CURRENCY_PROFIT

Profit currency

string

SYMBOL_CURRENCY_MARGIN

Margin currency

string

SYMBOL_DESCRIPTION

Symbol description

string

SYMBOL_PATH

Path in the symbol tree

string



 
Petr Nosek:

If you just need to get the margin currency you can use:

SymbolInfoString(symbol,SYMBOL_CURRENCY_MARGIN)

But if you need to calculate margin then the calculation for Indexes is different from calculation for Forex.

----------------------------------------------------------------------------------------


Fernando Morales:

For function SymbolInfoString():

ENUM_SYMBOL_INFO_STRING

Identifier

Description

Type

SYMBOL_CURRENCY_BASE

Basic currency of a symbol

string

SYMBOL_CURRENCY_PROFIT

Profit currency

string

SYMBOL_CURRENCY_MARGIN

Margin currency

string

SYMBOL_DESCRIPTION

Symbol description

string

SYMBOL_PATH

Path in the symbol tree

string





:-(  I am very distract !!!  I did not see this function ! 

Thank You very much !

Reason: