StrategyHistory functions are mostly used for accessing historical strategy figures, as recorded by the daily snapshots taken of the simulated strategy accounts. Each strategy in a Desktop has its own separate simulated brokerage account which it uses for its own trading activities. The simulated accounts are required for both backtesting and live trading as they allow each strategy to better control its positions and funds, regardless of other trading activities taking place with the same live brokerage account.


Sections


Functions

Function Details


Functions


Name

Description

double StrategyHistoryBuyingPower(int)

Gets the strategy buying power at a specified point in time. (Cash + Short Market Value)

double StrategyHistoryBuyingPower(int, int)

Gets the buying power of a specified strategy at a specified point in time. (Cash + Short Market Value)

double StrategyHistoryCash(int)

Gets the amount of cash in the strategy at a specified point in time.

double StrategyHistoryCash(int, int)

Gets the amount of cash in a specified strategy at a specified point in time.

int StrategyHistoryCount()

Gets the number of historical strategy snapshots.

int StrategyHistoryCount(int)

Gets the number of historical snapshots for a specified strategy.

long StrategyHistoryDateTime(int)

Gets the date/time of a specified historical strategy snapshot.

long StrategyHistoryDateTime(int, int)

Gets the date/time of a specified historical strategy snapshot of a specified strategy.

double StrategyHistoryEquity(int)

Gets the strategy equity at a specified point in time.

double StrategyHistoryEquity(int, int)

Gets the equity of a specified strategy at a specified point in time.

double StrategyHistoryExcessEquity(int)

Gets the strategy excess equity at a specified point in time.

double StrategyHistoryExcessEquity(int, int)

Gets the excess equity of a specified strategy at a specified point in time.

double StrategyHistoryLoan(int)

Gets the strategy loan amount at a specified point in time.

double StrategyHistoryLoan(int, int)

Gets the loan amount of a specified strategy at a specified point in time.

double StrategyHistoryMarketValue(int)

Gets the strategy market value at a specified point in time.

double StrategyHistoryMarketValue(int, int)

Gets the market value of a specified strategy at a specified point in time.


Function Details


double StrategyHistoryBuyingPower(int historyIndex)

Gets the strategy buying power at a specified point in time. (Cash + Short Market Value)


Returns


The strategy buying power at the specified point in time.


Parameters


Type

Identifier

Description

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy


double StrategyHistoryBuyingPower(int strategyNumber, int historyIndex)

Gets the buying power of a specified strategy at a specified point in time. (Cash + Short Market Value)


Returns


The buying power of the specified strategy at the specified point in time.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem


double StrategyHistoryCash(int historyIndex)

Gets the amount of cash in the strategy at a specified point in time.


Returns


The amount of cash in the strategy at the specified point in time.


Parameters


Type

Identifier

Description

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy


double StrategyHistoryCash(int strategyNumber, int historyIndex)

Gets the amount of cash in a specified strategy at a specified point in time.


Returns


The amount of cash in the specified strategy at the specified point in time.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem


int StrategyHistoryCount()

Gets the number of historical strategy snapshots.


Returns


The number of historical strategy snapshots.


Scripts


Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy


int StrategyHistoryCount(int strategyNumber)

Gets the number of historical snapshots for a specified strategy.


Returns


The number of historical snapshots for the specified strategy.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number


Scripts


AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem


long StrategyHistoryDateTime(int historyIndex)

Gets the date/time of a specified historical strategy snapshot.


Returns


The date/time of the specified historical strategy snapshot.


Parameters


Type

Identifier

Description

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy


long StrategyHistoryDateTime(int strategyNumber, int historyIndex)

Gets the date/time of a specified historical strategy snapshot of a specified strategy.


Returns


The date/time of the specified historical strategy snapshot of the specified strategy.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem


double StrategyHistoryEquity(int historyIndex)

Gets the strategy equity at a specified point in time.


Returns


The strategy equity at the specified point in time.


Parameters


Type

Identifier

Description

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy


double StrategyHistoryEquity(int strategyNumber, int historyIndex)

Gets the equity of a specified strategy at a specified point in time.


Returns


The equity of the specified strategy at the specified point in time.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem


double StrategyHistoryExcessEquity(int historyIndex)

Gets the strategy excess equity at a specified point in time.


Returns


The strategy excess equity at the specified point in time.


Parameters


Type

Identifier

Description

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy


double StrategyHistoryExcessEquity(int strategyNumber, int historyIndex)

Gets the excess equity of a specified strategy at a specified point in time.


Returns


The excess equity of the specified strategy at the specified point in time.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem


double StrategyHistoryLoan(int historyIndex)

Gets the strategy loan amount at a specified point in time.


Returns


The strategy loan amount at the specified point in time.


Parameters


Type

Identifier

Description

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy


double StrategyHistoryLoan(int strategyNumber, int historyIndex)

Gets the loan amount of a specified strategy at a specified point in time.


Returns


The loan amount of the specified strategy at the specified point in time.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem


double StrategyHistoryMarketValue(int historyIndex)

Gets the strategy market value at a specified point in time.


Returns


The strategy market value at the specified point in time.


Parameters


Type

Identifier

Description

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy


double StrategyHistoryMarketValue(int strategyNumber, int historyIndex)

Gets the market value of a specified strategy at a specified point in time.


Returns


The market value of the specified strategy at the specified point in time.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number

int

historyIndex

The strategy history index starting from 0, the oldest snapshot, and ending at StrategyHistoryCount - 1, the most recent snapshot


Scripts


AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem