Difficulties converting from any symbol's currency to account currency

 

Hi All,


Hope you are all well. I've gone through some of the topics here to find a few suggestions to solve this problem which I'm sure many have come across.

I'm finding that converting a symbol's profit currency to account currency is way more difficult than expected to be.

I've come across a suggestion by some of the more experienced fellows here regarding using TICKVALUE or it's equivalent in MQL5 (I don't see MODE_TICKVALUE available).

I've come across another suggestion saying that this does not work on all symbols with all brokers so I am left pondering in as to what I can do.


So far, I feel the consideration I have is to just have an array of symbol to symbol and do the calculation like that but I feel this is a little manual and probably not ideal.


I seek to ask for  a reliable means to convert profit currency to symbol currency by just knowing a symbol and a price; Where can I start looking to achieve this please? This does not have to; nor will it, depend on an existing position or order.



Thanks


Duncan

 
dnc77:

Hi All,


Hope you are all well. I've gone through some of the topics here to find a few suggestions to solve this problem which I'm sure many have come across.

I'm finding that converting a symbol's profit currency to account currency is way more difficult than expected to be.

I've come across a suggestion by some of the more experienced fellows here regarding using TICKVALUE or it's equivalent in MQL5 (I don't see MODE_TICKVALUE available).

I've come across another suggestion saying that this does not work on all symbols with all brokers so I am left pondering in as to what I can do.


So far, I feel the consideration I have is to just have an array of symbol to symbol and do the calculation like that but I feel this is a little manual and probably not ideal.


I seek to ask for  a reliable means to convert profit currency to symbol currency by just knowing a symbol and a price; Where can I start looking to achieve this please? This does not have to; nor will it, depend on an existing position or order.



Thanks


Duncan

Yes, this is indeed not as easy, or obvious to achieve.

One suggestion I can give, try to use this function to calculate the tick value of the symbol in account currency.


If you need a different currency than your account currency, you need to do the calculations yourself. For that, you need to dig into this:


And especially the section:

ENUM_SYMBOL_CALC_MODE.

It has all relevant formulas documented.
 
Dominik Egert #:
Yes, this is indeed not as easy, or obvious to achieve.

One suggestion I can give, try to use this function to calculate the tick value of the symbol in account currency.


If you need a different currency than your account currency, you need to do the calculations yourself. For that, you need to dig into this:


And especially the section:

ENUM_SYMBOL_CALC_MODE.

It has all relevant formulas documented.
Thanks again Dominik.
Reason: