Keyword for converting home account currency to asset currency.?

Questions about MultiCharts and user contributed studies.
ScottishSpeculator
Posts: 47
Joined: 03 Jan 2023
Been thanked: 3 times

Keyword for converting home account currency to asset currency.?

Postby ScottishSpeculator » 20 Jan 2023

Hello

Does anyone know of a keyword /way to first get your account equity , I think you can use GetRTAccountEquity. But for me for example it would be £ . But most of the assets /commodities will be in USD. Is there a automatic build in way to convert this /function within MC? This is for calculating position size so obviously need to work with same currencies.

Otherwise I could perhaps use data2 for the forex pair on each chart and convert it this way but that seems messier.

cheers guys

User avatar
Svetlana MultiCharts
Posts: 645
Joined: 19 Oct 2017
Has thanked: 3 times
Been thanked: 163 times

Re: Keyword for converting home account currency to asset currency.?

Postby Svetlana MultiCharts » 20 Jan 2023

Hi ScottishSpeculator,

Please refer to Convert_Currency keyword.

ScottishSpeculator
Posts: 47
Joined: 03 Jan 2023
Been thanked: 3 times

Re: Keyword for converting home account currency to asset currency.?

Postby ScottishSpeculator » 20 Jan 2023

ok so can you put get_account keyword in the equation instead of SrcCurrency and use it like this ?

ScottishSpeculator
Posts: 47
Joined: 03 Jan 2023
Been thanked: 3 times

Re: Keyword for converting home account currency to asset currency.?

Postby ScottishSpeculator » 20 Jan 2023

Hello Svetlana . so I think i can get the convert_currency to work but only when I create an equation of equity= initial_equity + netprofit .
What I am really trying to do is use the ID=GetAccountID(); to get ID then pass this into the GetRTAccountEquity(ID ).
However when I try this using my OANDA account /chart its creating the error related to floating points . So maybe there is a 0 in there somehow.
Any advice from anyone who seen this ?
cheers


Return to “MultiCharts”