Convert symbol currency into account currency

Created at 01 Dec 2021, 20:43
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
NC

ncel01

Joined 19.03.2020

Convert symbol currency into account currency
01 Dec 2021, 20:43


Hello,

 

1.

How to convert symbol currency into account currency?

Is the following the right way to calculate this?

Symbol.TickValue/Symbol.TickSize

 

2.

How to get to the currency for a given symbol as it's available for the account currency ( Account.Asset.Name) ?

 

Thank you!

 

 


@ncel01
Replies

amusleh
02 Dec 2021, 08:49

Hi,

Right now you can't convert all symbols involved currency values to your account currency as the symbols currency conversion chain is not available on automate API.

You can do it for Forex symbols, by splitting the symbol manually into base and quote currencies, but this will not work for other symbols.

The only option for now is to use Open API which has this data.

You can also open a thread on suggestion section for this feature to be added on Automate API.


@amusleh

ncel01
02 Dec 2021, 13:39

RE:

Hi amusleh,

 

I forgot to mention but the currencies involved will be only EUR and USD.

In such a case, can Symbol.TickValue/Symbol.TickSize be used to get the conversion ratio symbol/account currency? Is this correct?

How to get symbol currency? The equivalent to the account currency given by Account.Asset.Name but for a symbol?

 

Thank you!

 

amusleh said:

Hi,

Right now you can't convert all symbols involved currency values to your account currency as the symbols currency conversion chain is not available on automate API.

You can do it for Forex symbols, by splitting the symbol manually into base and quote currencies, but this will not work for other symbols.

The only option for now is to use Open API which has this data.

You can also open a thread on suggestion section for this feature to be added on Automate API.

 


@ncel01

amusleh
02 Dec 2021, 14:02

RE: RE:

ncel01 said:

Hi amusleh,

 

I forgot to mention but the currencies involved will be only EUR and USD.

In such a case, can Symbol.TickValue/Symbol.TickSize be used to get the conversion ratio symbol/account currency? Is this correct?

How to get symbol currency? The equivalent to the account currency given by Account.Asset.Name but for a symbol?

 

Thank you!

 

amusleh said:

Hi,

Right now you can't convert all symbols involved currency values to your account currency as the symbols currency conversion chain is not available on automate API.

You can do it for Forex symbols, by splitting the symbol manually into base and quote currencies, but this will not work for other symbols.

The only option for now is to use Open API which has this data.

You can also open a thread on suggestion section for this feature to be added on Automate API.

 

Hi,

Yes, you can use Symbol.TickValue, but as I said it will only work for some of the symbols not all symbols.

To convert one symbol TickValue to another currency you need the symbol conversion chain which is not available right now on Automate API.

 


@amusleh

ncel01
03 Dec 2021, 14:01

RE: RE: RE:

Hi amusleh,

Right. Thank you for the clarifications!

 

amusleh said:

ncel01 said:

Hi amusleh,

 

I forgot to mention but the currencies involved will be only EUR and USD.

In such a case, can Symbol.TickValue/Symbol.TickSize be used to get the conversion ratio symbol/account currency? Is this correct?

How to get symbol currency? The equivalent to the account currency given by Account.Asset.Name but for a symbol?

 

Thank you!

 

amusleh said:

Hi,

Right now you can't convert all symbols involved currency values to your account currency as the symbols currency conversion chain is not available on automate API.

You can do it for Forex symbols, by splitting the symbol manually into base and quote currencies, but this will not work for other symbols.

The only option for now is to use Open API which has this data.

You can also open a thread on suggestion section for this feature to be added on Automate API.

 

Hi,

Yes, you can use Symbol.TickValue, but as I said it will only work for some of the symbols not all symbols.

To convert one symbol TickValue to another currency you need the symbol conversion chain which is not available right now on Automate API.

 

 


@ncel01