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
Accessing brokerage acct info [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Accessing brokerage acct info
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
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
Re: Accessing brokerage acct info
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.
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);
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.
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);
- 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]
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.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.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Accessing brokerage acct info
HawkArps, auto trading should be "turned on" on the chart in order to get this information (Format tab->Automate Order Execution).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.