GetRTAccountNetWorth on Oanda?  [SOLVED]

Questions about MultiCharts and user contributed studies.
Sebastian Vermont
Posts: 37
Joined: 06 Jan 2016
Has thanked: 6 times
Been thanked: 5 times

GetRTAccountNetWorth on Oanda?

Postby Sebastian Vermont » 07 Mar 2016

Has anyone had success with GetRTAccountNetWorth() on Oanda? I cannot get it to return the account balance-- it keeps returning 0.

Here is the code I am using:

Code: Select all

print ("Time= ", Time);
print ("GetAccountID= ", GetAccountID());
print ("GetRTAccountNetWorth= ", GetRTAccountNetWorth(GetAccountID()));


I am running this on live data, with SA turned on.

GetAccountID is returning the correct account number.

Any help or direction would be greatly appreciated. Thanks again.

Sebastian Vermont
Posts: 37
Joined: 06 Jan 2016
Has thanked: 6 times
Been thanked: 5 times

Re: GetRTAccountNetWorth on Oanda?

Postby Sebastian Vermont » 07 Mar 2016

I should also note that GetRTAccountEquity is not returning the account balance, either:

Code: Select all

print ("GetRTAccountEquity= ", GetRTAccountEquity(GetAccountID));
Returns:

Code: Select all

GetRTAccountEquity= 179769313486231570000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000.00
(Unfortunately, my actual account size is not that large)

Sebastian Vermont
Posts: 37
Joined: 06 Jan 2016
Has thanked: 6 times
Been thanked: 5 times

Re: GetRTAccountNetWorth on Oanda?  [SOLVED]

Postby Sebastian Vermont » 07 Mar 2016

Well, it looks like GetRTCashBalance works just fine. I had never seen that function before, just happened to come across it while searching. I am not trying to understand the difference between the various functions-- GetRTCashBalance, GetAccountNetWorth, GetRTAccountEquity, etc and then I'll mark this as solved.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: GetRTAccountNetWorth on Oanda?

Postby Henry MultiСharts » 09 Mar 2016

Hello Sebastian,

GetRTAccountNetWorth and GetRTAccountEquity are not supplied by OANDA connection.

Sebastian Vermont
Posts: 37
Joined: 06 Jan 2016
Has thanked: 6 times
Been thanked: 5 times

Re: GetRTAccountNetWorth on Oanda?

Postby Sebastian Vermont » 09 Mar 2016

Thanks. For my purposes, GetRTCashBalance appears to work just fine. I do have one question though that I can't seem to find the answer to (and can't figure out how to test without risking capital)-- Does GetRTCashBalance return my balance at Oanda, or does it return unused margin? So, lets say I take a trade which uses $5K margin on a $50K account-- will GetRTCashBalanace return 50000 or 45000?

Thanks again

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: GetRTAccountNetWorth on Oanda?

Postby Henry MultiСharts » 11 Mar 2016

Hello Sebastian,

It returns the Balance value that you can see in the Oanda platform.

Sebastian Vermont
Posts: 37
Joined: 06 Jan 2016
Has thanked: 6 times
Been thanked: 5 times

Re: GetRTAccountNetWorth on Oanda?

Postby Sebastian Vermont » 11 Mar 2016

Thanks, that's exactly what I needed to know


Return to “MultiCharts”