Hello Matt,
I posted an email to info@collective2.com some time ago, but have no response. So I am trying here.
Have a look at these, please:
www.trade-and-win.com/c2/accountvalue
I hope I understand your questions properly. If not, let me know.
The formula for buying power is:
BP = Cash + equity - margined amount
The columns in the "open trades table" are calculated slightly differently depending on the type of instrument being displayed. Since you are dealing primarily with stocks, I will explain these.
"Cash" shows the amount of cash deducted from your account to open the position. C2 assumes that all stocks above $5 can be bought on margin, which means that a $20 per share stock will "cost" you only $10 worth of cash. "Equity" is the incremental equity that your account either gains or loses through the position you hold. If you have an open position marked-to-market with $1,000 of profit, then, in theory, that $1,000 can be used to open other, new positions (this is implicit in the Buying Power formula above).
Matt wrote:
BP = Cash + equity - margined amount
"Equity" is the incremental equity that your account either gains or loses through the position you hold. If you have an open position marked-to-market with $1,000 of profit, then, in theory, that $1,000 can be used to open other, new positions (this is implicit in the Buying Power formula above).
-----------------------------------------------
Question number 1 - Buy Power
-----------------------------------------------
Let’s have an example:
Started = 100000
Cumulative = 2000
Open Positions:
±--------------------------------------------+
# SymbolBuyPriceMarketPrice Cash Equity
-----------------------------------------------
100 ABC 100 110 -5000 1000
100 DEF 100 110 -5000 1000
100 GHI 100 110 -5000 1000
±–±------±------±----------±-----±-----+
---- ---- ---- ---- -15000 3000
±--------------------------------------------+
BP = Cash + equity - margined amount =
= Started + Cumulative + Equity - abs(SumOfCashFromOpenTradesTable) =
= 100000 + 2000 + 3000 - 15000 =
= 90000
Is this calculation OK? Probably not, because in the example I have posted (www.trade-and-win.com/c2/accountvalue):
BP = Cash + equity - margined amount =
= Started + Cumulative + Equity - abs(SumOfCashFromOpenTradesTable) =
= 100000 + 14275 - 95 - 6883 =
= 107297
C2 shows: 107392
The difference is: 107392 - 107297 = 95 = Equity
So my calculation is wrong. Where, please?
---------------------------------
Question number 2 - Account Value
---------------------------------
I need the whole account value for position sizing.
I’ll try calculate it:
AccountValue = Cash + LongPositions =
= Started + Cumulative + SumOfEquityFromOpenTradesTable + 2abs(SumOfCashFromOpenTradesTable)
Values from the hypothetical example above:
AccountValue = 100000 + 2000 + 3000 + 2 * 15000
= 135000
From the example I have posted (www.trade-and-win.com/c2/accountvalue):
AccountValue = 100000 + 14275 - 95 + 2 * 6883
= 127946
Is it OK?
There is no such number $127,946 on the trading system page in the given example.
I need the AccountValue for position sizing.
I can calculate it, but I must download the list of history trades, filter it to get just open trades and calculate SumOfCashFromOpenTradesTable. Wouldn’t it be possible to get this number via some API command?
To compare actual numbers from the getsystemhypothetical, getbuypower and getsystemoverview commands with my actual data from the Solaris system right now:
getsystemhypothetical:
<hypotheticalEquity>
<system>
<systemid>123456</systemid>
<systemname>Solaris</systemname>
<totalequityavail>107449.60</totalequityavail>
<cash>107427.60</cash>
<equity>22</equity>
<marginused>0</marginused>
</system>
</hypotheticalEquity>
getbuypower:
<collective2>
<status>OK</status>
<calctime>1207477275</calctime>
<buypower>107449.90</buypower>
</collective2>
getsystemoverview:
<summarystats>
<startcapital>100000</startcapital>
<openpl>21.9</openpl>
<closedpl>16305</closedpl>
<marginused>0</marginused>
<equity>21.9</equity>
<cash>107428</cash>
<trades>191</trades>
<numloss>73</numloss>
<dollarwin>45061.6</dollarwin>
<dollarloss>28637.2</dollarloss>
</summarystats>
Using actual data from the trading system page
(see the picture: www.trade-and-win.com/c2/accountvalue/actualsolaris200804061200.jpg):
AccountValue = Cash + LongPositions
= Started + Cumulative + SumOfEquityFromOpenTradesTable + 2abs(SumOfCashFromOpenTradesTable) =
= 100000 + 16413 + 21 + 2 * 8964 =
= 134362
BP = Cash + equity - margined amount =
= Started + Cumulative + Equity - abs(SumOfCashFromOpenTradesTable) =
= 100000 + 16413 + 21 - 8964 =
= 107470
Comparing numbers one can see:
- The whole account value $134,362 can not be found on the system page.
- BP has difference from your formula posted: 107470 - 107449 = 21 = Equity
- Probably there is no API command for the account value. (I cannot find it.)
- Value of “totalequityavail” element from the “hypotheticalEquity” command is the Buy Power as shown on the system page and it is equal to the “buypower” element from the “getbuypower” command.
Why I am writing all this and summarize it:
- I need the whole account value. C2 doesn’t offer it.
- I can calculate the whole account value, but I think it would be better if C2 will calculate it.
- Trying calculate it, I went into doubts, that the BuyPower is calculated right.
- hypotheticalEquity/totalequityavail = getbuypower/buypower
- And when I am looking at the getsystemoverview/summarystats right now:
What is the closedpl = 16305, if dollarwin - dollarloss = 45061.6 - 28637.2 = 16424.40 ? Difference: 16305 - 16424.40 = -119.40
Sincerely Bob
HUH! I refreshed the statistics on the system page right now and numbers are a bit different.
Cumu=16424, Cash=107438, BuyPower=107459. Other numbers are the same.
Right now is Sunday, 7:53 am. Does it mean, that statistics were not updated from Friday?