Accessing brokerage acct info  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
HawkArps
Posts: 5
Joined: 08 Nov 2011
Has thanked: 4 times

Accessing brokerage acct info

Postby HawkArps » 27 Aug 2012

I'm interested in integrating brokerage account information like other positions held and account value into my PL strategies. How can I use the MC.Net framework or regular PowerLanguage to do this?
Thanks

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

Re: Accessing brokerage acct info

Postby Henry MultiСharts » 28 Aug 2012

Hello HawkArps,

In MultiCharts .Net you need to use PowerLanguage.TradeManager Namespace.

In regular MultiCharts with PowerLanguage you can use:
GetAccount
GetAccountID
GetNumAccounts
GetNumPositions
GetPositionAveragePrice
GetPositionOpenPL
GetPositionQuantity
GetPositionSymbol
GetPositionTotalCost
GetRTAccountEquity
GetRTUnrealizedPL

HawkArps
Posts: 5
Joined: 08 Nov 2011
Has thanked: 4 times

Re: Accessing brokerage acct info

Postby HawkArps » 12 Sep 2012

Thank you Henry MultiCharts,
In an effort to try and understand how the below mentioned functions work I have set up an account (demo) with Zen-Fire and FXCM. Yet I can't seem to get these functions to work.
I created a simple signal.PLA as shown below. Attached is a screenshot of the result. As you can see I am still unable to access account information. Any further help understanding how to use these functions would be appreciated.
Acct info2.png
(173.6 KiB) Downloaded 1058 times
AcctName=GetAccountid;
Value1=GetNumPositions(GetAccountid);
SymbolVar2=GetPositionSymbol(GetAccountid,value1);
SymbolVar1=GetSymbolName;
value4=GetPositionOpenPL(SymbolVar1,GetAccountid);
value5=GetRTAccountEquity(GetAccountid);

COMMENTARYCL("AcctName =",AcctName);
COMMENTARYCL("NumPositions =",Value1);
COMMENTARYCL("PositionSymbol =",SymbolVar2);
COMMENTARYCL("SymbolName =",SymbolVar1);
COMMENTARYCL("PositionOpenPL =",Value4);
COMMENTARYCL("RTAccountEquity =",Value5);
COMMENTARYCL("barssinceentry =",barssinceentry);

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

Re: Accessing brokerage acct info  [SOLVED]

Postby JoshM » 13 Sep 2012

I created a simple signal.PLA as shown below. Attached is a screenshot of the result. As you can see I am still unable to access account information. Any further help understanding how to use these functions would be appreciated.
I thought that one needed to enable the strategy (i.e. with the SA button in the top left of the chart) before this data was available. Then the data from the account selected in the Strategy Properties is returned if I recall correctly.

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

Re: Accessing brokerage acct info

Postby Henry MultiСharts » 13 Sep 2012

I created a simple signal.PLA as shown below. Attached is a screenshot of the result. As you can see I am still unable to access account information. Any further help understanding how to use these functions would be appreciated.
HawkArps, auto trading should be "turned on" on the chart in order to get this information (Format tab->Automate Order Execution).


Return to “MultiCharts .NET”