Getsystemhypothetical inconsistency

Hello

I’m really confused about the results I got from a very simple test of getsystemhypothetical using the signal entry API.



The specifics (using my test system 82918102):

- Did a reset of the system, with a start equity of 50k

- Opened and later closed the following position:

BTO 8 QCLX3 CRUDE OIL at market Filled: 102.03 at 9/29/13 19:39 ET

STC 8 QCLX3 CRUDE OIL at market Filled: 101.48 at 9/30/13 7:38 ET

With the reported broker fees of 111.68, this should give a total P/L of (101.48-102.03)810.0-111.68 = -4511.68 and that’s exactly the value reported on the list of “Closed Trades” on my system details page. So far so good.

At this point I should have total equity of 50000.0-4511.68 = 45488.32



And yet, when calling http://www.collective2.com/cgi-perl/signal.mpl?cmd=getsystemhypothetical&c2email=XXXXX&pw=XXXX&systemid=82918102

I get



<collective2>

<hypotheticalEquity>

<system>

<systemid>82918102</systemid>

<systemname>XXXXXX</systemname>

<totalequityavail>45600.00</totalequityavail>

<cash>45600.00</cash>

<equity>0</equity>

<marginused>0</marginused>

</system>

</hypotheticalEquity>

</collective2>



Now, I notice that the xml matches the values in “Model Account Status” on my system details page:

Started $50,000

Buy Power $45,600

Cash $45,600

Equity $0

Cumulative $ ($4,400)

Total System Equity $45,600

Margined $0

Open P/L $0



So, which one is correct? Could it be due do to some sort of discrepancy with broker fees? Even removing the fees, <totalequityavail>45600.00</totalequityavail> just doesn’t work.

Perhaps it’s a matter of timing? Are the values used for getsystemhypothetical calculated only occasionally during the day? If that’s the case, won’t that pose a difficulty for those systems that calculate leverage based on available equity?



I’ve looked over these forums, and it seems people usually get useful help, so I feel hopeful.

Thanks in advance



As an addendum:

I don’t think it can be a matter of timing, since getsystemhypothetical’s result implicitly indicates that there are no longer open positions. Therefore it is presenting a calculation based on the same two trades.

Sergio -

The API call get getsystemequity returns raw system equity, which does not include commissions and monthly subscription fees. That’s why it looks different from your system’s equity chart.

MK

Thanks Matthew, now I understand.

Is there any way to obtain a system’s equity including typical comissions and sub fees?



cheers

Currently there is not.

However, the commissions fees cost overlay that most customers see when viewing a system does not really affect total system equity available for placing trades.

So - from a programmer’s point of view - you can be comfortable knowing that, if the API tells you that the equity of the system is $100 and the buying power is $100, then your program can place trades for $100 worth of new positions, despite the fact that the chart might show to humans viewing it a reduction of equity of $20 due to commissions.