Equity Properties

Top  Previous  Next

These properties access equity values for every system in the test (a test can run multiple systems at once).  They are also indexable - if you put a number in brackets, you will get the historical value from that day.  For instance, test.closedEquity[ 5 ] will be the closed equity 5 days ago.  Several of these properties are also graphed when the results for a test are displayed.

 

Bar Indexing

Properties listed with a '[ ]' following them may be indexed using a number which determines which day's data to access. There are also built in constants for 'today' and 'yesterday' which can be used. For example:

 

equity = test.totalEquity[ 5 ]

 

or

 

yesterdaysDate = instrument.date[ yesterday ]

 

will access yesterday's date.

 

NOTE: The most current equity numbers are from the prior day, since the final equity figures are not determined until the end of the day when all scripting has finished.

 

Equity Properties

 

 

 

totalEquity[ ]

 

starts as the Test Starting Equity as specified in Global Parameters.  Is then affected by the total profits, losses, and interest of trades by all systems.  Graphed as the "Equity Curve" graph. For order generation this is the Order Generation Equity.

 

Note that this property is unaffected by the system allocation slider, or the drawdown reduction threshold or amount, or the choice of base equity, whether closed or total.

closedEquity[ ]

 

the total closed equity for all systems. For order generation this is the Order Generation Equity minus open equity

coreEquity

 

the core equity of the test (not indexed)

cash

 

the current cash of the test. Test closed equity minus open position margin (for futures) or cost of purchase (for stocks)..

currentDrawdown[ ]

 

the total percent of equity drawdown.  Graphed as the "Drawdown" graph under test results.

currentRisk[ ]

 

the total percent of total equity at risk, based on the close for  markets with open positions minus the stop price for those positions.  Graphed as the "Total Risk Profile".

startingEquity

 

the equity as of the start of the simulation. Equal to the Test Starting Equity as specified in the Global Parameters

totalMargin

 

the total current margin of all open positions in the test

otherExpense

 

the total other expenses as set by UpdateOtherExpenses