Convert_Currency  [SOLVED]

Questions about MultiCharts and user contributed studies.
LA901
Posts: 18
Joined: 15 Dec 2014
Has thanked: 7 times
Been thanked: 4 times

Convert_Currency

Postby LA901 » 17 Jan 2015

I've been testing using convert_currency within contract size calculations for FX based trades and the exchange rate it seems to use always seems a little outdated and thus produces an outdated conversion.

For example the code below when attached to a GBPJPY chart will convert GBP1000 to JPY.

The latest value given i.e. up to date current datetime conversion is 176,357. The real value should be in the region of 178,000.

I've noticed this with all my contract size calculations that utilise convert_currency - they are all slightly incorrect each time.

Where does it get the exchange rate used to do the conversion from, it should be the latest GBPJPY rate but it doesn't seem to be?

Code: Select all

inputs:
BaseCurrency ( GBP ) ;


variables:
AccountCurrency ( 0 ) ;


AccountCurrency = convert_currency( DateTime, BaseCurrency, symbolCurrencyCode, 1000 ) ;
Print("Currency,",NumToStr(AccountCurrency,2));

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Convert_Currency  [SOLVED]

Postby JoshM » 17 Jan 2015

I've noticed this with all my contract size calculations that utilise convert_currency - they are all slightly incorrect each time.

Where does it get the exchange rate used to do the conversion from, it should be the latest GBPJPY rate but it doesn't seem to be?
Only one exchange rate per day is used for the currency conversion (source), so just daily data. Perhaps that can explain the slight differences each time?


Return to “MultiCharts”