Trading System API  3.0
Library for Simulating and Deploying Trading and Investment Strategies
tsa::metric Struct Reference

structure defining all the metric names. For example, you can pass metric::trade_count as metric_name argument to the strategy::metric( More...

#include <TSATypeDef.h>

Static Public Attributes

static const std::string avg_cost_per_unit = "avg_cost_per_unit"
 The average 'per unit' transaction cost (slippage + commission). (type: double)
 
static const std::string avg_drawdown = "avg_drawdown"
 The value of the average drawdown in the currency in which the securities are traded. (type: double)
 
static const std::string avg_drawdown__eod = "avg_drawdown__eod"
 The value of the average drawdown in the currency in which the securities are traded (end of day data). (type: double)
 
static const std::string avg_drawdown_length = "avg_drawdown_length"
 The average drawdown length in bars. (type: double)
 
static const std::string avg_drawdown_length__eod = "avg_drawdown_length__eod"
 The average drawdown length in bars (end of day data). (type: double)
 
static const std::string avg_gain_to_avg_loss_ratio = "avg_gain_to_avg_loss_ratio"
 The ratio of the 'average winning trade' / 'average losing trade'. (type: double)
 
static const std::string avg_gross_profit_per_unit = "avg_gross_profit_per_unit"
 The average gross profit/loss per unit. (type: double)
 
static const std::string avg_gross_trade_pl = "avg_gross_trade_pl"
 The average gross trade profit / loss (cash amount). (type: double)
 
static const std::string avg_loser = "avg_loser"
 The average net profit (cash amount) of losing trades. (type: double)
 
static const std::string avg_loser_bar_count = "avg_loser_bar_count"
 The length in bars of the average losing trade. (type: double)
 
static const std::string avg_neg_excursion = "avg_neg_excursion"
 The average negative (adverse) trade profit before trade was closed out. (type: double)
 
static const std::string avg_net_profit_per_unit = "avg_net_profit_per_unit"
 The average net profit/loss per unit. (type: double)
 
static const std::string avg_net_trade_pl = "avg_net_trade_pl"
 The average net trade profit / loss (cash amount). (type: double)
 
static const std::string avg_pos_excursion = "avg_pos_excursion"
 The average positive (advantageous) trade profit before trade was closed out. (type: double)
 
static const std::string avg_slippage_per_unit = "avg_slippage_per_unit"
 The average slippage 'per unit' traded. (type: double)
 
static const std::string avg_trade_bar_count = "avg_trade_bar_count"
 The average trade length in bars. (type: double)
 
static const std::string avg_trade_commission = "avg_trade_commission"
 The average commission per trade. (type: double)
 
static const std::string avg_trade_cost = "avg_trade_cost"
 The average cost (slippage + commission) per trade. (type: double)
 
static const std::string avg_trade_position_size = "avg_trade_position_size"
 The average 'maximum position size' of all trades. (type: double)
 
static const std::string avg_trade_slippage = "avg_trade_slippage"
 The average slippage per trade. (type: double)
 
static const std::string avg_trade_transaction_count = "avg_trade_transaction_count"
 The average number of transactions per trade. (type: double)
 
static const std::string avg_transaction_size = "avg_transaction_size"
 The average transaction size in units. (type: double)
 
static const std::string avg_winner = "avg_winner"
 The average net profit (cash amount) of winning trades. (type: double)
 
static const std::string avg_winner_bar_count = "avg_winner_bar_count"
 The length in bars of the average winning trade. (type: double)
 
static const std::string current_drawdown = "current_drawdown"
 The value of the current drawdown. (type: double)
 
static const std::string gross_profit = "gross_profit"
 The strategy 'gross profit' (before slippage + commission). (type: double)
 
static const std::string in_drawdown = "in_drawdown"
 Not in use. (type: bool)
 
static const std::string last_trade_is_open = "last_trade_is_open"
 flag if the last trade was open before the strategy evaluation/simulation was stopped. (type: bool)
 
static const std::string loser_count = "loser_count"
 The total number of losing trades. (type: int64_t)
 
static const std::string losers_net = "losers_net"
 The net loss generated by losing trades. (type: double)
 
static const std::string max_account_balance = "max_account_balance"
 Not in use.
 
static const std::string max_closed_out_rundown = "max_closed_out_rundown"
 The highest cummulative loss of sequential losing trades. (type: double)
 
static const std::string max_closed_out_runup = "max_closed_out_runnup"
 The highest cummulative gain of sequential winning trades. (type: double)
 
static const std::string max_consec_losers = "max_consec_losers"
 The maximum number of consecutive losing trades. (type: int64_t)
 
static const std::string max_consec_winners = "max_consec_winners"
 The maximum number of consecutive winning trades. (type: int64_t)
 
static const std::string max_drawdown = "max_drawdown"
 The value of the largest drawdown. (type: double)
 
static const std::string max_drawdown__eod = "max_drawdown__eod"
 The value of the largest drawdown (end of day data). (type: double)
 
static const std::string max_drawdown_length = "max_drawdown_length"
 The length in bars of the longest drawdown. (type: int64_t)
 
static const std::string max_drawdown_length__eod = "max_drawdown_length__eod"
 The length in bars of the longest drawdown (end of day data). (type: int64_t)
 
static const std::string max_loser = "max_loser"
 The size of the largest losing trade (cash amount). (type: double)
 
static const std::string max_neg_excursion = "max_neg_excursion"
 The largest negative (adverse) trade profit before trade was closed out. (type: double)
 
static const std::string max_pos_excursion = "max_pos_excursion"
 The largest positive (advantageous) trade profit before trade was closed out. (type: double)
 
static const std::string max_trade_position_size = "max_trade_position_size"
 The maximum position size of any one trade. (type: int64_t)
 
static const std::string max_trade_transaction_count = "max_trade_transaction_count"
 The maximum number of transactions for any one trade. (type: int64_t)
 
static const std::string max_winner = "max_winner"
 The size of the largest winning trade (cash amount). (type: double)
 
static const std::string min_account_balance = "min_account_balance"
 Not in use.
 
static const std::string net_profit = "net_profit"
 The strategy 'net profit' (after slippage + commission). (type: double)
 
static const std::string num_bars_in_trade = "num_bars_in_trade"
 The total number of bars on which the strategy had exposure (position not 'flat'). (type: int64_t)
 
static const std::string num_drawdowns = "num_drawdowns"
 The total number of drawdowns. (type: int64_t)
 
static const std::string num_drawdowns__eod = "num_drawdowns__eod"
 The total number of drawdowns (end of day data). (type: int64_t)
 
static const std::string num_transactions = "num_transactions"
 The total number of transactions. (type: int64_t)
 
static const std::string num_transactions_at_limit = "num_transactions_at_limit"
 The total number of transactions resulting from 'limit orders'. (type: int64_t)
 
static const std::string num_transactions_at_market = "num_transactions_at_market"
 The total number of transactions resulting from 'market orders'. (type: int64_t)
 
static const std::string num_transactions_on_stop = "num_transactions_on_stop"
 The total number of transactions resulting from 'stop orders'. (type: int64_t)
 
static const std::string num_units_traded = "num_units_traded"
 The total number of units traded (not 'round trip'). (type: int64_t)
 
static const std::string num_units_traded_at_limit = "num_units_traded_at_limit"
 The number of units traded using 'limit orders'. (type: int64_t)
 
static const std::string num_units_traded_at_market = "num_units_traded_at_market"
 The number of units traded using 'market orders'. (type: int64_t)
 
static const std::string num_units_traded_on_stop = "num_units_traded_on_stop"
 The number of units traded using 'stop orders'. (type: int64_t)
 
static const std::string num_units_traded_without_slippage = "num_units_traded_without_slippage"
 The number of units traded without slippage. (Limit orders do not have slippage). (type: int64_t)
 
static const std::string percent_bars_in_trade = "percent_bars_in_trade"
 The percentage of bars during which the strategy had exposure (position not 'flat'). (type: double)
 
static const std::string percent_profitable = "percent_profitable"
 The percent of trades profitable. (type: double)
 
static const std::string percent_units_without_slippage = "percent_units_without_slippage"
 The percent of units filled without 'slippage'; via 'limit-orders'. (type: double)
 
static const std::string profit_factor = "profit_factor"
 The ratio of 'total winners net' / 'total losers net'. (type: double)
 
static const std::string sharpe_ratio = "sharpe_ratio"
 The sharpe ratio. (type: double)
 
static const std::string sortino_ratio = "sortino_ratio"
 The sortino ratio. (type: double)
 
static const std::string stddev_trade_pl = "stddev_trade_pl"
 The standard deviation of trade net-profit/loss. (type: double)
 
static const std::string sum_neg_excursion = "sum_neg_excursion"
 The sum of all negative (adverse) trade profit before trade was closed out. (type: double)
 
static const std::string sum_pos_excursion = "sum_pos_excursion"
 The sum of all positive (advantageous) trade profits before trade was closed out. (type: double)
 
static const std::string total_commission = "total_commission"
 The total 'commission' booked for trades. (type: double)
 
static const std::string total_loser_bar_count = "total_loser_bar_count"
 The number of bars of all losing trades. (type: int64_t)
 
static const std::string total_num_bars_processed = "total_num_bars_processed"
 The total number of bars processed by the strategy. (type: int64_t)
 
static const std::string total_slippage = "total_slippage"
 The total 'slippage' booked for trades. Trades resulting from 'limit orders' have no slippage. (type: double)
 
static const std::string total_transaction_cost = "total_transaction_cost"
 The total 'transaction cost' for all trades. (type: double)
 
static const std::string total_winner_bar_count = "total_winner_bar_count"
 The number of bars of all winning trades. (type: int64_t)
 
static const std::string trade_count = "trade_count"
 The total number of trades. (type: int64_t)
 
static const std::string winner_count = "winner_count"
 The total number of winning trades. (type: int64_t)
 
static const std::string winners_net = "winners_net"
 The net profit generated by winning trades. (type: double)
 

Detailed Description

structure defining all the metric names. For example, you can pass metric::trade_count as metric_name argument to the strategy::metric(