System Properties

Top  Previous  Next

The following properties refer to the system which contains the block in which a script runs. If you have multiple systems in your test, these values will be different for Blox that run in those different systems.

The system equity numbers are updated prior to the After Trading Day script, so in this script they will represent the most current equity.

 


 


name

 

the name of the system. Useful for printing.

tradingEquity

 

the amount of money available for trading by the current system.

 

The trading equity is determined by the Global Setting parameter "Trading Equity Base," the system allocation slider, the leverage amount, and the drawdown reduction amount.

 

For example, if Trading Equity Base is set to "Total Equity", then the value of system.tradingEquity is equal to the test.totalEquity multiplied by the leverage multiplied by the system's allocation percentage as set by the slider and reduced by the drawdown reduction threshold/amount.

 

For order generation when a value has been entered for Order Generation Equity this number replaces the test total equity number. So the trading equity is calculated from there.

totalEquity[ ]

 

this starts out as system.tradingEquity, and is then affected by the total profits, losses of trades by the system.

 

This property is Indexable, so you can access the system's total equity for bars in the past.  This value will be the same as test.totalEquity, minus interest, if you only have one system in your test with a 100% allocation. For order generation this is the Order Generation Equity times the allocation. Note that this value is from the close of the prior day.

closedEquity[ ]

 

The closed equity of the system as of the close of the prior day.

currentOpenEquity

 

The current open equity of the system. Dynamically takes into consideration positions as they are exited.

currentClosedEquity

 

The current closed equity of the system. Dynamically takes into consideration positions as they are exited.

coreEquity

 

The core equity of the system. Dynamically computed based on current stop prices.

cash

 

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

allocationPercent

 

the percentage of equity available to the current system. Set using the slider in the global parameters

 

 

 

maximumDrawdown

 

the maximum drawdown for the system, in percent from the peak (a positive number between 0% and 100%).

currentDrawdown

 

the current drawdown for the system, in percent from the peak (a positive number between 0% and 100%).

currentRisk

 

the risk in dollars of all open positions in the system. The risk for a given position is determined by looking at the difference between the close and the protect stop for each unit

totalMargin

 

the total margin across all instruments. For futures this is the sum of the futures margin, for stocks it is the sum of the cash required to buy the stocks.

 

 

 

totalInstruments

 

the total number of instruments in the portfolio being tested.

tradingInstruments

 

the total number of instruments in the portfolio being tested that have price information for the current test date, and are primed.

canTradeInstruments

 

the total number of instruments in the portfolio being tested that have price information for the current test date, are primed, and are allowed to trade by the portfolio manager.

totalPositions

 

the number of instruments in the portfolio with a position of LONG or SHORT.

totalLongPositions

 

the number of instruments in the portfolio with a long position

totalShortPositions

 

the number of instruments in the portfolio with a short position

 

 

 

totalUnits

 

the total number of units for long and short positions

totalLongUnits

 

the total units for long positions only

totalShortUnits

 

the total units for short positions only

index


the index number of the system, from 1 to the number of systems in the test.

totalOpenOrders


the total number of open orders for the system

portfolioName


the name of the portfolio being used for the system

orderExists


returns true if the default Order object has context, and false if the Order object is null and cannot be accessed

IsGlobalSuiteSystem


returns true if the system is a Global Suite System