Commit Graph
11157 Commits
Author SHA1 Message Date
John Colvin cf615efcd0 refactor: Move LegDef into its own file
The struct is renamed 'LegDefinition' to use a naming scheme consistent
with 'SecurityDefinition.'  However, an alias for 'LegDef' is
declared for convenience, and to avoid replacing 'LegDef' with
'LegDefinition' in existing references.
2021-02-01 23:44:21 -06:00
John Colvin c57b832305 fix: Only flip implied_candidates_dirty when they've actually changed 2021-02-01 23:44:21 -06:00
John Colvin e5c3ae1f9f Add permutation 'of length' method, and permutation unit tests 2021-02-01 23:44:21 -06:00
John Colvin e9232e3bae Add math utils 'factorial' and 'choose' 2021-02-01 23:44:21 -06:00
John Colvin f4bb9544d4 fix: Fill same-priced passive icebergs evenly
When an agressor order crosses multiple [direct/implied] passive markets
at the same price, the aggressor is filled against the visible quantity
in each passive market, before passive icebergs (if any) are reloaded.
This simple iterative step is repeated until the aggressor is filled, or
no longer crosses the market.
2021-02-01 23:44:21 -06:00
John Colvin 28aaf22ea8 refactor: Change Matcher structs to be classes instead 2021-02-01 23:44:20 -06:00
John Colvin de49920af7 fix: Don't change show qty when order is filled (matcher) 2021-02-01 23:44:20 -06:00
John Colvin e05c01fc77 Clean up set_total_qty method
* remove unused vars

* replace if/else with ternary operator
2021-02-01 23:44:20 -06:00
John Colvin 9f6dc5da11 Pipe event id through the matcher for better tracing 2021-02-01 23:44:20 -06:00
John Colvin 84c9eb87e6 refactor: Replace size_ts with EventID alias 2021-02-01 23:44:20 -06:00
John Colvin 9f290b550b Pass effects vector to FifoSecurityMatcher calls 2021-02-01 23:44:20 -06:00
John Colvin 6e4950ec1c clang-format: PenaltyReturnTypeOnItsOwnLine
Discourage clang from putting the return type on its own line.
2021-02-01 23:44:20 -06:00
John Colvin c727389f53 refactor: Replace map with unordered_map in Matcher 2021-02-01 23:44:20 -06:00
John Colvin 20e8ac2910 fix: FifoMergedSecurityMatcher handling of icebergs
The iceberg quantity is expected to be null in all updates (i.e., only
non-null when the order is added).  Once added, the iceberg quantity is
redundant, as show qty changes are interpretted through visible qty
changes (the qty actually visible in the book), and the total qty is
immutable.

This patch fixes a bug where the iceberg quantity was not being assigned
back to an updated order before it was passed to the 'fill' method,
which in turn, misled the matcher to think the order was completed when
its visible qty alone was filled.
2021-02-01 23:44:20 -06:00
John Colvin 7e59145102 add TestObserver (IAlgoModel)
This is an empty implementation of IAlgoModel, so new algo ideas may be
tested without the overhead of creating new classes/files.
2021-02-01 23:44:20 -06:00
John Colvin 5e01a37b6e feat (cli): Add cmd to record matcher event proc times 2021-02-01 23:44:20 -06:00
John Colvin 95d2363435 feat (cli): Add cmd to record matcher fills
This works in a similar fasion to the cmd that records matcher books.
Both generate a csv file designed to be imported into a sqlite database,
so the matcher's output may be joined/compared with actual data from the
exchange.
2021-02-01 23:44:20 -06:00
John Colvin 82332bf92f refactor: Replace SimBooks cmd with Matcher->BooksCmd
This is in anticipation of adding a similar subcommand to record fills,
and proc times.  Basic functionality expected to be shared by these
three commands is abstracted out of the former SimBooks command into
common classes.
2021-02-01 23:44:20 -06:00
John Colvin 042c451bd6 refactor: Move classes from sim_common.h into their own files
* Move MatchEffect into 'back_testing/common/MatchEffect.h'
* Move MBPUpdate into 'back_testing/common/MBPUpdate.h/cc'
* Move OrderUpdate into 'back_testing/common/OrderUpdate.h/cc'
2021-02-01 23:44:20 -06:00
John Colvin 3e66c3e5db refactor: Move Fill into domain/fill 2021-02-01 23:44:20 -06:00
John Colvin a6f3852846 refactor: Improve Stopwatch impl 2021-02-01 23:41:23 -06:00
John Colvin 1f622b0c1e Optimize logging in IcebergFileCache
* Replace std::cout call with 'Info' log

* Use const char * templates to reduce string copying
2021-02-01 23:41:23 -06:00
John Colvin 48aaf9de6c refactor: Move iceberg_file_cache to matcher/common/IcebergFileCache
Also change static 'iceberg_file_cache' namespace methods to static
'IcebergFileCache' class methods
2021-02-01 23:41:23 -06:00
John Colvin 8b5e86c1ba refactor: Make Iceberg related structs classes instead
* IcebergInput

* IcebergInputBuilder

* IcebergFinder
2021-02-01 23:41:23 -06:00
John Colvin 2a975c95b2 Account for nan in Price::to_double 2021-02-01 23:41:23 -06:00
John Colvin b89555a2e2 Account for nan in price comparison methods 2021-02-01 23:41:23 -06:00
John Colvin 166ab7d299 refactor: Make ValueWrapper binary ops constexpr 2021-02-01 23:41:23 -06:00
John Colvin d2bf8f1b53 Add security_groups field to SecurityCriteria 2021-02-01 23:41:23 -06:00
John Colvin e363840937 refactor: Rename SecurityCriteriaClause -> SecurityCriteria::Clause 2021-02-01 23:41:23 -06:00
John Colvin d8fb275b20 fix: PCapOrderChangeBootstrapper
Bootstrap observers with resting orders on the first event in which the
security's status transitions to 'ReadyToTrade.' This simplifies the
previous implementation, which did not bootstrap observers until the
security's second consecutive event with 'ReadyToTrade' status.
2021-02-01 23:41:23 -06:00
John Colvin 13719170c9 refactor: Move OrderKey.h into domain/order 2021-02-01 23:41:23 -06:00
John Colvin 2c4db5bf02 refactor: Move Order types into domain/order 2021-02-01 23:41:23 -06:00
John Colvin 7e957527ac Add Price::nan method 2021-02-01 23:07:01 -06:00
John Colvin b94a1d943f refactor: Clean up Price
* Move impl from Price.h to Price.cc

* Make ctrs, methods, ops constexpr (where possible)

* Overload all binary ops to accept Price, or int64 param
2021-02-01 23:07:01 -06:00
John Colvin 3efb4da14b diag: Add Trace parameter to matcher constructor
This makes it easy for matcher-validation commands to bind trace
parameters, such as order/event ids, to cli options.
2021-02-01 22:56:21 -06:00
John Colvin 9c53f4b949 refactor: Move Trace into its own file 2021-02-01 22:56:21 -06:00
John Colvin 35d395fc35 refactor: Hide private matcher members behind PImpl 2021-02-01 22:56:21 -06:00
John Colvin cf19a63aac Delete superfluous move constructor/operator in Matcher 2021-02-01 22:56:21 -06:00
John Colvin 6456060a6c refactor: Define AlgoEventID struct, and EventID alias
A few advantages the struct offers (over an alias for a pair of size_ts):

* A custom output operator

* Eliminates potential conflict with pairs of size_ts that don't
  represent an algo id

* The ability to (eventually) choose precise member names for both
  components of the event, rather than 'first' and 'second'
2021-02-01 22:56:21 -06:00
John Colvin 702547a88b refactor: Revamp 'md' command with CLI11 App
The files 'run_md.h/cpp' are removed, as their functionality is
distributed among the subcommands: md, run, and web.
2021-02-01 22:56:21 -06:00
John Colvin 2447da3c08 refactor: Rename 'map_utils.h' -> 'MapUtils.h/cc'
Also refactor the relevant namespace 'bts::utils' methods to be static
methods in the newly created class 'MapUtils.'  This is part of the
effort to favor static class methods over namespaced functions.
2021-02-01 22:56:21 -06:00
John Colvin 8df420c37c refactor: Rename 'table_display.h' -> 'TableDisplay.h/cc'
Also refactor the namespace 'table_display' methods to be static methods
in the newly created class 'TableDisplay.'  This is part of the effort
to favor static class methods over namespaced functions.
2021-02-01 22:56:21 -06:00
John Colvin d18a345b5b refactor: Rename 'permutation.h' -> 'Permutation.h/cc'
Also refactor the namespace 'all_permutations' methods to be static
methods in the newly created class 'Permutation.'  This is part of
the effort to favor static class methods over namespaced functions.
2021-02-01 22:56:21 -06:00
John Colvin 1770274dd0 refactor: Rename 'action_summarizer' -> 'ActionSummarizer' 2021-02-01 22:56:21 -06:00
John Colvin 746dd506f8 refactor: Rename 'file_stream_utils.h' -> 'FileUtils.h/cc'
Also refactor the namespace 'file_stream_utils' methods to be static
methods in the newly created class 'FileUtils'.  This is part of
the effort to favor static class methods over namespaced functions.
2021-02-01 22:56:21 -06:00
John Colvin 78be0004af refactor: Rename 'reverse_comp.h' -> 'ReverseComp.h' 2021-02-01 22:56:21 -06:00
John Colvin 333a378230 refactor: Rename 'string_splitter.h' -> 'StringUtils.h/cpp'
Also refactor the namespace 'string_splitter' methods to be static
methods in the newly created class 'StringUtils'.  This is part of
the effort to favor static class methods over namespaced functions.
2021-02-01 22:56:21 -06:00
John Colvin 5e8f776334 refactor: Rename dir 'spartan/util' -> 'spartan/utils' 2021-02-01 22:56:21 -06:00
Pedro Pinto 5470a82b94 Real time ilink3 handler code complete. 2021-02-01 20:28:44 -05:00
Pedro Pinto 7959c96bcd Merge branch 'spartan_tas' of bitbucket.org:bluetradesys/spark into spartan_tas 2021-02-01 13:57:37 -05:00