Login Page - Create Account

Support Board


Date/Time: Wed, 22 May 2024 00:10:08 +0000



Post From: ACSIL Currency conversion

[2020-04-05 12:45:40]
ACWalker - Posts: 6
Hello,

I am working on a position sizer, and I would like to be able to convert an account balance in a currency to the currency relevant to the chart.
I suspect the ConvertCurrencyValueToCommonCurrency() function could do this, but I can't seem to get it to work.
For example, for an account balance in GBP on a EURUSD chart I am calling it like this:

SCString outputCurrency;
SCString sourceCurrency = "GBP";
float currency = sc.ConvertCurrencyValueToCommonCurrency(Input_AccountBalance.GetFloat(), sourceCurrency, outputCurrency);

However, the returned currency value is the same value as the inputted currency and the outputCurrency is an empty string. Am I calling the function wrong?

Thanks,

Alex