14 #ifndef TSA_TYPEDEF__INCLUDED 15 #define TSA_TYPEDEF__INCLUDED 19 #if defined(min) || defined(max) 20 #error "min() and/or max() are defined as preprocessor macros.\ 21 Define NOMINMAX macro before including any system headers!" 36 #if defined (_MSC_VER) 37 # if TSA_COMPILING_DLL 38 # define dll_export __declspec(dllexport) 40 # define dll_export __declspec(dllimport) 48 #if defined (_MSC_VER) 49 typedef __int64 int64_t;
50 typedef __int32 int32_t;
51 typedef unsigned __int64 uint64_t;
52 typedef unsigned __int32 uint32_t;
58 #if _MSC_VER <= 1800 // VS 2013 59 #define noexcept throw() 69 #if defined (_MSC_VER) 70 # pragma warning(disable: 4800) //warning C4800: 'int' : forcing value to bool 'true' or 'false' 71 # pragma warning(disable: 4100) //warning C4100: unreferenced formal parameter 76 typedef unsigned char Byte;
95 enum class strategy_end_type {
120 const identifier_t undefined_id = (
identifier_t)std::pow(2, 53);
123 size_t identifier_to_size_t(identifier_t);
126 int identifier_to_int(identifier_t);
129 int size_type_to_int(
size_t);
132 const size_t NPOS = ~(size_t)0;
134 #define DB_NIL (-1L) //IU 135 const size_t DB_NPOS = ~(size_t)0;
136 typedef long TSEstoredValue;
137 typedef long TSEoffset;
138 typedef unsigned long TSEspace;
192 size_t binary_write_size(type_t);
202 bool is_numeric(type_t);
205 bool is_ptr_type(type_t);
285 num_units_traded_other,
286 risk_free_annual_rate_of_return,
299 static const std::vector<std::string> trade_metric_names;
405 static const std::string basket_instrument_num_bars_processed;
406 static const std::string basket_strategy_num_bars_processed;
407 static const std::string annual_risk_free_rate_of_return;
411 static const std::string total_instrument_duration;
480 const char* class_name(
void)
const;
487 bool has_same_class_as(
const object& other)
const;
491 void assert_failure(
const char* msg,
const char* file,
int line);
492 void verify_failure(
const char* msg,
const char* file,
int line);
496 #define TSA__IS_KIND_OF(class_name, pObj) ( dynamic_cast<class_name*>( pObj ) != nullptr ) 501 namespace unit_test {
507 #include "TSAGlobal.h" 509 #define tsa_declare_testable friend class tsa::unit_test::CoreTests; friend class tsa::unit_test::DBTests; 511 #define tsa_verify(condition) if (condition); \ 512 else tsa::verify_failure("___failed: a(" #condition ") ", __FILE__, __LINE__) 514 #define tsa_throw_not_implemented tsa::assert_failure("not implemented", __FILE__, __LINE__); 518 #define tsa_assert_kind_of(class_name, object_ptr) \ 519 assert(dynamic_cast<class_name*>( object_ptr ) != nullptr) 521 #define tsa_assert_instance_of(class_name, object_ptr) \ 522 assert(( object_ptr )->IsInstanceOfClass(#class_name)) 524 #define tsa_assert(condition) if (condition); \ 525 else tsa::assert_failure("___failed: a(" #condition ") ", __FILE__, __LINE__) 527 #define tsa_fp_are_equal_3(a, b) float64_comparison(a, b, 1e-3) 528 #define tsa_fp_are_equal_6(a, b) float64_comparison(a, b, 1e-6) 529 #define tsa_fp_are_equal_9(a, b) float64_comparison(a, b, 1e-9) 530 #define tsa_fp_are_equal_12(a, b) float64_comparison(a, b, 1e-12) 532 #define tsa_assert_kind_of(class_name, pObject) ((void)0) 533 #define tsa_assert_instance_of(class_name, object) ((void)0) 534 #define tsa_assert(x) ((void)0) 535 #define EVAL_ASSERT(x) ((void)0) 536 #define tsa_fp_are_equal_3(a, b) ((void)0) 537 #define tsa_fp_are_equal_6(a, b) ((void)0) 538 #define tsa_fp_are_equal_9(a, b) ((void)0) 550 class symbol_exchange_pair_parser :
public tsa::object 555 symbol_exchange_pair_parser(
void);
557 ~symbol_exchange_pair_parser(
void);
576 static const std::vector<std::string> m_expiry_months;
580 int m_expiry_year = 0;
581 int m_expiry_month = 0;
585 bool m_expires =
false;
586 bool m_is_valid =
false;
590 bool only_last_2_char_are_digit(
const std::string&)
const;
591 int expiry_str_to_expiry_year(
const std::string&)
const;
592 int month_str_to_month(
const std::string& month_str);
593 int expiry_code_to_month(
char expiry_code);
594 void verify_expires(
void)
const;
595 void verify_is_valid(
void)
const;
601 bool expires(
void)
const;
604 char expiry_month_code(
void)
const;
616 int expiry_year(
void)
const;
619 int expiry_month(
void)
const;
642 bool m_has_ccy =
false;
643 void verify_exchange_valid(
void)
const;
652 bool has_currency(
void)
const {
return m_has_ccy; }
668 enum class bar_interval_type {
673 fixed_time_bar_type_start = 100,
685 bool is_fixed_time_bar_type(tsa::bar_interval_type);
688 tsa::bar_interval_type string_to_bar_interval_type(
const std::string&);
691 std::string bar_interval_type_to_string(tsa::bar_interval_type);
703 bar_interval_type m_bar_interval_type = bar_interval_type::undefined;
704 size_t m_bar_interval_size = 0;
710 void interval_size(
size_t sz) { m_bar_interval_size = sz; }
711 void interval_type(tsa::bar_interval_type type) { m_bar_interval_type = type; }
712 bool is_intraday(
void)
const;
713 tsa::bar_interval_type interval_type(
void)
const {
return m_bar_interval_type; }
714 size_t interval_size(
void)
const {
return m_bar_interval_size; }
716 bool parse_bar_type_string(
const std::string& bar_type,
717 tsa::bar_interval_type& bar_interval_type,
size_t& bar_interval_size);
719 tsa::bar_interval_type bar_ival_type,
size_t bar_ival_size);
730 friend class series_def;
740 bool make_combined(
void)
const;
741 mutable bool m_string_rep_is_valid =
false;
746 ticker_def(
const ticker_def&);
747 void operator=(
const ticker_def&);
750 bool is_valid(
void)
const;
752 bool expires(
void)
const;
764 bool has_currency(
void)
const;
768 bool operator== (
const ticker_def& other)
const;
769 bool operator!= (
const ticker_def& other)
const;
784 tsa_declare_testable;
794 bar_interval_type m_bar_interval_type = bar_interval_type::undefined;
795 size_t m_bar_interval_size = 0;
803 bool is_complete(
void)
const;
804 void bar_interval_size(
size_t sz) { m_bar_interval_size = sz; }
805 void bar_interval_type(tsa::bar_interval_type type) { m_bar_interval_type = type; }
806 bool bar_interval_type_is_intraday(
void)
const;
807 tsa::bar_interval_type bar_interval_type(
void)
const {
return m_bar_interval_type; }
808 size_t bar_interval_size(
void)
const {
return m_bar_interval_size; }
811 bool expires(
void)
const;
814 bool exchange_has_ccy(
void)
const;
830 tsa::ticker_def to_ticker_def(
void)
const;
840 tsa_declare_testable;
847 instrument_def(
void);
849 bool operator== (
const instrument_def&)
const;
852 bool is_complete(
void)
const;
854 bool symbol_expires(
void)
const;
856 bool exchange_has_ccy(
void)
const;
973 c_medium_spring_green,
982 c_light_goldenrod_yellow,
1018 c_medium_violet_red,
1043 friend class color_manager;
1045 bool m_use_default_instead;
1052 int R(
void)
const {
return m_red; }
1055 int G(
void)
const {
return m_green; }
1058 int B(
void)
const {
return m_blue; }
1069 explicit color(
unsigned char red,
unsigned char green,
unsigned char blue);
1078 explicit color(tsa::ColorCode);
1084 bool IsValid(
void)
const;
1085 bool UseDefaultInstead(
void)
const;
1086 int as_int(
void)
const;
1087 int Difference(
const color&)
const;
1089 color Differentiate(
double dPercent)
const;
1090 void InitFromInt(
int);
1091 bool HasEqualColors(
const color& _other)
const;
1092 bool IsEqual(
const color& _other)
const;
1094 void operator=(
const color& _other);
1096 void CopyRGB(
const color& _other);
1413 struct hash <tsa::ticker_def> {
1414 std::size_t operator()(
const tsa::ticker_def& td)
const {
1415 return std::hash<std::string>()(td.to_string());
Parses symbol:expiry combinations.
Definition: TSATypeDef.h:572
static const color beige
Definition: TSATypeDef.h:1335
static const color dodger_blue
Definition: TSATypeDef.h:1237
static const color saddle_brown
Definition: TSATypeDef.h:1327
double max(const series< double > &series, size_t period)
Returns the highest value found in series over given .
Definition: TSAFunctionsScalar.cpp:180
static const std::string total_commission
The total 'commission' booked for trades. (type: double)
Definition: TSATypeDef.h:332
static const std::string avg_drawdown
The value of the average drawdown in the currency in which the securities are traded. (type: double)
Definition: TSATypeDef.h:362
The average gross trade profit / loss (cash amount).
static const std::string avg_transaction_size
The average transaction size in units. (type: double)
Definition: TSATypeDef.h:382
No Logs. (Disables logging - the default setting)
Definition: TSATypeDef.h:425
static const color chartreuse
Definition: TSATypeDef.h:1289
static const color khaki
Definition: TSATypeDef.h:1305
static const color mint_cream
Definition: TSATypeDef.h:1189
static const color dark_orchid
Definition: TSATypeDef.h:1393
static const std::string avg_slippage_per_unit
The average slippage 'per unit' traded. (type: double)
Definition: TSATypeDef.h:346
static const color light_cyan
Definition: TSATypeDef.h:1263
static const color deep_pink
Definition: TSATypeDef.h:1371
static const color bisque
Definition: TSATypeDef.h:1135
static const std::string total_loser_bar_count
The number of bars of all losing trades. (type: int64_t)
Definition: TSATypeDef.h:322
static const std::string avg_drawdown__eod
The value of the average drawdown in the currency in which the securities are traded (end of day data...
Definition: TSATypeDef.h:372
static const color olive_drab
Definition: TSATypeDef.h:1301
static const color ivory_2
Definition: TSATypeDef.h:1165
static const color white_smoke
Definition: TSATypeDef.h:1113
static const std::string num_units_traded
The total number of units traded (not 'round trip'). (type: int64_t)
Definition: TSATypeDef.h:387
Definition: TSATypeDef.h:106
static const color deep_sky_blue
Definition: TSATypeDef.h:1239
static const std::string percent_bars_in_trade
The percentage of bars during which the strategy had exposure (position not 'flat'). (type: double)
Definition: TSATypeDef.h:327
The average net trade profit / loss (cash amount)
static const color antique_white_2
Definition: TSATypeDef.h:1125
static const color papaya_whip
Definition: TSATypeDef.h:1131
The average transaction size in units.
The total number of winning trades.
Commission and slippage are booked per unit.
Definition: TSATypeDef.h:420
static const color bisque_2
Definition: TSATypeDef.h:1137
static const color light_goldenrod
Definition: TSATypeDef.h:1317
The average 'per unit' transaction cost (slippage + commission).
static const std::string num_units_traded_at_limit
The number of units traded using 'limit orders'. (type: int64_t)
Definition: TSATypeDef.h:391
static const std::string max_loser
The size of the largest losing trade (cash amount). (type: double)
Definition: TSATypeDef.h:309
static const color green_yellow
Definition: TSATypeDef.h:1293
static const std::string total_transaction_cost
The total 'transaction cost' for all trades. (type: double)
Definition: TSATypeDef.h:334
Namespace for the 'Trading System API' library.
Definition: original1.TSA3Core.cpp:20
object(void)
Constructor.
Definition: TSATypeDef.h:468
const size_t print_no_limit
flag to print without limiting the number of lines printed.
Definition: TSATypeDef.h:78
static const color cornsilk_2
Definition: TSATypeDef.h:1157
The percent of units filled without 'slippage', via 'limit-orders'.
The value of the current drawdown.
static const color floral_white
Definition: TSATypeDef.h:1117
static const std::string max_trade_position_size
The maximum position size of any one trade. (type: int64_t)
Definition: TSATypeDef.h:340
static const color hot_pink
Definition: TSATypeDef.h:1369
static const std::string avg_trade_position_size
The average 'maximum position size' of all trades. (type: double)
Definition: TSATypeDef.h:342
static const std::string percent_profitable
The percent of trades profitable. (type: double)
Definition: TSATypeDef.h:304
Bar Log.
Definition: TSATypeDef.h:428
static const color dark_goldenrod
Definition: TSATypeDef.h:1321
static const color auto_color
Definition: TSATypeDef.h:1099
static const std::string sum_pos_excursion
The sum of all positive (advantageous) trade profits before trade was closed out. (type: double) ...
Definition: TSATypeDef.h:313
The number of bars of all losing trades.
static const color light_sea_green
Definition: TSATypeDef.h:1281
The size of the largest winning trade (cash amount).
static const color seashell_3
Definition: TSATypeDef.h:1177
static const color light_pink
Definition: TSATypeDef.h:1375
static const color white
Definition: TSATypeDef.h:1201
static const std::string sharpe_ratio
The sharpe ratio. (type: double)
Definition: TSATypeDef.h:400
The maximum number of consecutive losing trades.
static const color sandy_brown
Definition: TSATypeDef.h:1339
static const std::string total_num_bars_processed
The total number of bars processed by the strategy. (type: int64_t)
Definition: TSATypeDef.h:326
Order Log.
Definition: TSATypeDef.h:429
The standard deviation of trade net-profit/loss.
static const color alice_blue
Definition: TSATypeDef.h:1193
static const std::string sortino_ratio
The sortino ratio. (type: double)
Definition: TSATypeDef.h:401
The ratio of 'total winners net' / 'total losers net'.
seek_result
Return value for seek operations on series tables.
Definition: TSATypeDef.h:156
missing_table_flag_type
Values that represent missing table flag types.
Definition: TSATypeDef.h:111
The strategy 'gross profit' (before slippage + commission).
perf_metric_type
Values that represent performance metric types.
Definition: TSATypeDef.h:216
static const color powder_blue
Definition: TSATypeDef.h:1251
static const std::string num_units_traded_at_market
The number of units traded using 'market orders'. (type: int64_t)
Definition: TSATypeDef.h:389
The average negative (adverse) trade profit before trade was closed out.
The average slippage 'per unit' traded.
static const std::string gross_profit
The strategy 'gross profit' (before slippage + commission). (type: double)
Definition: TSATypeDef.h:329
static const color cornsilk_3
Definition: TSATypeDef.h:1159
static const std::string winner_count
The total number of winning trades. (type: int64_t)
Definition: TSATypeDef.h:303
static const color peach_puff_3
Definition: TSATypeDef.h:1147
static const color seashell
Definition: TSATypeDef.h:1173
The average cost (slippage + commission) per trade.
static const char * copyright
Copyright information.
Definition: TSATypeDef.h:146
static const std::string avg_loser_bar_count
The length in bars of the average losing trade. (type: double)
Definition: TSATypeDef.h:323
static const std::string max_neg_excursion
The largest negative (adverse) trade profit before trade was closed out. (type: double) ...
Definition: TSATypeDef.h:316
static const color medium_orchid
Definition: TSATypeDef.h:1391
Drawdown Log.
Definition: TSATypeDef.h:430
static const color moccasin
Definition: TSATypeDef.h:1153
static const color steel_blue
Definition: TSATypeDef.h:1245
Definition: TSASQLite.h:39
static const std::string in_drawdown
Not in use. (type: bool)
Definition: TSATypeDef.h:356
static const std::string avg_winner
The average net profit (cash amount) of winning trades. (type: double)
Definition: TSATypeDef.h:307
static const color spring_green
Definition: TSATypeDef.h:1285
Contains the library's copyright notice as well as version information.
Definition: TSATypeDef.h:144
The average gross profit/loss per unit.
static const color honeydew_3
Definition: TSATypeDef.h:1185
The total number of bars on which the strategy had exposure (position not 'flat').
static const color light_gray
Definition: TSATypeDef.h:1215
static const color pale_goldenrod
Definition: TSATypeDef.h:1307
strategy_state_type
Values that represent strategy state ts.
Definition: TSATypeDef.h:84
The total number of transactions.
static const color pale_violet_red
Definition: TSATypeDef.h:1377
static const color lemon_chiffon
Definition: TSATypeDef.h:1171
The number of bars of all winning trades.
Represents a symbol/exchange combination.
Definition: TSATypeDef.h:638
static const std::string winners_net
The net profit generated by winning trades. (type: double)
Definition: TSATypeDef.h:330
static const std::string max_closed_out_runup
The highest cummulative gain of sequential winning trades. (type: double)
Definition: TSATypeDef.h:337
structure defining all the metric names. For example, you can pass metric::trade_count as metric_name...
Definition: TSATypeDef.h:297
static const std::string avg_net_profit_per_unit
The average net profit/loss per unit. (type: double)
Definition: TSATypeDef.h:349
static const std::string avg_gain_to_avg_loss_ratio
The ratio of the 'average winning trade' / 'average losing trade'. (type: double) ...
Definition: TSATypeDef.h:336
static const std::string avg_trade_commission
The average commission per trade. (type: double)
Definition: TSATypeDef.h:343
static const color violet_red
Definition: TSATypeDef.h:1383
static const color cornsilk_4
Definition: TSATypeDef.h:1161
static const std::string max_account_balance
Not in use.
Definition: TSATypeDef.h:363
static const color gainsboro
Definition: TSATypeDef.h:1115
static const std::string current_drawdown
The value of the current drawdown. (type: double)
Definition: TSATypeDef.h:357
static const color salmon
Definition: TSATypeDef.h:1351
static const std::string avg_pos_excursion
The average positive (advantageous) trade profit before trade was closed out. (type: double) ...
Definition: TSATypeDef.h:317
static const color blue_violet
Definition: TSATypeDef.h:1397
static const std::string avg_trade_bar_count
The average trade length in bars. (type: double)
Definition: TSATypeDef.h:324
static const std::string avg_trade_slippage
The average slippage per trade. (type: double)
Definition: TSATypeDef.h:344
static const color peach_puff_4
Definition: TSATypeDef.h:1149
Enables all logs.
Definition: TSATypeDef.h:431
static const std::string avg_net_trade_pl
The average net trade profit / loss (cash amount). (type: double)
Definition: TSATypeDef.h:305
The average net profit (cash amount) of winning trades.
const size_t max_size_limit
The maximum value for size_t.
Definition: TSATypeDef.h:81
Commission and slippage are booked per transaction.
Definition: TSATypeDef.h:419
The cursor is at the seek timestamp or on next lower timestamp if the seek timestamp was not found...
Definition: TSATypeDef.h:158
static const color rosy_brown
Definition: TSATypeDef.h:1323
static const color royal_blue
Definition: TSATypeDef.h:1233
The percent of trades profitable.
static const color medium_purple
Definition: TSATypeDef.h:1401
int64_t quantity_t
Definition: TSATypeDef.h:444
static const color maroon
Definition: TSATypeDef.h:1379
static const char * version
Version information such as 2.2.2 (major.minor.maintenance)
Definition: TSATypeDef.h:149
The length in bars of the average losing trade.
static const std::string stddev_trade_pl
The standard deviation of trade net-profit/loss. (type: double)
Definition: TSATypeDef.h:319
static const color bisque_4
Definition: TSATypeDef.h:1141
The seek timestamp is higher than the last record in the table.
Definition: TSATypeDef.h:162
static const color ivory_3
Definition: TSATypeDef.h:1167
static const std::string avg_trade_cost
The average cost (slippage + commission) per trade. (type: double)
Definition: TSATypeDef.h:345
static const color dark_turquoise
Definition: TSATypeDef.h:1255
The average 'maximum position size' of all trades.
The net loss generated by losing trades.
static const std::string total_slippage
The total 'slippage' booked for trades. Trades resulting from 'limit orders' have no slippage...
Definition: TSATypeDef.h:333
The number of units traded using 'limit orders'.
replace_flag_type
Replace / no-replace flag used by various objects.
Definition: TSATypeDef.h:105
static const color honeydew_2
Definition: TSATypeDef.h:1183
static const std::string max_closed_out_rundown
The highest cummulative loss of sequential losing trades. (type: double)
Definition: TSATypeDef.h:338
log_type_t
Log type enumeration. Multiple log types can be combined by using operator|.
Definition: TSATypeDef.h:424
static const color azure
Definition: TSATypeDef.h:1191
_value_types_type type_t
Defines type_t as an alias of enum _value_types_type.
Definition: TSATypeDef.h:189
Definition: TSATypeDef.h:112
The ratio of the 'average winning trade' / 'average losing trade'.
variant objects can represent values of different types.
Definition: TSAVariant.h:140
Trade Log.
Definition: TSATypeDef.h:426
static const std::string percent_units_without_slippage
The percent of units filled without 'slippage'; via 'limit-orders'. (type: double) ...
Definition: TSATypeDef.h:348
static const std::string sum_neg_excursion
The sum of all negative (adverse) trade profit before trade was closed out. (type: double) ...
Definition: TSATypeDef.h:314
static const color cyan
Definition: TSATypeDef.h:1261
cost_alloc_type
Transaction cost allocation enumeration.
Definition: TSATypeDef.h:418
static const color medium_spring_green
Definition: TSATypeDef.h:1291
static const color aquamarine
Definition: TSATypeDef.h:1269
_value_types_type
Data type enumeration used throughout the library. Intended to be used via type_t.
Definition: TSATypeDef.h:166
static const color gold
Definition: TSATypeDef.h:1315
Class tsa::exception used by most classes of the Trading System API library. The class inherits from ...
Definition: TSAError.h:37
static const std::string net_profit
The strategy 'net profit' (after slippage + commission). (type: double)
Definition: TSATypeDef.h:328
static const color turquoise
Definition: TSATypeDef.h:1259
static const color snow2
Definition: TSATypeDef.h:1105
static const color dark_violet
Definition: TSATypeDef.h:1395
static const color medium_aquamarine
Definition: TSATypeDef.h:1267
static const color pink
Definition: TSATypeDef.h:1373
static const std::string avg_trade_transaction_count
The average number of transactions per trade. (type: double)
Definition: TSATypeDef.h:341
static const color chocolate
Definition: TSATypeDef.h:1343
static const color lavender_blush
Definition: TSATypeDef.h:1197
static const color medium_blue
Definition: TSATypeDef.h:1231
static const std::string min_account_balance
Not in use.
Definition: TSATypeDef.h:364
static const color antique_white
Definition: TSATypeDef.h:1123
static const color light_goldenrod_yellow
Definition: TSATypeDef.h:1309
static const color dark_salmon
Definition: TSATypeDef.h:1349
The seek timestamp is earlier than the first record in the table.
Definition: TSATypeDef.h:160
Parent class for many library classes.
Definition: TSATypeDef.h:462
static const color snow3
Definition: TSATypeDef.h:1107
The value of the largest drawdown.
static const color medium_sea_green
Definition: TSATypeDef.h:1279
static const color antique_white_3
Definition: TSATypeDef.h:1127
static const std::string max_drawdown_length
The length in bars of the longest drawdown. (type: int64_t)
Definition: TSATypeDef.h:360
static const color slate_blue
Definition: TSATypeDef.h:1225
static const color blanched_almond
Definition: TSATypeDef.h:1133
The maximum number of transactions for any one trade.
static const color dark_orange
Definition: TSATypeDef.h:1357
static const color medium_violet_red
Definition: TSATypeDef.h:1381
static const color green
Definition: TSATypeDef.h:1101
static const color dark_slate_gray
Definition: TSATypeDef.h:1205
A date of the Gregorian calendar.
Definition: TSATime.h:119
static const std::string avg_neg_excursion
The average negative (adverse) trade profit before trade was closed out. (type: double) ...
Definition: TSATypeDef.h:318
static const std::string num_transactions
The total number of transactions. (type: int64_t)
Definition: TSATypeDef.h:378
static const color ivory_4
Definition: TSATypeDef.h:1169
The average drawdown length in bars.
static const color red
Definition: TSATypeDef.h:1367
static const std::string num_units_traded_without_slippage
The number of units traded without slippage. (Limit orders do not have slippage). (type: int64_t) ...
Definition: TSATypeDef.h:388
static const std::string max_trade_transaction_count
The maximum number of transactions for any one trade. (type: int64_t)
Definition: TSATypeDef.h:339
static const color black
Definition: TSATypeDef.h:1203
static const std::string max_consec_losers
The maximum number of consecutive losing trades. (type: int64_t)
Definition: TSATypeDef.h:312
sref< bool > operator==(numeric_series_cref a, numeric_series_cref b)
comparison.
Definition: TSADSLBase.cpp:130
flag if the last trade was open before the strategy evaluation/simulation was stopped.
static const std::string num_drawdowns__eod
The total number of drawdowns (end of day data). (type: int64_t)
Definition: TSATypeDef.h:373
The maximum number of consecutive winning trades.
The size of the largest losing trade (cash amount).
The total number of transactions resulting from 'stop orders'.
The highest cummulative loss of sequential losing trades.
static const color seashell_4
Definition: TSATypeDef.h:1179
The total number of trades.
static const color brown
Definition: TSATypeDef.h:1347
static const color firebrick
Definition: TSATypeDef.h:1345
The total number of units traded (not 'round trip').
The value of the average drawdown in the currency in which the securities are traded.
static const color purple
Definition: TSATypeDef.h:1399
static const std::string max_drawdown_length__eod
The length in bars of the longest drawdown (end of day data). (type: int64_t)
Definition: TSATypeDef.h:370
static const std::string max_drawdown
The value of the largest drawdown. (type: double)
Definition: TSATypeDef.h:359
static const color light_salmon
Definition: TSATypeDef.h:1353
The average trade length in bars.
The number of units traded without slippage. (Limit orders do not have slippage). ...
static const color pale_green
Definition: TSATypeDef.h:1283
static const color ghost_white
Definition: TSATypeDef.h:1111
static const color plum
Definition: TSATypeDef.h:1387
static const color misty_rose
Definition: TSATypeDef.h:1199
static const std::string loser_count
The total number of losing trades. (type: int64_t)
Definition: TSATypeDef.h:302
static const color peach_puff_2
Definition: TSATypeDef.h:1145
The average slippage per trade.
static const color tan
Definition: TSATypeDef.h:1341
The highest cummulative gain of sequential winning trades.
Short trades only.
Definition: TSATypeDef.h:210
static const color medium_slate_blue
Definition: TSATypeDef.h:1227
static const std::string profit_factor
The ratio of 'total winners net' / 'total losers net'. (type: double)
Definition: TSATypeDef.h:335
Transaction Log.
Definition: TSATypeDef.h:427
virtual ~object(void)
Destructor.
Definition: TSATypeDef.h:473
The average net profit (cash amount) of losing trades.
The number of units traded using 'stop orders'.
static const color snow
Definition: TSATypeDef.h:1103
static const color light_coral
Definition: TSATypeDef.h:1361
trade_grouping
Trade aggregation types used by reporting functionality.
Definition: TSATypeDef.h:208
The net profit generated by winning trades.
The total number of drawdowns.
The total 'slippage' booked for trades. Trades resulting from 'limit orders' have no slippage...
static const std::string trade_count
The total number of trades. (type: int64_t)
Definition: TSATypeDef.h:301
x
Definition: TSCColor.h:23
Definition: TSATypeDef.h:107
static const color thistle
Definition: TSATypeDef.h:1403
static const color medium_turquoise
Definition: TSATypeDef.h:1257
static const std::string max_pos_excursion
The largest positive (advantageous) trade profit before trade was closed out. (type: double) ...
Definition: TSATypeDef.h:315
The strategy 'net profit' (after slippage + commission).
static const color coral
Definition: TSATypeDef.h:1359
static const color violet
Definition: TSATypeDef.h:1385
static const color dim_gray
Definition: TSATypeDef.h:1207
static const color orange_red
Definition: TSATypeDef.h:1365
static const color yellow_green
Definition: TSATypeDef.h:1297
Definition: TSATypeDef.h:113
All trades.
Definition: TSATypeDef.h:211
static const color light_slate_gray
Definition: TSATypeDef.h:1211
static const color light_steel_blue
Definition: TSATypeDef.h:1247
static const color dark_sea_green
Definition: TSATypeDef.h:1275
Long trades only.
Definition: TSATypeDef.h:209
static const color forest_green
Definition: TSATypeDef.h:1299
The average positive (advantageous) trade profit before trade was closed out.
static const std::string losers_net
The net loss generated by losing trades. (type: double)
Definition: TSATypeDef.h:331
static const color honeydew_4
Definition: TSATypeDef.h:1187
static const std::string num_transactions_at_limit
The total number of transactions resulting from 'limit orders'. (type: int64_t)
Definition: TSATypeDef.h:381
static const color light_slate_blue
Definition: TSATypeDef.h:1229
Represents a color for use in graphics operations.
Definition: TSATypeDef.h:1041
static const color sky_blue
Definition: TSATypeDef.h:1241
static const std::string max_winner
The size of the largest winning trade (cash amount). (type: double)
Definition: TSATypeDef.h:310
static const color antique_white_4
Definition: TSATypeDef.h:1129
static const color sea_green
Definition: TSATypeDef.h:1277
The total number of transactions resulting from 'limit orders'.
static const color navajo_white
Definition: TSATypeDef.h:1151
static const color cadet_blue
Definition: TSATypeDef.h:1265
static const color dark_khaki
Definition: TSATypeDef.h:1303
static const std::string total_winner_bar_count
The number of bars of all winning trades. (type: int64_t)
Definition: TSATypeDef.h:321
static const color peach_puff
Definition: TSATypeDef.h:1143
static const std::string avg_gross_profit_per_unit
The average gross profit/loss per unit. (type: double)
Definition: TSATypeDef.h:350
int R(void) const
Red component.
Definition: TSATypeDef.h:1052
static const color pale_turquoise
Definition: TSATypeDef.h:1253
static const std::string num_drawdowns
The total number of drawdowns. (type: int64_t)
Definition: TSATypeDef.h:358
static const color light_blue
Definition: TSATypeDef.h:1249
The total 'commission' booked for trades.
static const color sienna
Definition: TSATypeDef.h:1329
static const color yellow
Definition: TSATypeDef.h:1313
static const color dark_green
Definition: TSATypeDef.h:1271
static const std::string max_consec_winners
The maximum number of consecutive winning trades. (type: int64_t)
Definition: TSATypeDef.h:311
static const color dark_slate_blue
Definition: TSATypeDef.h:1223
static const std::string max_drawdown__eod
The value of the largest drawdown (end of day data). (type: double)
Definition: TSATypeDef.h:369
static const color lawn_green
Definition: TSATypeDef.h:1287
static const color snow4
Definition: TSATypeDef.h:1109
static const color orchid
Definition: TSATypeDef.h:1389
static const color blue
Definition: TSATypeDef.h:1235
static const color seashell_2
Definition: TSATypeDef.h:1175
static const std::string avg_winner_bar_count
The length in bars of the average winning trade. (type: double)
Definition: TSATypeDef.h:320
The length in bars of the longest drawdown.
static const std::string num_transactions_at_market
The total number of transactions resulting from 'market orders'. (type: int64_t)
Definition: TSATypeDef.h:379
static const std::string avg_cost_per_unit
The average 'per unit' transaction cost (slippage + commission). (type: double)
Definition: TSATypeDef.h:347
static const color light_sky_blue
Definition: TSATypeDef.h:1243
static const color orange
Definition: TSATypeDef.h:1355
int64_t identifier_t
type for ID's
Definition: TSATypeDef.h:117
static const color indian_red
Definition: TSATypeDef.h:1325
int G(void) const
Green component.
Definition: TSATypeDef.h:1055
static const color dark_olive_green
Definition: TSATypeDef.h:1273
static const color midnight_blue
Definition: TSATypeDef.h:1217
The total number of transactions resulting from 'market orders'.
The average number of transactions per trade.
static const color slate_gray
Definition: TSATypeDef.h:1209
static const color navy
Definition: TSATypeDef.h:1219
The length in bars of the average winning trade.
static const color cornsilk
Definition: TSATypeDef.h:1155
static const color lime_green
Definition: TSATypeDef.h:1295
static const color ivory
Definition: TSATypeDef.h:1163
use_default_t
Definition: TSATypeDef.h:1061
static const color tomato
Definition: TSATypeDef.h:1363
static const color burlywood
Definition: TSATypeDef.h:1333
int B(void) const
Blue component.
Definition: TSATypeDef.h:1058
static const std::string num_bars_in_trade
The total number of bars on which the strategy had exposure (position not 'flat'). (type: int64_t)
Definition: TSATypeDef.h:325
The percentage of bars during which the strategy had exposure (position not 'flat').
static const std::string avg_gross_trade_pl
The average gross trade profit / loss (cash amount). (type: double)
Definition: TSATypeDef.h:306
static const color lavender
Definition: TSATypeDef.h:1195
static const color old_lace
Definition: TSATypeDef.h:1119
The average commission per trade.
static const color goldenrod
Definition: TSATypeDef.h:1319
static const color peru
Definition: TSATypeDef.h:1331
The largest positive (advantageous) trade profit before trade was closed out.
static const std::string avg_loser
The average net profit (cash amount) of losing trades. (type: double)
Definition: TSATypeDef.h:308
static const color gray
Definition: TSATypeDef.h:1213
The largest negative (adverse) trade profit before trade was closed out.
static const color light_yellow
Definition: TSATypeDef.h:1311
int64_t position_t
Definition: TSATypeDef.h:447
The total number of bars processed by the strategy.
static const std::string avg_drawdown_length
The average drawdown length in bars. (type: double)
Definition: TSATypeDef.h:361
The total number of losing trades.
The average net profit/loss per unit.
static const color wheat
Definition: TSATypeDef.h:1337
static const color honeydew
Definition: TSATypeDef.h:1181
static const color cornflower_blue
Definition: TSATypeDef.h:1221
The maximum position size of any one trade.
static const color bisque_3
Definition: TSATypeDef.h:1139
static const std::string avg_drawdown_length__eod
The average drawdown length in bars (end of day data). (type: double)
Definition: TSATypeDef.h:371
The number of units traded using 'market orders'.
The total 'transaction cost' for all trades.
static const color linen
Definition: TSATypeDef.h:1121
static const std::string num_transactions_on_stop
The total number of transactions resulting from 'stop orders'. (type: int64_t)
Definition: TSATypeDef.h:380
static const std::string last_trade_is_open
flag if the last trade was open before the strategy evaluation/simulation was stopped. (type: bool)
Definition: TSATypeDef.h:351
static const std::string num_units_traded_on_stop
The number of units traded using 'stop orders'. (type: int64_t)
Definition: TSATypeDef.h:390
open_db_flag_type operator|(open_db_flag_type a, open_db_flag_type b)
Allows multiple fast::database constructor flags to be combined.
Definition: TSADatabase.cpp:40