diff --git a/MatchingEngine/src/Market.cpp b/MatchingEngine/src/Market.cpp index eb2fa1e..c64d1d5 100644 --- a/MatchingEngine/src/Market.cpp +++ b/MatchingEngine/src/Market.cpp @@ -442,9 +442,8 @@ void Market::on_depth_change(const DepthOrderBook *book, std::stringstream ss; MarketDataIncrementalRefreshLogger::log(ss, md_update->priceDepth); LOG4CXX_INFO(logger, "MarketDataIncrementalRefresh : [" << ss.str() << "]"); - std::cout << "Update : " << ss.str() << std::endl; - int market_data_index = MARKET_DATA_PRICE_DEPTH * 2; // bids and asks + int market_data_index = MARKET_DATA_PRICE_DEPTH * 2; // bids and asks auto current_stats = stats_ptr_->find(book->symbol()); diff --git a/MatchingEngine/src/Order.cpp b/MatchingEngine/src/Order.cpp index 9adcc6d..dddb87d 100644 --- a/MatchingEngine/src/Order.cpp +++ b/MatchingEngine/src/Order.cpp @@ -105,7 +105,7 @@ void Order::onRejected(const char *reason) {} void Order::onFilled(liquibook::book::Quantity fill_qty, liquibook::book::Cost fill_cost) { quantityOnMarket_ -= fill_qty; - fillCost_ += fill_cost; + fillCost_ += (fill_cost * fill_qty); quantityFilled_ += fill_qty; std::stringstream msg; @@ -243,10 +243,6 @@ void Order::populateExecutionReport( executionReport.TimeInForce(FIX::TimeInForce_DAY); } - - // std::cout << "Transact Time : " << ACE_OS::gettimeofday().msec() << ":" << - // executionReport.TransactTime << std::endl; - if (quantityFilled() > 0) executionReport.AvgPx(std::nearbyint(fillCost() / quantityFilled())); // round to the nearest tick else diff --git a/MatchingEngine/src/PriceDepthPublisherService.cpp b/MatchingEngine/src/PriceDepthPublisherService.cpp index 562aef5..db74c2a 100644 --- a/MatchingEngine/src/PriceDepthPublisherService.cpp +++ b/MatchingEngine/src/PriceDepthPublisherService.cpp @@ -73,30 +73,21 @@ int PriceDepthPublisherService::service() // // Iterate through the queue and get the latest update // - - /*std::cout << "Queue Size : " - << _price_depth_publisher_queue_ptr->size() - << std::endl;*/ - - std::shared_ptr market_data_update; + std::shared_ptr market_data_update; - std::map - latestMarketDataUpdates; + std::map + latestMarketDataUpdates; - - while (_price_depth_publisher_queue_ptr->pop(market_data_update)) - { - latestMarketDataUpdates[market_data_update->symbol] = market_data_update->priceDepth; - - std::stringstream ss; - MarketDataIncrementalRefreshLogger::log(ss, latestMarketDataUpdates[market_data_update->symbol]); - LOG4CXX_INFO(logger, "MarketDataIncrementalRefresh : [" << ss.str() << "]"); - std::cout << "Update : " << ss.str() << std::endl; + while (_price_depth_publisher_queue_ptr->pop(market_data_update)) + { + latestMarketDataUpdates[market_data_update->symbol] = market_data_update->priceDepth; - } + std::stringstream ss; + MarketDataIncrementalRefreshLogger::log(ss, latestMarketDataUpdates[market_data_update->symbol]); + LOG4CXX_INFO(logger, "MarketDataIncrementalRefresh : [" << ss.str() << "]"); + } - DistributedATS_MarketDataIncrementalRefresh::MarketDataIncrementalRefresh chunkedIncrementalMarketDataRefresh; @@ -132,8 +123,6 @@ int PriceDepthPublisherService::service() chunkedIncrementalMarketDataRefresh, "MarketDataIncrementalRefresh"); - std::cout << "Publishing chunk of " << chunkedIncrementalMarketDataRefresh.c_NoMDEntries().size() << " updates" << std::endl; - std::stringstream ss; MarketDataIncrementalRefreshLogger::log( ss, chunkedIncrementalMarketDataRefresh); @@ -144,7 +133,6 @@ int PriceDepthPublisherService::service() if (ret != eprosima::fastdds::dds::RETCODE_OK) { LOG4CXX_ERROR(logger, "MarketDataIncrementalRefresh :" << ret); } - } } diff --git a/MatchingEngine/src/SecurityListDataReaderListenerImpl.cpp b/MatchingEngine/src/SecurityListDataReaderListenerImpl.cpp index 66f379e..95352fb 100644 --- a/MatchingEngine/src/SecurityListDataReaderListenerImpl.cpp +++ b/MatchingEngine/src/SecurityListDataReaderListenerImpl.cpp @@ -59,9 +59,7 @@ void SecurityListDataReaderListenerImpl::on_data_available( std::stringstream ss; SecurityListLogger::log(ss, security_list); LOG4CXX_INFO(logger, "SecurityList : [" << ss.str() << "]"); - - std::cout << "Security:" << ss.str() << std::endl; - + for (uint32_t sec_index = 0; sec_index < security_list.c_NoRelatedSym().size(); sec_index++) { std::string instrument = security_list.c_NoRelatedSym()[sec_index].Symbol(); diff --git a/MatchingEngine/src/SecurityListRequestDataWriterListener.h b/MatchingEngine/src/SecurityListRequestDataWriterListener.h index 9afbb0f..73d577e 100644 --- a/MatchingEngine/src/SecurityListRequestDataWriterListener.h +++ b/MatchingEngine/src/SecurityListRequestDataWriterListener.h @@ -27,7 +27,6 @@ class SecurityListRequestDataWriterListener : public eprosima::fastdds::dds::Dat if (info.current_count_change > 0) { matched_ = info.total_count; - //std::cout << "[Listener] Publisher Matched: " << matched_ << std::endl; // Start thread only once bool expected = false; @@ -36,7 +35,6 @@ class SecurityListRequestDataWriterListener : public eprosima::fastdds::dds::Dat std::thread([this, dwr]() { while (!_market_ptr->get_ready_to_trade()) { - //std::cout << "[Listener] Publishing Security Lise Exchange " << matched_ << std::endl; _market_ptr->publishSecurityListRequest(dwr); std::this_thread::sleep_for(std::chrono::seconds(1)); } @@ -46,11 +44,6 @@ class SecurityListRequestDataWriterListener : public eprosima::fastdds::dds::Dat else if (info.current_count_change == -1) { matched_ = info.total_count; - std::cout << "[Listener] Publisher UnMatched: " << matched_ << std::endl; - } - else - { - std::cout << "[Listener] Invalid current_count_change: " << info.current_count_change << std::endl; } } diff --git a/MiscATS/CryptoCLOB/README.md b/MiscATS/CryptoCLOB/README.md index 409895f..b7f35b2 100644 --- a/MiscATS/CryptoCLOB/README.md +++ b/MiscATS/CryptoCLOB/README.md @@ -23,8 +23,7 @@ The first matching engine consumes and processes orders from the instrument grou ### Starting ATS ``` - cd $DATS_HOME/MiscATS/CryptoCLOB/scipts - ./start_ats +BASEDIR_ATS=`pwd`/CryptoCLOB python3 start_ats.py --ats CryptoCLOB/crypto_ats.json ``` ## Test client diff --git a/MiscATS/MultiMatchingEngineATS/README.md b/MiscATS/MultiMatchingEngineATS/README.md index 183655d..a73d41c 100644 --- a/MiscATS/MultiMatchingEngineATS/README.md +++ b/MiscATS/MultiMatchingEngineATS/README.md @@ -24,8 +24,7 @@ The first matching engine consumes and processes orders from the instrument grou ### Starting ATS ``` - cd $DATS_HOME/MiscATS/MultiMatchingEngineATS/scipts - ./start_ats +BASEDIR_ATS=`pwd`/MultiMatchingEngineATS python3 start_ats.py --ats MultiMatchingEngineATS/multi_matching_engine.json ``` ## Test client diff --git a/MiscATS/USTreasuryCLOB/README.md b/MiscATS/USTreasuryCLOB/README.md index 32ffa96..d466bf0 100644 --- a/MiscATS/USTreasuryCLOB/README.md +++ b/MiscATS/USTreasuryCLOB/README.md @@ -25,8 +25,7 @@ The matching engine consumes and processes orders from the instrument group MARK ### Starting ATS ``` - cd $DATS_HOME/MiscATS/USTreasuryCLOB/scipts - ./start_ats + BASEDIR_ATS=`pwd`/USTreasuryCLOB python3 start_ats.py --ats USTreasuryCLOB/ust_ats.json ``` ## Test client diff --git a/cmake/DDSConfig.cmake b/cmake/DDSConfig.cmake index 92bafa3..0764dda 100644 --- a/cmake/DDSConfig.cmake +++ b/cmake/DDSConfig.cmake @@ -10,15 +10,15 @@ if(NOT EXISTS "${DDS_INCLUDE_DIRS}/fastdds/config.hpp") include(ExternalProject) + ExternalProject_Add(ASIO - GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git - GIT_TAG asio-1-28-0 - UPDATE_DISCONNECTED TRUE - SOURCE_SUBDIR asio - INSTALL_DIR ${DDS_INSTALL_PREFIX} - CONFIGURE_COMMAND cd / && ./autogen.sh && ./configure --prefix=${DDS_INSTALL_PREFIX} --exec-prefix=${DDS_INSTALL_PREFIX} --without-boost - BUILD_COMMAND cd / && make - INSTALL_COMMAND cd / && make install + GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git + GIT_TAG asio-1-28-0 + UPDATE_DISCONNECTED TRUE + SOURCE_SUBDIR asio + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory /asio/include ${DDS_INSTALL_PREFIX}/include ) ExternalProject_Add(FoonathanMemory