Strategy
Strategy functions are mostly used for accessing the simulated brokerage account figures of a strategy. 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
Name |
Description |
Gets the strategy buying power (Cash + Short Market Value), denominated in the strategy's currency. |
|
Gets the buying power of a specified strategy (Cash + Short Market Value), denominated in the strategy's currency. |
|
Gets the amount of cash in the strategy, denominated in the strategy's currency. |
|
Gets the amount of cash in a specified strategy, denominated in the strategy's currency. |
|
Gets the number of strategies in the Desktop. |
|
Gets the strategy 3-letter currency code. (USD, EUR, GBP, JPY, etc.) |
|
Gets the 3-letter currency code of a specified strategy. (USD, EUR, GBP, JPY, etc.) |
|
Gets the strategy equity (Cash + Market Value), denominated in the strategy's currency. |
|
Gets the equity of a specified strategy (Cash + Market Value), denominated in the strategy's currency. |
|
Gets the strategy excess equity (Equity - Loan), denominated in the strategy's currency. |
|
Gets the excess equity of a specified strategy (Equity - Loan), denominated in the strategy's currency. |
|
Gets the exchange rate between two specified currencies. The rate is taken from an historical currency conversion table that is updated daily. |
|
Determines whether the strategy is active or suspended. (See the strategy settings) |
|
Determines whether a specified strategy is active or suspended. (See the strategy settings) |
|
Gets the loan amount owed by the strategy, denominated in the strategy's currency. A strategy automatically takes a loan when it lacks the funds to pay for an order. |
|
Gets the loan amount owed by a specified strategy, denominated in the strategy's currency. A strategy automatically takes a loan when it lacks the funds to pay for an order. |
|
Gets the total market value of all open positions in the strategy, denominated in the strategy's currency. |
|
Gets the total market value of all open positions in a specified strategy, denominated in the strategy's currency. |
|
Gets the runtime strategy mode, i.e. backtesting, optimization, live, etc. |
|
Gets the runtime strategy mode of a specified strategy, i.e. backtesting, optimization, live, etc. |
|
Gets the strategy name. |
|
Gets the name of a specified strategy. |
|
Gets the strategy number in the Desktop. |
|
Transfers cash between two specified strategies by creating a transfer transaction that withdrawals cash from a source strategy and deposits it in a destination strategy. The withdrawal is processed at the Desktop's EOD time (23:59:59 UTC). If the strategies are denominated in different currencies, an historical exchange rates table is used. |
double StrategyBuyingPower() |
Gets the strategy buying power (Cash + Short Market Value), denominated in the strategy's currency. Returns The strategy buying power. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
double StrategyBuyingPower(int strategyNumber) |
||||||
Gets the buying power of a specified strategy (Cash + Short Market Value), denominated in the strategy's currency. Returns The buying power of the specified strategy. Parameters
Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
double StrategyCash() |
Gets the amount of cash in the strategy, denominated in the strategy's currency. Returns The amount of cash in the strategy. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
double StrategyCash(int strategyNumber) |
||||||
Gets the amount of cash in a specified strategy, denominated in the strategy's currency. Returns The amount of cash in the specified strategy. Parameters
Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
int StrategyCount() |
Gets the number of strategies in the Desktop. Returns The number of strategies in the Desktop. Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
string StrategyCurrencyCode() |
Gets the strategy 3-letter currency code. (USD, EUR, GBP, JPY, etc.) Returns The strategy 3-letter currency code. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
string StrategyCurrencyCode(int strategyNumber) |
|||||||||
Gets the 3-letter currency code of a specified strategy. (USD, EUR, GBP, JPY, etc.) Returns The 3-letter currency code of the specified strategy. Parameters
Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
double StrategyEquity() |
Gets the strategy equity (Cash + Market Value), denominated in the strategy's currency. Returns The strategy equity. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
double StrategyEquity(int strategyNumber) |
||||||
Gets the equity of a specified strategy (Cash + Market Value), denominated in the strategy's currency. Returns The equity of the specified strategy. Parameters
Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
double StrategyExcessEquity() |
Gets the strategy excess equity (Equity - Loan), denominated in the strategy's currency. Returns The strategy excess equity. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
double StrategyExcessEquity(int strategyNumber) |
||||||
Gets the excess equity of a specified strategy (Equity - Loan), denominated in the strategy's currency. Returns The excess equity of the specified strategy. Parameters
Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
double StrategyGetExchangeRate(string fromCurrencyCode, string toCurrencyCode) |
|||||||||
Gets the exchange rate between two specified currencies. The rate is taken from an historical currency conversion table that is updated daily. Returns The exchange rate between two specified currencies. Parameters
Scripts AddOn, Commission, TradeManagementStrategy, DynamicAllocation, MultiSymbolTradingStrategy, Screener, PerformanceMetric, PositionSizing, RiskManagement, Slippage, TaxSystem, TradingStrategy |
bool StrategyIsActive() |
Determines whether the strategy is active or suspended. (See the strategy settings) Returns True if the strategy is active, false otherwise. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
bool StrategyIsActive(int strategyNumber) |
||||||
Determines whether a specified strategy is active or suspended. (See the strategy settings) Returns True if the specified strategy is active, false otherwise. Parameters
Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
double StrategyLoan() |
Gets the loan amount owed by the strategy, denominated in the strategy's currency. A strategy automatically takes a loan when it lacks the funds to pay for an order. Returns The strategy loan amount. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
double StrategyLoan(int strategyNumber) |
||||||
Gets the loan amount owed by a specified strategy, denominated in the strategy's currency. A strategy automatically takes a loan when it lacks the funds to pay for an order. Returns The loan amount of the specified strategy. Parameters
Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
double StrategyMarketValue() |
Gets the total market value of all open positions in the strategy, denominated in the strategy's currency. Returns The total value of all open positions in the strategy. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
double StrategyMarketValue(int strategyNumber) |
||||||
Gets the total market value of all open positions in a specified strategy, denominated in the strategy's currency. Returns The total value of all open positions in the specified strategy. Parameters
Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
C_StrategyMode StrategyMode() |
Gets the runtime strategy mode, i.e. backtesting, optimization, live, etc. Returns The strategy mode. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
C_StrategyMode StrategyMode(int strategyNumber) |
||||||
Gets the runtime strategy mode of a specified strategy, i.e. backtesting, optimization, live, etc. Returns The strategy mode of the specified strategy. Parameters
Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
string StrategyName() |
Gets the strategy name. Returns The strategy name. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
string StrategyName(int strategyNumber) |
||||||
Gets the name of a specified strategy. Returns The name of the specified strategy. Parameters
Scripts AddOn, Commission, DynamicAllocation, PerformanceMetric, RiskManagement, Slippage, TaxSystem |
int StrategyNumber() |
Gets the strategy number in the Desktop. Returns The strategy number in the Desktop. Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, Screener, PositionSizing, TradingStrategy |
StrategyTransferCash(int srcStrategyNumber, int desStrategyNumber, double amount, string comment) |
|||||||||||||||
Transfers cash between two specified strategies by creating a transfer transaction that withdrawals cash from a source strategy and deposits it in a destination strategy. The withdrawal is processed at the Desktop's EOD time (23:59:59 UTC). If the strategies are denominated in different currencies, an historical exchange rates table is used. Parameters
Scripts AddOn, DynamicAllocation |