Merge branch 'spartan_tas' of bitbucket.org:bluetradesys/spark into spartan_tas
This commit is contained in:
commit
f585f54016
426 files changed
+1413
-1309
No files matched your search
@@ -92,7 +92,10 @@ else ()
|
||||
endif()
|
||||
|
||||
#include paths
|
||||
target_include_directories( libspark PUBLIC ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src)
|
||||
target_include_directories( libspark PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/server/sparkd/cmds/spartan
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_BINARY_DIR}/src)
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries( libspark
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "lib/domain_model/Security.h"
|
||||
#include "lib/md/IntPrice.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/common/mdp3_common.h"
|
||||
#include "server/sparkd/cmds/spartan/feed_handler/common/mdp3_common.h"
|
||||
|
||||
namespace bts {
|
||||
namespace orderman {
|
||||
|
||||
@@ -48,15 +48,6 @@ long unix_now() {
|
||||
.total_microseconds() /
|
||||
(long)1E6;
|
||||
}
|
||||
#ifndef _WIN32
|
||||
uint64_t unix_nano_now() {
|
||||
struct timespec ts;
|
||||
// CLOCK_REALTIME is already anchored at the unix epoch
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
return static_cast<int64_t>(1000000000UL) * static_cast<int64_t>(ts.tv_sec) +
|
||||
static_cast<int64_t>(ts.tv_nsec);
|
||||
}
|
||||
#endif
|
||||
|
||||
std::chrono::system_clock::time_point
|
||||
utc_ll_to_timepoint(unsigned long long ll) {
|
||||
|
||||
@@ -63,7 +63,16 @@ extern "C" BTS_EXPORT LLDateTime ll_local_now();
|
||||
extern "C" BTS_EXPORT double OA_date_from_ll(LLDateTime ll);
|
||||
extern "C" BTS_EXPORT LLDateTime ll_from_OA_date(double oa_date);
|
||||
extern "C" BTS_EXPORT long unix_now();
|
||||
uint64_t unix_nano_now();
|
||||
|
||||
#ifndef _WIN32
|
||||
inline uint64_t unix_nano_now() {
|
||||
struct timespec ts;
|
||||
// CLOCK_REALTIME is already anchored at the unix epoch
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
return static_cast<int64_t>(1000000000UL) * static_cast<int64_t>(ts.tv_sec) +
|
||||
static_cast<int64_t>(ts.tv_nsec);
|
||||
}
|
||||
#endif
|
||||
|
||||
BTS_EXPORT std::chrono::system_clock::time_point
|
||||
utc_ll_to_timepoint(unsigned long long ll);
|
||||
|
||||
@@ -1 +1 @@
|
||||
set(sources algo/AlgoDefinitionServiceServer.cpp;cmds/AdminReport.cpp;cmds/AutoCert.cpp;cmds/Benchmark.cpp;cmds/CMECert.cpp;cmds/ConfigCheck.cpp;cmds/FIXSim.cpp;cmds/KeyCode.cpp;cmds/Md.cpp;cmds/ParseHistoricalFIX.cpp;cmds/PrintHedgeOrders.cpp;cmds/QuickTest.cpp;cmds/Run.cpp;cmds/Span.cpp;cmds/Spartan.cpp;cmds/Web.cpp;cmds/md/cmds/Channels.cpp;cmds/md/cmds/Cleanup.cpp;cmds/md/cmds/Dump.cpp;cmds/md/cmds/DumpSecurity.cpp;cmds/md/cmds/RecTool.cpp;cmds/md/cmds/Record.cpp;cmds/md/cmds/Relay.cpp;cmds/md/cmds/Replay.cpp;cmds/md/cmds/Run.cpp;cmds/md/cmds/Tail.cpp;cmds/md/cmds/rec_tool/cmds/Print.cpp;cmds/md/cmds/rec_tool/cmds/Trace.cpp;cmds/md/cmds/rec_tool/cmds/Unprint.cpp;cmds/md/common/PlatformOption.cpp;cmds/md/common/SecurityTypeOption.cpp;cmds/md/common/VenueOption.cpp;cmds/spartan/algoman/IAlgo.cpp;cmds/spartan/algoman/IAlgoExecutionServices.cpp;cmds/spartan/algoman/IAlgoSetupServices.cpp;cmds/spartan/algoman/algos/tas/RunTAS.cpp;cmds/spartan/algoman/algos/tas/TASOrderReactor.cpp;cmds/spartan/algoman/algos/tas/TASTriggerDef.cpp;cmds/spartan/back_testing/algos/PolyObserver.cpp;cmds/spartan/back_testing/algos/SniperModel.cpp;cmds/spartan/back_testing/algos/TestObserver.cpp;cmds/spartan/back_testing/algos/spreader/SimOrderGateway.cpp;cmds/spartan/back_testing/algos/spreader/SimSpreader.cpp;cmds/spartan/back_testing/algos/spreader/tests/sim_spreader_tests.cpp;cmds/spartan/back_testing/common/Trace.cpp;cmds/spartan/back_testing/db/SimDB.cpp;cmds/spartan/back_testing/matcher/FifoImpliedSecurityMatcher.cpp;cmds/spartan/back_testing/matcher/FifoMatcherContext.cpp;cmds/spartan/back_testing/matcher/FifoMergedSecurityMatcher.cpp;cmds/spartan/back_testing/matcher/FifoPriceLevelMatcher.cpp;cmds/spartan/back_testing/matcher/FifoSecurityMatcher.cpp;cmds/spartan/back_testing/matcher/FillDepot.cpp;cmds/spartan/back_testing/matcher/Matcher.cpp;cmds/spartan/back_testing/matcher/MatchingCommon.cpp;cmds/spartan/back_testing/matcher/common/IcebergFileCache.cpp;cmds/spartan/back_testing/matcher/common/MatcherOneof.cpp;cmds/spartan/back_testing/matcher/common/MatcherOrder.cpp;cmds/spartan/back_testing/matcher/common/MatchingSession.cpp;cmds/spartan/back_testing/matcher/iceberg_helper.cpp;cmds/spartan/back_testing/matcher/tests/matcher_tests.cpp;cmds/spartan/back_testing/matcher/validation/matcher_validation_observer.cpp;cmds/spartan/back_testing/run/SimSessionOptions.proto;cmds/spartan/back_testing/run/run_sim.cpp;cmds/spartan/back_testing/sim/ISim.cpp;cmds/spartan/back_testing/sim/Sim.cpp;cmds/spartan/back_testing/sim/pandl/PandL.cpp;cmds/spartan/back_testing/sim/pcap/PCapEventGenerator.cpp;cmds/spartan/back_testing/sim/pcap/PCapEventSource.cpp;cmds/spartan/back_testing/sim/pcap/PCapOrderChangeBootstrapper.cpp;cmds/spartan/back_testing/sim/spark_bridge/AlgoServicesBridge.cpp;cmds/spartan/back_testing/sim/spark_bridge/BeforeLaunchBridge.cpp;cmds/spartan/cmds/BookStats.cpp;cmds/spartan/cmds/CSV.cpp;cmds/spartan/cmds/Compress.cpp;cmds/spartan/cmds/FindPolys.cpp;cmds/spartan/cmds/Icebergs.cpp;cmds/spartan/cmds/Json.cpp;cmds/spartan/cmds/ListSec.cpp;cmds/spartan/cmds/MatcherCmd.cpp;cmds/spartan/cmds/PolygonBooks.cpp;cmds/spartan/cmds/SQL.cpp;cmds/spartan/cmds/Sim.cpp;cmds/spartan/cmds/Stats.cpp;cmds/spartan/cmds/Test.cpp;cmds/spartan/cmds/ValidateFifo.cpp;cmds/spartan/cmds/ValuePolys.cpp;cmds/spartan/cmds/matcher/cmds/BooksCmd.cpp;cmds/spartan/cmds/matcher/cmds/FillsCmd.cpp;cmds/spartan/cmds/matcher/cmds/ProcTimeCmd.cpp;cmds/spartan/cmds/matcher/common/InitData.cpp;cmds/spartan/common/EndPoint.cpp;cmds/spartan/common/Stopwatch.cpp;cmds/spartan/common/TimeInterval.cpp;cmds/spartan/common/TimeStamp.cpp;cmds/spartan/common/cli/RangeArg.cpp;cmds/spartan/domain/IcebergQuantity.cpp;cmds/spartan/domain/Price.cpp;cmds/spartan/domain/Quantity.cpp;cmds/spartan/domain/SecurityCriteria.cpp;cmds/spartan/domain/SecurityDefinition.cpp;cmds/spartan/domain/SecurityID.cpp;cmds/spartan/domain/SecuritySnapshot.cpp;cmds/spartan/domain/SideQuantity.cpp;cmds/spartan/domain/TradeSummarySignal.cpp;cmds/spartan/domain/book/BookLevel.cpp;cmds/spartan/domain/order/OrderChange.cpp;cmds/spartan/domain/order/OrderKey.cpp;cmds/spartan/execution/Cancel.cpp;cmds/spartan/execution/CancelReplace.cpp;cmds/spartan/execution/GatewayError.cpp;cmds/spartan/execution/NewOrder.cpp;cmds/spartan/execution/OrderUpdate.cpp;cmds/spartan/execution/il3/IL3Gateway.cpp;cmds/spartan/execution/il3/common/IL3MsgFramer.cpp;cmds/spartan/execution/il3/handlers/init/IL3InitHandler.cpp;cmds/spartan/execution/il3/handlers/party_details/IL3PartyDetailsHandler.cpp;cmds/spartan/execution/il3/handlers/realtime/IL3RealTimeHandler.cpp;cmds/spartan/execution/il3/parsing/IL3Parser.cpp;cmds/spartan/execution/il3/store/IL3SessionFileStore.cpp;cmds/spartan/execution/il3/tests/order_execution_tests.cpp;cmds/spartan/market_data/common/EventRangeMonitor.cpp;cmds/spartan/market_data/common/IcebergQuantityModification.cpp;cmds/spartan/market_data/common/MDP3Event.cpp;cmds/spartan/market_data/common/OrderModifiLine truncated
|
||||
set(sources algo/AlgoDefinitionServiceServer.cpp;cmds/AdminReport.cpp;cmds/AutoCert.cpp;cmds/Benchmark.cpp;cmds/CMECert.cpp;cmds/ConfigCheck.cpp;cmds/FIXSim.cpp;cmds/KeyCode.cpp;cmds/Md.cpp;cmds/ParseHistoricalFIX.cpp;cmds/PrintHedgeOrders.cpp;cmds/QuickTest.cpp;cmds/Run.cpp;cmds/Span.cpp;cmds/Spartan.cpp;cmds/Web.cpp;cmds/md/cmds/Channels.cpp;cmds/md/cmds/Cleanup.cpp;cmds/md/cmds/Dump.cpp;cmds/md/cmds/DumpSecurity.cpp;cmds/md/cmds/RecTool.cpp;cmds/md/cmds/Record.cpp;cmds/md/cmds/Relay.cpp;cmds/md/cmds/Replay.cpp;cmds/md/cmds/Run.cpp;cmds/md/cmds/Tail.cpp;cmds/md/cmds/rec_tool/cmds/Print.cpp;cmds/md/cmds/rec_tool/cmds/Trace.cpp;cmds/md/cmds/rec_tool/cmds/Unprint.cpp;cmds/md/common/PlatformOption.cpp;cmds/md/common/SecurityTypeOption.cpp;cmds/md/common/VenueOption.cpp;cmds/spartan/back_testing/algos/PolyObserver.cpp;cmds/spartan/back_testing/algos/SniperModel.cpp;cmds/spartan/back_testing/algos/TestObserver.cpp;cmds/spartan/back_testing/algos/spreader/SimOrderGateway.cpp;cmds/spartan/back_testing/algos/spreader/SimSpreader.cpp;cmds/spartan/back_testing/algos/spreader/tests/sim_spreader_tests.cpp;cmds/spartan/back_testing/common/Trace.cpp;cmds/spartan/back_testing/db/SimDB.cpp;cmds/spartan/back_testing/matcher/FifoImpliedSecurityMatcher.cpp;cmds/spartan/back_testing/matcher/FifoMatcherContext.cpp;cmds/spartan/back_testing/matcher/FifoMergedSecurityMatcher.cpp;cmds/spartan/back_testing/matcher/FifoPriceLevelMatcher.cpp;cmds/spartan/back_testing/matcher/FifoSecurityMatcher.cpp;cmds/spartan/back_testing/matcher/FillDepot.cpp;cmds/spartan/back_testing/matcher/Matcher.cpp;cmds/spartan/back_testing/matcher/MatchingCommon.cpp;cmds/spartan/back_testing/matcher/common/IcebergFileCache.cpp;cmds/spartan/back_testing/matcher/common/MatcherOneof.cpp;cmds/spartan/back_testing/matcher/common/MatcherOrder.cpp;cmds/spartan/back_testing/matcher/common/MatchingSession.cpp;cmds/spartan/back_testing/matcher/iceberg_helper.cpp;cmds/spartan/back_testing/matcher/tests/matcher_tests.cpp;cmds/spartan/back_testing/matcher/validation/matcher_validation_observer.cpp;cmds/spartan/back_testing/run/SimSessionOptions.proto;cmds/spartan/back_testing/run/run_sim.cpp;cmds/spartan/back_testing/sim/ISim.cpp;cmds/spartan/back_testing/sim/Sim.cpp;cmds/spartan/back_testing/sim/pandl/PandL.cpp;cmds/spartan/back_testing/sim/pcap/PCapEventGenerator.cpp;cmds/spartan/back_testing/sim/pcap/PCapEventSource.cpp;cmds/spartan/back_testing/sim/pcap/PCapOrderChangeBootstrapper.cpp;cmds/spartan/back_testing/sim/spark_bridge/AlgoServicesBridge.cpp;cmds/spartan/back_testing/sim/spark_bridge/BeforeLaunchBridge.cpp;cmds/spartan/cmds/BookStats.cpp;cmds/spartan/cmds/CSV.cpp;cmds/spartan/cmds/Compress.cpp;cmds/spartan/cmds/FindPolys.cpp;cmds/spartan/cmds/Icebergs.cpp;cmds/spartan/cmds/Json.cpp;cmds/spartan/cmds/ListSec.cpp;cmds/spartan/cmds/MatcherCmd.cpp;cmds/spartan/cmds/PolygonBooks.cpp;cmds/spartan/cmds/SQL.cpp;cmds/spartan/cmds/Sim.cpp;cmds/spartan/cmds/Stats.cpp;cmds/spartan/cmds/Test.cpp;cmds/spartan/cmds/ValidateFifo.cpp;cmds/spartan/cmds/ValuePolys.cpp;cmds/spartan/cmds/matcher/cmds/BooksCmd.cpp;cmds/spartan/cmds/matcher/cmds/FillsCmd.cpp;cmds/spartan/cmds/matcher/cmds/ProcTimeCmd.cpp;cmds/spartan/cmds/matcher/common/InitData.cpp;cmds/spartan/common/EndPoint.cpp;cmds/spartan/common/Stopwatch.cpp;cmds/spartan/common/TimeInterval.cpp;cmds/spartan/common/TimeStamp.cpp;cmds/spartan/common/cli/RangeArg.cpp;cmds/spartan/domain/IcebergQuantity.cpp;cmds/spartan/domain/Price.cpp;cmds/spartan/domain/Quantity.cpp;cmds/spartan/domain/SecurityCriteria.cpp;cmds/spartan/domain/SecurityDefinition.cpp;cmds/spartan/domain/SecurityID.cpp;cmds/spartan/domain/SecuritySnapshot.cpp;cmds/spartan/domain/SideQuantity.cpp;cmds/spartan/domain/TradeSummarySignal.cpp;cmds/spartan/domain/book/BookLevel.cpp;cmds/spartan/domain/order/OrderChange.cpp;cmds/spartan/domain/order/OrderKey.cpp;cmds/spartan/domain/polygons/PolygonFinder.cpp;cmds/spartan/domain/polygons/PolygonOpportunityFinder.cpp;cmds/spartan/domain/polygons/polygon_utils.cpp;cmds/spartan/domain/polygons/tests/test_polygon_finder.cpp;cmds/spartan/engine/AlgoManager.cpp;cmds/spartan/engine/IAlgo.cpp;cmds/spartan/engine/IAlgoExecutionServices.cpp;cmds/spartan/engine/IAlgoSetupServices.cpp;cmds/spartan/engine/algos/tas/RunTAS.cpp;cmds/spartan/engine/algos/tas/TASOrderReactor.cpp;cmds/spartan/engine/algos/tas/TASTriggerDef.cpp;cmds/spartan/feed_handler/FeedHandler.cpp;cmds/spartan/feed_handler/FeedHandlerBinder.cpp;cmds/spartan/feed_handler/common/EventRangeMonitor.cpp;cmds/spartan/feed_handler/common/IcebergQuantityModification.cpp;cmds/spartan/feed_handler/common/MDP3Event.cpp;cmds/spartan/feed_handler/common/OrderModification.cpp;cmds/spartan/feed_handler/common/mdp3_common.cpp;cmds/spartan/feed_handler/detail/BookSnapshot.cpp;cmds/spartan/feed_handler/detail/DefinitionSnapshot.cpp;cmds/spartan/feed_handler/detail/IFeedController.cpp;cmds/spartan/feed_handler/detail/IncrementalQueue.cpp;cmds/spartan/feed_handler/detail/RealTimeMDHaLine truncated
|
||||
@@ -725,6 +725,7 @@ void tbb_concurrent_vector_insert(::benchmark::State &state) {
|
||||
}
|
||||
}
|
||||
BENCHMARK(tbb_concurrent_vector_insert);
|
||||
|
||||
void tbb_concurrent_vector_iterate(::benchmark::State &state) {
|
||||
tbb::concurrent_vector<Chunk> vec;
|
||||
for (size_t x = 0; x < 9999; ++x) {
|
||||
@@ -737,6 +738,7 @@ void tbb_concurrent_vector_iterate(::benchmark::State &state) {
|
||||
}
|
||||
}
|
||||
BENCHMARK(tbb_concurrent_vector_iterate);
|
||||
|
||||
void tbb_concurrent_vector_index(::benchmark::State &state) {
|
||||
tbb::concurrent_vector<Chunk> vec;
|
||||
for (size_t x = 0; x < 9999; ++x) {
|
||||
@@ -757,6 +759,7 @@ void concurrent_append_collection_insert(::benchmark::State &state) {
|
||||
vec.push_back({++x, ++x, ++x, ++x});
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(concurrent_append_collection_insert);
|
||||
void concurrent_append_collection_iterate(::benchmark::State &state) {
|
||||
ConcurrentAppendCollection<Chunk> vec;
|
||||
@@ -770,6 +773,7 @@ void concurrent_append_collection_iterate(::benchmark::State &state) {
|
||||
}
|
||||
}
|
||||
BENCHMARK(concurrent_append_collection_iterate);
|
||||
|
||||
void concurrent_append_collection_index(::benchmark::State &state) {
|
||||
ConcurrentAppendCollection<Chunk> vec;
|
||||
for (size_t x = 0; x < 9999; ++x) {
|
||||
@@ -783,6 +787,27 @@ void concurrent_append_collection_index(::benchmark::State &state) {
|
||||
}
|
||||
BENCHMARK(concurrent_append_collection_index);
|
||||
|
||||
void utils_timestamp(::benchmark::State &state) {
|
||||
for (auto _ : state) {
|
||||
::benchmark::DoNotOptimize(utils::TimeStamp::now());
|
||||
}
|
||||
}
|
||||
BENCHMARK(utils_timestamp);
|
||||
|
||||
void bts_chrono_now(::benchmark::State &state) {
|
||||
for (auto _ : state) {
|
||||
::benchmark::DoNotOptimize(Timer::now());
|
||||
}
|
||||
}
|
||||
BENCHMARK(bts_chrono_now);
|
||||
|
||||
void unix_nano_now(::benchmark::State &state) {
|
||||
for (auto _ : state) {
|
||||
::benchmark::DoNotOptimize(datetime::unix_nano_now());
|
||||
}
|
||||
}
|
||||
BENCHMARK(unix_nano_now);
|
||||
|
||||
struct Benchmark::Args {
|
||||
std::vector<std::string> args;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "QuickTest.h"
|
||||
#include "market_data/handler/ReactorMDP3FeedHandler.h"
|
||||
#include "feed_handler/FeedHandlerBinder.h"
|
||||
#include "system/reactor/Reactor.h"
|
||||
|
||||
namespace bts::cmds {
|
||||
@@ -20,7 +20,7 @@ void test_md() {
|
||||
fm.snapshot.ip = "233.72.75.1";
|
||||
fm.snapshot.port = 23310;
|
||||
|
||||
struct MyObs : IMDP3FeedObserver {
|
||||
struct MyObs : IFeedObserver {
|
||||
void on_recovery_complete(InitialSnapshot const &) override {
|
||||
std::cout << "on_recovery_complete\n";
|
||||
}
|
||||
@@ -31,8 +31,9 @@ void test_md() {
|
||||
} my_obs;
|
||||
|
||||
auto reactor = Reactor();
|
||||
ReactorMDP3FeedHandler handler{reactor, {fm}, my_obs};
|
||||
handler.start();
|
||||
auto handler = FeedHandler (my_obs);
|
||||
auto binder = FeedHandlerBinder ();
|
||||
binder.bind({fm},reactor,handler);
|
||||
for (;;)
|
||||
reactor.do_work();
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include "back_testing/sim/ISim.h"
|
||||
#include "back_testing/sim/sim_common.h"
|
||||
#include "market_data/utils/polygon_utils.h"
|
||||
#include "domain/SecurityDefinition.h"
|
||||
#include "domain/polygons/polygon_utils.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -165,7 +165,8 @@ void PolyObserver::analyze() {
|
||||
}
|
||||
}
|
||||
|
||||
void PolyObserver::on_order_update(EventHeader const &, SimOrderUpdate const &) {
|
||||
void PolyObserver::on_order_update(
|
||||
EventHeader const &, SimOrderUpdate const &) {
|
||||
bts_assert(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
#include "back_testing/sim/pandl/PandL.h"
|
||||
#include "back_testing/sim/sim_common.h"
|
||||
#include "domain/SecurityDefinition.h"
|
||||
#include "market_data/utils/book_utils.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "market_data/utils/polygon_utils.h"
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include "domain/polygons/polygon_utils.h"
|
||||
#include "feed_handler/utils/book_utils.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/container/small_vector.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
|
||||
@@ -202,7 +202,8 @@ void SniperModel::on_order_update(
|
||||
for (auto const &p : in_flight.working) {
|
||||
auto &these_fills = p.second.fills;
|
||||
for (auto &f : these_fills) {
|
||||
clean_fills = clean_fills && (f.fill_type == SimOrderUpdate::AGGRESSIVE);
|
||||
clean_fills =
|
||||
clean_fills && (f.fill_type == SimOrderUpdate::AGGRESSIVE);
|
||||
if (f.status == SimOrderUpdate::CANCELED ||
|
||||
f.status == SimOrderUpdate::FILLED) {
|
||||
pending_orders--;
|
||||
@@ -541,8 +542,8 @@ void SniperModel::transition(State new_state) {
|
||||
me->state = new_state;
|
||||
}
|
||||
|
||||
protos::SimRunOptions
|
||||
SniperModel::fill_defaults(protos::SimRunOptions const &in) {
|
||||
protos::SimRunOptions SniperModel::fill_defaults(
|
||||
protos::SimRunOptions const &in) {
|
||||
protos::SimRunOptions result = in;
|
||||
set_param_if_empty(&result, "min_orders_at_top", 1);
|
||||
set_param_if_empty(&result, "max_qty", 1);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// #include "lib/orderman/orderman_utils/orderman_common.h"
|
||||
// #include "lib/domain_model/Security.pb.h"
|
||||
// #include "back_testing/simulator/AlgoEvent.h"
|
||||
// #include "market_data/common/mdp3_common.h"
|
||||
// #include "feed_handler/common/mdp3_common.h"
|
||||
|
||||
// #include
|
||||
// "lib/orderman/orders/spreader_orders/spreader/external_interfacing/IAlternateOrderGateway.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// #pragma once
|
||||
|
||||
// #include "market_data/common/mdp3_common.h"
|
||||
// #include "feed_handler/common/mdp3_common.h"
|
||||
// #include "back_testing/simulator/AlgoEvent.h"
|
||||
// #include "back_testing/simulator/IAlgoModel.h"
|
||||
// #include "SimOrderGateway.h"
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@
|
||||
|
||||
// #include
|
||||
// "back_testing/algos/spreader/SimSpreader.h"
|
||||
// #include "market_data/common/mdp3_common.h"
|
||||
// #include "feed_handler/common/mdp3_common.h"
|
||||
// #include "back_testing/simulator/AlgoEvent.h"
|
||||
// #include "market_data/common/SecurityDefinition.h"
|
||||
// #include "feed_handler/common/SecurityDefinition.h"
|
||||
// #include "back_testing/simulator/ISimServices.h"
|
||||
// #include "lib/orderman/orders/spreader_orders/tests/tests_common.h"
|
||||
// #include
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "server/sparkd/cmds/spartan/domain/SecurityID.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/book/Book.h"
|
||||
#include "domain/SecurityID.h"
|
||||
#include "domain/book/Book.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
#include "server/sparkd/cmds/spartan/domain/order/OrderKey.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Price.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Quantity.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/SecurityID.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Side.h"
|
||||
#include "domain/order/OrderKey.h"
|
||||
#include "domain/Price.h"
|
||||
#include "domain/Quantity.h"
|
||||
#include "domain/SecurityID.h"
|
||||
#include "domain/Side.h"
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "lib/utils/bts_chrono.h"
|
||||
#include "lib/utils/datetime.h"
|
||||
#include "back_testing/run/SimSessionOptions.pb.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
|
||||
#include <SQLiteCpp/SQLiteCpp.h>
|
||||
#include <boost/date_time/gregorian/gregorian.hpp>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "lib/persistence/persistence_utils.h"
|
||||
#include "lib/utils/ValueWrapper.h"
|
||||
#include "back_testing/sim/sim_common.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
|
||||
namespace bts::spartan::protos {
|
||||
class SimRunOptions;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "back_testing/sim/sim_common.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include <functional>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include "domain/LegDefinition.h"
|
||||
#include "domain/SideQuantity.h"
|
||||
#include "lib/domain_model/Security.h"
|
||||
#include "market_data/utils/book_utils.h"
|
||||
#include "market_data/utils/order_utils.h"
|
||||
#include "feed_handler/utils/book_utils.h"
|
||||
#include "feed_handler/utils/order_utils.h"
|
||||
#include <limits>
|
||||
#include <variant>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "FillDepot.h"
|
||||
#include "back_testing/common/MatchEffect.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "FifoMatcherContext.h"
|
||||
#include "FillDepot.h"
|
||||
#include "lib/orderman/orderman_utils/PriceComp.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "market_data/implied/implied_market.h"
|
||||
#include "market_data/utils/book_utils.h"
|
||||
#include "market_data/utils/order_utils.h"
|
||||
#include "market_data/utils/security_comp.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "feed_handler/implied/implied_market.h"
|
||||
#include "feed_handler/utils/book_utils.h"
|
||||
#include "feed_handler/utils/order_utils.h"
|
||||
#include "feed_handler/utils/security_comp.h"
|
||||
#include "utils/ActionSummarizerMacros.h"
|
||||
#include "utils/TableDisplay.h"
|
||||
#include <algorithm>
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include "common/MatchingSession.h"
|
||||
#include "fill_factory.h"
|
||||
#include "lib/orderman/orderman_utils/PriceComp.h"
|
||||
#include "market_data/common/OrderModification.h"
|
||||
#include "market_data/utils/book_utils.h"
|
||||
#include "market_data/utils/order_utils.h"
|
||||
#include "feed_handler/common/OrderModification.h"
|
||||
#include "feed_handler/utils/book_utils.h"
|
||||
#include "feed_handler/utils/order_utils.h"
|
||||
#include <boost/container/flat_map.hpp>
|
||||
#include <fmt/format.h>
|
||||
#include <range/v3/algorithm.hpp>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "FifoSecurityMatcher.h"
|
||||
#include "domain/SecuritySnapshot.h"
|
||||
#include "iceberg_helper.h"
|
||||
#include "market_data/common/OrderModification.h"
|
||||
#include "market_data/utils/order_utils.h"
|
||||
#include "feed_handler/common/OrderModification.h"
|
||||
#include "feed_handler/utils/order_utils.h"
|
||||
#include <experimental/map>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "lib/md/IntPrice.h"
|
||||
#include "lib/utils/bts_assert.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Matcher.h"
|
||||
#include "MatchingCommon.h"
|
||||
#include "back_testing/common/Trace.h"
|
||||
#include "market_data/utils/book_utils.h"
|
||||
#include "feed_handler/utils/book_utils.h"
|
||||
#include <boost/container/flat_map.hpp>
|
||||
#include <functional>
|
||||
#include <google/protobuf/util/time_util.h>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "FifoSecurityMatcher.h"
|
||||
#include "MatchingCommon.h"
|
||||
#include "back_testing/sim/sim_common.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include <google/protobuf/timestamp.pb.h>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "IcebergFileCache.h"
|
||||
#include "lib/logging/logging.h"
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
#include "utils/FileUtils.h"
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include <string>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
#include "server/sparkd/cmds/spartan/domain/IcebergQuantity.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Price.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Quantity.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Side.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/order/OrderKey.h"
|
||||
#include "domain/IcebergQuantity.h"
|
||||
#include "domain/Price.h"
|
||||
#include "domain/Quantity.h"
|
||||
#include "domain/Side.h"
|
||||
#include "domain/order/OrderKey.h"
|
||||
#include <cstdint>
|
||||
#include <ostream>
|
||||
#include <tuple>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include "../FifoImpliedSecurityMatcher.h"
|
||||
#include "../FifoSecurityMatcher.h"
|
||||
#include "MatcherOneof.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Price.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Side.h"
|
||||
#include "domain/Price.h"
|
||||
#include "domain/Side.h"
|
||||
#include <set>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "server/sparkd/cmds/spartan/domain/Side.h"
|
||||
#include "domain/Side.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
inline MDP3Fill::Aggressor _to_aggressor(Side s) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include "lib/md/IntPrice.h"
|
||||
#include "lib/orderman/orderman_utils/Formatter.h"
|
||||
#include "domain/SecuritySnapshot.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "market_data/gen/src/SecurityTradingStatus.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "feed_handler/detail/gen/src/SecurityTradingStatus.h"
|
||||
#include "utils/ActionSummarizer.h"
|
||||
#include "utils/ActionSummarizerMacros.h"
|
||||
#include "utils/TableDisplay.h"
|
||||
|
||||
+5
-5
@@ -11,11 +11,11 @@
|
||||
#include "back_testing/matcher/matcher_diagnostics.h"
|
||||
#include "back_testing/matcher/validation/event_flags.h"
|
||||
#include "domain/SecuritySnapshot.h"
|
||||
#include "market_data/gen/src/SecurityTradingStatus.h"
|
||||
#include "market_data/utils/event_ordinal.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "market_data/utils/order_utils.h"
|
||||
#include "market_data/utils/security_comp.h"
|
||||
#include "feed_handler/detail/gen/src/SecurityTradingStatus.h"
|
||||
#include "feed_handler/utils/event_ordinal.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "feed_handler/utils/order_utils.h"
|
||||
#include "feed_handler/utils/security_comp.h"
|
||||
#include "utils/ActionSummarizer.h"
|
||||
#include "utils/ActionSummarizerMacros.h"
|
||||
#include <boost/container/flat_map.hpp>
|
||||
|
||||
+5
-5
@@ -1,16 +1,16 @@
|
||||
#pragma once
|
||||
#include "back_testing/matcher/FifoMatcherContext.h"
|
||||
#include "domain/SecuritySnapshot.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "market_data/handler/IMDP3FeedObserver.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/IFeedObserver.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include <boost/container/flat_map.hpp>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
struct MatcherValidationObserver : IMDP3FeedObserver {
|
||||
struct MatcherValidationObserver : IFeedObserver {
|
||||
MatcherValidationObserver(
|
||||
std::unordered_map<OrderKey, IcebergInput> icebergs);
|
||||
// interesting_event_ranges:
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "back_testing/db/SimLogger.h"
|
||||
#include "back_testing/run/SimSessionOptions.pb.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "market_data/utils/polygon_utils.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
class MDP3EventGenerator;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "domain/SecurityMap.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "market_data/utils/polygon_utils.h"
|
||||
#include "domain/polygons/polygon_utils.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -21,7 +21,8 @@ class ISim {
|
||||
virtual void start_simulation() = 0;
|
||||
virtual void stop_simulation() = 0;
|
||||
virtual void log_pandl() const = 0;
|
||||
template <class... T> void log(std::string const &ty, T &&... args) const;
|
||||
template <class... T>
|
||||
void log(std::string const &ty, T &&... args) const;
|
||||
|
||||
private:
|
||||
virtual void algo_log(
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "Sim.h"
|
||||
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/utils/datetime.h"
|
||||
#include "back_testing/db/SimLogger.h"
|
||||
#include "back_testing/matcher/Matcher.h"
|
||||
#include "back_testing/matcher/iceberg_helper.h"
|
||||
@@ -12,9 +10,11 @@
|
||||
#include "back_testing/sim/pcap/PCapEvent.h"
|
||||
#include "back_testing/sim/pcap/PCapEventGenerator.h"
|
||||
#include "back_testing/sim/sim_common.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "market_data/utils/polygon_utils.h"
|
||||
#include "domain/polygons/polygon_utils.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/utils/datetime.h"
|
||||
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
@@ -68,7 +68,8 @@ struct Sim::AlgoCBFilter : IAlgoModel {
|
||||
EventHeader const &h, std::vector<SimBookUpdate> const &b) override {
|
||||
real_algo.on_replay_start(h, b);
|
||||
}
|
||||
void on_order_update(EventHeader const &h, SimOrderUpdate const &o) override {
|
||||
void on_order_update(
|
||||
EventHeader const &h, SimOrderUpdate const &o) override {
|
||||
if (!owner.is_stopping_sim())
|
||||
real_algo.on_order_update(h, o);
|
||||
}
|
||||
@@ -366,7 +367,8 @@ void Sim::on_algo_action() {
|
||||
|
||||
sim_log(
|
||||
"algo_order", algo_action.transact_time.value(),
|
||||
OrderChange::ChangeType_Name(change.change), get_security(change.order.security).symbol(),
|
||||
OrderChange::ChangeType_Name(change.change),
|
||||
get_security(change.order.security).symbol(),
|
||||
change.order.price.to_double(), change.order.quantity.value(),
|
||||
Side_Name(change.order.side), change.order.key.value(), 0);
|
||||
|
||||
@@ -533,8 +535,8 @@ void Sim::clear_simulated_order_book(TimeStamp transact_time, SecurityID sid) {
|
||||
match_and_send_effects(transact_time, matcher_input);
|
||||
}
|
||||
|
||||
SmallOrderChange
|
||||
Sim::correct_pcap_order(OrderChange const &o, bool set_exact_ib_state) {
|
||||
SmallOrderChange Sim::correct_pcap_order(
|
||||
OrderChange const &o, bool set_exact_ib_state) {
|
||||
bts_assert(me->state == State::SIM);
|
||||
bts_assert(me->simulation);
|
||||
auto &key_map = me->simulation->cme_key_map;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "back_testing/db/SimLogger.h"
|
||||
#include "back_testing/sim/ISim.h"
|
||||
#include "back_testing/sim/pandl/PandLSummary.h"
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
#include "domain/SecurityMap.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "lib/os/os.h"
|
||||
#include "domain/SecurityMap.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "domain/CommissionModel.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "domain/SecuritySnapshot.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include <boost/container/small_vector.hpp>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "PCapEventGenerator.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include <queue>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
struct PCapEventGenerator::PImpl {
|
||||
PImpl(std::string const &pcap, IMDP3FeedObserver &obs)
|
||||
PImpl(std::string const &pcap, IFeedObserver &obs)
|
||||
: streamer(pcap, obs), done(false) {}
|
||||
|
||||
PCapStreamer streamer;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "back_testing/sim/pcap/PCapEvent.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "market_data/handler/IMDP3FeedObserver.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "feed_handler/IFeedObserver.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
class PCapEventGenerator : IMDP3FeedObserver {
|
||||
class PCapEventGenerator : IFeedObserver {
|
||||
public:
|
||||
PCapEventGenerator(std::string const &pcap);
|
||||
PCapEventGenerator(PCapEventGenerator &&);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "PCapEventSource.h"
|
||||
|
||||
#include "back_testing/sim/pcap/PCapEvent.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "market_data/feed_observers/DefinitionCollector.h"
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "market_data/feed_observers/PolygonFinder.h"
|
||||
#include "domain/polygons/PolygonFinder.h"
|
||||
#include "feed_handler/feed_observers/DefinitionCollector.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
#include <vector>
|
||||
|
||||
#include "back_testing/sim/pcap/PCapEventGenerator.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "market_data/utils/polygon_utils.h"
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "domain/SecurityDefinition.h"
|
||||
#include "domain/SecurityMap.h"
|
||||
|
||||
#include "domain/polygons/polygon_utils.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
class SecurityDefinition;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#include "domain/SecuritySnapshot.h"
|
||||
#include "domain/order/OrderBootstrapComp.h"
|
||||
#include "domain/order/OrderChangeBootstrapComp.h"
|
||||
#include "market_data/gen/src/SecurityTradingStatus.h"
|
||||
#include "feed_handler/detail/gen/src/SecurityTradingStatus.h"
|
||||
#include <unordered_map>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "domain/EventID.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "common/TimeStamp.h"
|
||||
#include "domain/AlgoEventID.h"
|
||||
#include "domain/order/OrderChange.h"
|
||||
#include "market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
// #include "lib/orderman/orders/algo/IAlgoOrder.h"
|
||||
// //#include "lib/orderman/orders/algo/IBeforeLaunchAlgoServices.h"
|
||||
// //#include "../ISimServices.h"
|
||||
// #include "market_data/common/SecurityDefinition.h"
|
||||
// #include "market_data/common/SecurityMap.h"
|
||||
// #include "feed_handler/common/SecurityDefinition.h"
|
||||
// #include "feed_handler/common/SecurityMap.h"
|
||||
// #include "back_testing/simulator/AlgoEvent.h"
|
||||
// #include "lib/orderman/orderman_utils/Book.h"
|
||||
// #include "market_data/common/mdp3_common.h"
|
||||
// #include "feed_handler/common/mdp3_common.h"
|
||||
// #include "back_testing/simulator/AlgoEvent.h"
|
||||
// #include "back_testing/simulator/IAlgoModel.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "BookStats.h"
|
||||
#include "market_data/feed_observers/BookStatRecorder.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/BookStatRecorder.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "utils/FileUtils.h"
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "CSV.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
|
||||
namespace bts::spartan::cmds {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "Compress.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
|
||||
namespace bts::spartan::cmds {
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "FindPolys.h"
|
||||
#include "market_data/feed_observers/DefinitionCollector.h"
|
||||
#include "market_data/feed_observers/PolygonFinder.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "market_data/utils/polygon_utils.h"
|
||||
#include "feed_handler/feed_observers/DefinitionCollector.h"
|
||||
#include "domain/polygons/PolygonFinder.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "domain/polygons/polygon_utils.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace bts::spartan::cmds {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "Icebergs.h"
|
||||
#include "domain/IcebergQuantity.h"
|
||||
#include "domain/order/OrderKey.h"
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "market_data/handler/IMDP3FeedObserver.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/IFeedObserver.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "utils/FileUtils.h"
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "Json.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
|
||||
namespace bts::spartan::cmds {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "ListSec.h"
|
||||
#include "market_data/feed_observers/DefinitionCollector.h"
|
||||
#include "market_data/feed_observers/FillCounter.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/DefinitionCollector.h"
|
||||
#include "feed_handler/feed_observers/FillCounter.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace bts::spartan::cmds {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "PolygonBooks.h"
|
||||
#include "lib/orderman/orderman_utils/Formatter.h"
|
||||
#include "domain/book/Book.h"
|
||||
#include "market_data/feed_observers/SyntheticBookRecorder.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/SyntheticBookRecorder.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "utils/FileUtils.h"
|
||||
#include "utils/sql/adapters/polygon_defs.h"
|
||||
#include "utils/sql/sql_utils.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "SQL.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
|
||||
namespace bts::spartan::cmds {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "Sim.h"
|
||||
#include "back_testing/run/run_sim.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include <functional>
|
||||
|
||||
namespace bts::spartan::cmds {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "Stats.h"
|
||||
#include "domain/SecuritySnapshot.h"
|
||||
#include "market_data/handler/IMDP3FeedObserver.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/IFeedObserver.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "utils/FileUtils.h"
|
||||
|
||||
namespace bts::spartan::cmds {
|
||||
@@ -9,7 +9,7 @@ namespace bts::spartan::cmds {
|
||||
size_t total_orders = 0;
|
||||
static void execute(const std::string &pcap, std::ostream &out_file) {
|
||||
out_file << "sid,n_orders" << std::endl;
|
||||
struct StatPrinter : spartan::mdp3::IMDP3FeedObserver {
|
||||
struct StatPrinter : spartan::mdp3::IFeedObserver {
|
||||
StatPrinter(std::ostream &out) : out{out} {}
|
||||
std::ostream &out;
|
||||
void on_event_end(spartan::mdp3::MDP3Event const &ev) override {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "ValidateFifo.h"
|
||||
#include "back_testing/matcher/validation/matcher_validation_observer.h"
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace bts::spartan::cmds {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "ValuePolys.h"
|
||||
#include "market_data/feed_observers/DefinitionCollector.h"
|
||||
#include "market_data/feed_observers/PolygonFinder.h"
|
||||
#include "market_data/feed_observers/PolygonOpportunityFinder.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/DefinitionCollector.h"
|
||||
#include "domain/polygons/PolygonFinder.h"
|
||||
#include "domain/polygons/PolygonOpportunityFinder.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "utils/FileUtils.h"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#include "cmds/matcher/common/InitData.h"
|
||||
#include "common/cli/RangeArg.h"
|
||||
#include "domain/SecurityCriteria.h"
|
||||
#include "market_data/feed_observers/recorders/MatcherBookRecorder.h"
|
||||
#include "market_data/feed_observers/recorders/MatcherRecorder.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/recorders/MatcherBookRecorder.h"
|
||||
#include "feed_handler/feed_observers/recorders/MatcherRecorder.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "utils/FileUtils.h"
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
#include "cmds/matcher/common/InitData.h"
|
||||
#include "common/cli/RangeArg.h"
|
||||
#include "domain/SecurityCriteria.h"
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "market_data/feed_observers/recorders/MatcherFillRecorder.h"
|
||||
#include "market_data/feed_observers/recorders/MatcherRecorder.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/feed_observers/recorders/MatcherFillRecorder.h"
|
||||
#include "feed_handler/feed_observers/recorders/MatcherRecorder.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "utils/FileUtils.h"
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#include "cmds/matcher/common/InitData.h"
|
||||
#include "common/cli/RangeArg.h"
|
||||
#include "domain/SecurityCriteria.h"
|
||||
#include "market_data/feed_observers/recorders/MatcherProcTimeRecorder.h"
|
||||
#include "market_data/feed_observers/recorders/MatcherRecorder.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/recorders/MatcherProcTimeRecorder.h"
|
||||
#include "feed_handler/feed_observers/recorders/MatcherRecorder.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include "utils/FileUtils.h"
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "InitData.h"
|
||||
#include "back_testing/matcher/common/IcebergFileCache.h"
|
||||
#include "domain/SecurityDefinition.h"
|
||||
#include "market_data/feed_observers/CompositeObserver.h"
|
||||
#include "market_data/feed_observers/DefinitionCollector.h"
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/CompositeObserver.h"
|
||||
#include "feed_handler/feed_observers/DefinitionCollector.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "domain/SecurityDefinition.h"
|
||||
#include "market_data/feed_observers/IcebergFinder.h"
|
||||
#include "feed_handler/feed_observers/IcebergFinder.h"
|
||||
#include <unordered_map>
|
||||
|
||||
namespace bts::spartan::cmds::matcher {
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
* CME Risk Controls
|
||||
** [[https://www.cmegroup.com/tools-information/webhelp/account-manager-service/Content/calculating-icc.html?Highlight=icc][ICC]]
|
||||
** GC2
|
||||
* MDP3
|
||||
** Templates
|
||||
- [[ftp://ftp.cmegroup.com/SBEFix/][Templates and Config FTP Site]]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "server/sparkd/cmds/spartan/back_testing/run/SimSessionOptions.pb.h"
|
||||
#include "back_testing/run/SimSessionOptions.pb.h"
|
||||
|
||||
namespace bts::spartan {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "server/sparkd/cmds/spartan/common/Range.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/EventID.h"
|
||||
#include "common/Range.h"
|
||||
#include "domain/EventID.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "server/sparkd/cmds/spartan/domain/Quantity.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/SecurityID.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Side.h"
|
||||
#include "domain/Quantity.h"
|
||||
#include "domain/SecurityID.h"
|
||||
#include "domain/Side.h"
|
||||
#include <boost/container/flat_map.hpp>
|
||||
#include <boost/container/small_vector.hpp>
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
using MarketSegmentID =
|
||||
utils::ValueWrapper<struct MarketSegmentIDTag, int32_t>;
|
||||
utils::ValueWrapper<struct MarketSegmentIDTag, uint8_t>;
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/utils/datetime.h"
|
||||
#include "lib/utils/helper_macros.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/utils/mdp3_utils.h"
|
||||
#include "server/sparkd/cmds/spartan/feed_handler/utils/mdp3_utils.h"
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
@@ -15,6 +15,7 @@ template <class M> void SecurityDefinition::init(M m) {
|
||||
security_group_ =
|
||||
str_from_fixed_array(m.securityGroup(), m.securityGroupEncodingLength());
|
||||
asset_ = str_from_fixed_array(m.asset(), m.assetEncodingLength());
|
||||
market_segment_id_.value() = m.marketSegmentID();
|
||||
display_factor_ =
|
||||
Price(m.displayFactor().mantissa(), m.displayFactor().exponent())
|
||||
.to_double();
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#include "LegDefinition.h"
|
||||
#include "domain/MarketSegmentID.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/common/mdp3_common.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/gen/src/MDInstrumentDefinitionFuture54.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/gen/src/MDInstrumentDefinitionOption55.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/gen/src/MDInstrumentDefinitionSpread56.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "feed_handler/detail/gen/src/MDInstrumentDefinitionFuture54.h"
|
||||
#include "feed_handler/detail/gen/src/MDInstrumentDefinitionOption55.h"
|
||||
#include "feed_handler/detail/gen/src/MDInstrumentDefinitionSpread56.h"
|
||||
#include <boost/container/small_vector.hpp>
|
||||
|
||||
#include <ostream>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "server/sparkd/cmds/spartan/market_data/common/mdp3_common.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include <unordered_map>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "server/sparkd/cmds/spartan/domain/SecurityDefinition.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Side.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/common/mdp3_common.h"
|
||||
#include "domain/SecurityDefinition.h"
|
||||
#include "domain/Side.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "lib/domain_model/Security.pb.h"
|
||||
#include "server/sparkd/cmds/spartan/execution/il3/gen/src/SideReq.h"
|
||||
#include "gateway/detail/gen/src/SideReq.h"
|
||||
|
||||
#include <ostream>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "server/sparkd/cmds/spartan/common/SecurityID.h"
|
||||
#include "common/SecurityID.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
class SecuritySnapshot;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "server/sparkd/cmds/spartan/domain/Price.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Quantity.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/fill/AggressorSide.h"
|
||||
#include "domain/Price.h"
|
||||
#include "domain/Quantity.h"
|
||||
#include "domain/fill/AggressorSide.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "server/sparkd/cmds/spartan/domain/Side.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/book/BookLevel.h"
|
||||
#include "../Side.h"
|
||||
#include "../SecurityID.h"
|
||||
#include "BookLevel.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
@@ -77,7 +78,8 @@ class BookT {
|
||||
BS &operator[](Side s) { return _books[(size_t)s]; }
|
||||
BS const &operator[](Side s) const { return _books[(size_t)s]; }
|
||||
bool operator==(BookT const &rhs) const { return _books == rhs._books; }
|
||||
|
||||
mdp3::SecurityID security_id() const {return _security_id;}
|
||||
mdp3::SecurityID &security_id() {return _security_id;}
|
||||
template <class OtherBook>
|
||||
void merge_with(OtherBook const &b) ;
|
||||
|
||||
@@ -85,6 +87,7 @@ class BookT {
|
||||
static BookT merge(BookT const&,OtherBook const &) ;
|
||||
|
||||
private:
|
||||
mdp3::SecurityID _security_id;
|
||||
std::array<BS, 2> _books;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "server/sparkd/cmds/spartan/domain/Price.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/Quantity.h"
|
||||
#include "domain/Price.h"
|
||||
#include "domain/Quantity.h"
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
|
||||
+7
-8
@@ -1,15 +1,15 @@
|
||||
#include "PolygonFinder.h"
|
||||
|
||||
#include "server/sparkd/cmds/spartan/market_data/utils/polygon_utils.h"
|
||||
#include "DefinitionCollector.h"
|
||||
#include "FillCounter.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/utils/mdp3_utils.h"
|
||||
#include "feed_handler/feed_observers/DefinitionCollector.h"
|
||||
#include "feed_handler/feed_observers/FillCounter.h"
|
||||
#include "domain/polygons/polygon_utils.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include <boost/date_time/posix_time/ptime.hpp>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
const SecurityDefinition &
|
||||
find_instr(DefinitionCollector &defs, SecurityID sec_id) {
|
||||
const SecurityDefinition &find_instr(
|
||||
DefinitionCollector &defs, SecurityID sec_id) {
|
||||
auto it = defs.result.find(sec_id);
|
||||
bts_assert(it != defs.result.end());
|
||||
return it->second;
|
||||
@@ -27,8 +27,7 @@ bool apply_filter_to_legs(
|
||||
instr.security_type() == bts::api::SecurityType::SECURITYTYPE_SPREAD);
|
||||
bts_assert(instr.legs().size() > 0);
|
||||
for (const auto &ldef : instr.legs()) {
|
||||
const SecurityDefinition &leg_instr =
|
||||
find_instr(defs, ldef.security_id);
|
||||
const SecurityDefinition &leg_instr = find_instr(defs, ldef.security_id);
|
||||
bts_assert(
|
||||
leg_instr.security_type() ==
|
||||
bts::api::SecurityType::SECURITYTYPE_FUTURE);
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "server/sparkd/cmds/spartan/market_data/handler/IMDP3FeedObserver.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/common/mdp3_common.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/utils/polygon_utils.h"
|
||||
#include "domain/polygons/polygon_utils.h"
|
||||
#include "feed_handler/IFeedObserver.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "lib/config/config.h"
|
||||
#include "lib/config/protos/spartan.pb.h"
|
||||
#include <set>
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
|
||||
struct PolygonFinder : IMDP3FeedObserver {
|
||||
struct PolygonFinder : IFeedObserver {
|
||||
std::unordered_map<size_t, Polygon> result;
|
||||
|
||||
struct Options {
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
#include "PolygonOpportunityFinder.h"
|
||||
#include "lib/domain_model/Security.h"
|
||||
#include "lib/md/MDConsumerHandle.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/SecuritySnapshot.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/utils/book_utils.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/utils/mdp3_utils.h"
|
||||
#include "domain/SecuritySnapshot.h"
|
||||
#include "feed_handler/utils/book_utils.h"
|
||||
#include "feed_handler/utils/mdp3_utils.h"
|
||||
#include <fstream>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
@@ -468,4 +468,4 @@ void PolygonOpportunityFinder::add_prev_event_polyval(
|
||||
v.push_back(pval);
|
||||
}
|
||||
|
||||
} // namespace bts::spartan::mdp3
|
||||
} // namespace bts::spartan::mdp3
|
||||
+25
-32
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "server/sparkd/cmds/spartan/market_data/handler/IMDP3FeedObserver.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/common/mdp3_common.h"
|
||||
#include "server/sparkd/cmds/spartan/market_data/utils/polygon_utils.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "feed_handler/IFeedObserver.h"
|
||||
#include "domain/polygons/polygon_utils.h"
|
||||
#include <unordered_map>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
@@ -10,7 +10,7 @@ namespace bts::spartan::mdp3 {
|
||||
class SecuritySnapshot;
|
||||
|
||||
// Basic event info
|
||||
struct EventInfo{
|
||||
struct EventInfo {
|
||||
size_t event_id = 0;
|
||||
TimeStamp transact_time = TimeStamp{0};
|
||||
TimeStamp first_packet_send_time;
|
||||
@@ -18,32 +18,26 @@ struct EventInfo{
|
||||
uint32_t first_packet_sn;
|
||||
uint32_t last_packet_sn;
|
||||
EventInfo() {}
|
||||
EventInfo (const MDP3Event& ev);
|
||||
EventInfo(const MDP3Event &ev);
|
||||
};
|
||||
|
||||
// This is the book state along with the event that resulted in the book.
|
||||
// It is used both to mantain a state for the books, as well as to hold
|
||||
// the leg books in the PolygonValuation
|
||||
struct CachedBook{
|
||||
struct CachedBook {
|
||||
SecurityID sec_id;
|
||||
// event data
|
||||
EventInfo ev_info;
|
||||
// books
|
||||
BookSide bid_book, ask_book,
|
||||
bid_d_book, ask_d_book;
|
||||
TimeStamp last_top_bid_ts,
|
||||
last_top_ask_ts;
|
||||
CachedBook (){}
|
||||
CachedBook (const EventInfo& ev, SecuritySnapshot const* p);
|
||||
void update (const EventInfo& ev, SecuritySnapshot const* p);
|
||||
BookSide bid_book, ask_book, bid_d_book, ask_d_book;
|
||||
TimeStamp last_top_bid_ts, last_top_ask_ts;
|
||||
CachedBook() {}
|
||||
CachedBook(const EventInfo &ev, SecuritySnapshot const *p);
|
||||
void update(const EventInfo &ev, SecuritySnapshot const *p);
|
||||
};
|
||||
|
||||
struct PolygonValuation {
|
||||
enum Status{
|
||||
PRE = 0,
|
||||
IN = 1,
|
||||
POST
|
||||
};
|
||||
enum Status { PRE = 0, IN = 1, POST };
|
||||
Status status;
|
||||
std::string product;
|
||||
Polygon polygon;
|
||||
@@ -67,7 +61,8 @@ struct PolygonValuation {
|
||||
std::vector<CachedBook> leg_books = {};
|
||||
std::vector<Side> leg_book_sides = {};
|
||||
BookSide poly_bid_book = BookSide(), poly_ask_book = BookSide(),
|
||||
poly_direct_bid_book = BookSide(), poly_direct_ask_book = BookSide();
|
||||
poly_direct_bid_book = BookSide(),
|
||||
poly_direct_ask_book = BookSide();
|
||||
};
|
||||
std::ostream &operator<<(std::ostream &, PolygonValuation const &);
|
||||
std::istream &operator>>(std::istream &, PolygonValuation &);
|
||||
@@ -89,8 +84,8 @@ struct PolygonOpportunity {
|
||||
Quantity merged_quantity = Quantity{0};
|
||||
};
|
||||
|
||||
std::vector<PolygonOpportunity>
|
||||
aggregate(std::vector<PolygonValuation> const &);
|
||||
std::vector<PolygonOpportunity> aggregate(
|
||||
std::vector<PolygonValuation> const &);
|
||||
|
||||
void poly_values_to_csv(
|
||||
std::vector<PolygonValuation> const &,
|
||||
@@ -104,7 +99,7 @@ void poly_opportunities_to_csv(
|
||||
SecurityMap &,
|
||||
std::ofstream &);
|
||||
|
||||
struct PolygonOpportunityFinder : IMDP3FeedObserver {
|
||||
struct PolygonOpportunityFinder : IFeedObserver {
|
||||
std::vector<PolygonValuation> result;
|
||||
|
||||
PolygonOpportunityFinder(PolygonMap const &, SecurityMap const &);
|
||||
@@ -117,21 +112,19 @@ struct PolygonOpportunityFinder : IMDP3FeedObserver {
|
||||
|
||||
Polygon const &get_poly(size_t);
|
||||
SecurityDefinition const &get_sec(SecurityID);
|
||||
std::string get_polygon_product(const Polygon& polygon);
|
||||
// computes the polyvol at the current event and adds
|
||||
std::string get_polygon_product(const Polygon &polygon);
|
||||
// computes the polyvol at the current event and adds
|
||||
// it to the vector
|
||||
void add_current_event_polyval(
|
||||
PolygonValuation::Status status,
|
||||
size_t pid,
|
||||
const Polygon& poly,
|
||||
const MDP3Event& ev,
|
||||
std::vector<PolygonValuation>& v);
|
||||
PolygonValuation::Status status,
|
||||
size_t pid,
|
||||
const Polygon &poly,
|
||||
const MDP3Event &ev,
|
||||
std::vector<PolygonValuation> &v);
|
||||
// anologous to the above, but computes the polyval
|
||||
// last event
|
||||
void add_prev_event_polyval(
|
||||
size_t pid,
|
||||
const Polygon& poly,
|
||||
std::vector<PolygonValuation>&);
|
||||
size_t pid, const Polygon &poly, std::vector<PolygonValuation> &);
|
||||
struct PImpl;
|
||||
struct SnapshotRec;
|
||||
std::unique_ptr<PImpl> me;
|
||||
File renamed without changes.
+2
-2
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../common/mdp3_common.h"
|
||||
#include "server/sparkd/cmds/spartan/domain/SecurityMap.h"
|
||||
#include "feed_handler/common/mdp3_common.h"
|
||||
#include "domain/SecurityMap.h"
|
||||
#include <algorithm>
|
||||
#include <boost/container/small_vector.hpp>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#include "../polygon_utils.h"
|
||||
#include "domain/polygons/polygon_utils.h"
|
||||
#include <catch/catch.hpp>
|
||||
|
||||
namespace bts::spartan::mdp3 {
|
||||
@@ -0,0 +1 @@
|
||||
#include "AlgoManager.h"
|
||||
@@ -0,0 +1,28 @@
|
||||
// #pragma once
|
||||
|
||||
// namespace bts::spartan {
|
||||
|
||||
// class OrderUpdate;
|
||||
|
||||
// class AlgoManager {
|
||||
// public:
|
||||
// void on_books(SecurityID, Book const&, ImpliedBook const&);
|
||||
// void on_order_update(OrderUpdate const &);
|
||||
// void on_trade_summary_signal(TradeSummarySignal const &) = 0;
|
||||
|
||||
|
||||
|
||||
// OrderHandle send(IAlgo &, NewOrder const &);
|
||||
// void send(IAlgo &, OrderHandle, CancelReplace const &);
|
||||
// void send(IAlgo &, OrderHandle, Cancel const &);
|
||||
|
||||
// void subscribe_security(IAlgo &, SecurityID);
|
||||
// void subscribe_timer(IAlgo &);
|
||||
|
||||
// template <class... T>
|
||||
// void add_tracepoint(const char *tp, T &&... args);
|
||||
// template <class... T>
|
||||
// void log(const char *entry_type, T &&... args);
|
||||
// };
|
||||
|
||||
// } // namespace bts::spartan
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 426 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user