Getting Total Account Equity to Calculate Position Size

Questions about MultiCharts and user contributed studies.
flipflopper
Posts: 261
Joined: 28 Feb 2008
Has thanked: 2 times
Been thanked: 1 time

Getting Total Account Equity to Calculate Position Size

Postby flipflopper » 26 Jan 2010

Is there a keyword or function that returns the current total account equity?

And the Current account equity available?

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 27 Jan 2010

Consider using the keywords "NetProfit" to return the closed position profit/loss, then add the keyword "OpenPositionProfit" to add the current open position's profit/loss if MarketPosition <> 0.

flipflopper
Posts: 261
Joined: 28 Feb 2008
Has thanked: 2 times
Been thanked: 1 time

Postby flipflopper » 27 Jan 2010

I actually want to find out the Total account value so I can calculate the proper position size for my trades.

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 27 Jan 2010

You might have to insert the initial current account value manually, then modify it in RT, by adding netprofit. I don't think MC has a reserved word for initial account size.

Spaceant
Posts: 252
Joined: 30 May 2009
Has thanked: 1 time
Been thanked: 3 times

Postby Spaceant » 28 Jan 2010

TSSupport may need to consider adding this somehow later! This is important to strategy development.

Sa

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 28 Jan 2010

This is something that's true of both TS and MultiCharts - an issue in EasyLanguage going back to the 1990s. There's no keyword for the initial equity, or for the current equity. Typically users end up making an input for the initial equity, then add the net as describe above to this to get the current.

I think it's a very reasonable suggestion that MultiCharts should add a keyword for the initial equity, as well as possible the current open equity and current closed equity.

flipflopper
Posts: 261
Joined: 28 Feb 2008
Has thanked: 2 times
Been thanked: 1 time

Postby flipflopper » 28 Jan 2010

Wow. This seems like a major weakness. I can't imagine how one can properly allocate funds in a portfolio is the program doesn't even know how big the account is!!

TS let us know if there is a possibility to add a keyword to return total account equity.

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 28 Jan 2010

Until a keyword can be added, you simply have to make an input for your initial equity, so you can keep track during your backtest of the change relative to that starting point. It's something they could make better, but it's workable now.

skan
Posts: 34
Joined: 15 Jul 2010

Re: Getting Total Account Equity to Calculate Position Size

Postby skan » 01 Dec 2010

It would also be nice to export the realtime equity of each strategy to an spreadsheet or at least having the total equity (all charts together)

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 485 times

Re: Getting Total Account Equity to Calculate Position Size

Postby Dave Masalov » 02 Dec 2010

Dear Sirs,

Please take a look at i_OpenEquity, i_ClosedEquity, initialcapital and openpositionprofit keywords.

skan
Posts: 34
Joined: 15 Jul 2010

Re: Getting Total Account Equity to Calculate Position Size

Postby skan » 02 Dec 2010

Openequity just gives the equity of one strategy in one chart.
You can export every openequity to a different file but I couldn't find any way to show all the openequities together (one for each strategy) or to export them all to the same excel sheet.

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 485 times

Re: Getting Total Account Equity to Calculate Position Size

Postby Dave Masalov » 03 Dec 2010

Openequity just gives the equity of one strategy in one chart.
You can export every openequity to a different file but I couldn't find any way to show all the openequities together (one for each strategy) or to export them all to the same excel sheet.


Dear skan,

You can export these values in Excel using the external dll function. Or you can write them to a text document with delimeters and then export it to Excel. Thus, you won't even need any external dll.

skan
Posts: 34
Joined: 15 Jul 2010

Re: Getting Total Account Equity to Calculate Position Size

Postby skan » 03 Dec 2010

But I need to do it in real time

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 485 times

Re: Getting Total Account Equity to Calculate Position Size

Postby Dave Masalov » 03 Dec 2010

Dear skan,

Then, you need to write a dll function to export values to Excel in real-time. You can find more information on this subject in Easy Language SDK on the Support --> Help and Tutorials --> Documentation page of the site.


Return to “MultiCharts”