Skip to content

Commit cc9ac4d

Browse files
authored
Merge pull request #28 from mkipnis/misc_0925
general enhancements
2 parents b729450 + eb186d5 commit cc9ac4d

9 files changed

Lines changed: 25 additions & 54 deletions

File tree

MatchingEngine/src/Market.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,8 @@ void Market::on_depth_change(const DepthOrderBook *book,
442442
std::stringstream ss;
443443
MarketDataIncrementalRefreshLogger::log(ss, md_update->priceDepth);
444444
LOG4CXX_INFO(logger, "MarketDataIncrementalRefresh : [" << ss.str() << "]");
445-
std::cout << "Update : " << ss.str() << std::endl;
446445

447-
int market_data_index = MARKET_DATA_PRICE_DEPTH * 2; // bids and asks
446+
int market_data_index = MARKET_DATA_PRICE_DEPTH * 2; // bids and asks
448447

449448
auto current_stats = stats_ptr_->find(book->symbol());
450449

MatchingEngine/src/Order.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void Order::onRejected(const char *reason) {}
105105
void Order::onFilled(liquibook::book::Quantity fill_qty,
106106
liquibook::book::Cost fill_cost) {
107107
quantityOnMarket_ -= fill_qty;
108-
fillCost_ += fill_cost;
108+
fillCost_ += (fill_cost * fill_qty);
109109
quantityFilled_ += fill_qty;
110110

111111
std::stringstream msg;
@@ -243,10 +243,6 @@ void Order::populateExecutionReport(
243243
executionReport.TimeInForce(FIX::TimeInForce_DAY);
244244
}
245245

246-
247-
// std::cout << "Transact Time : " << ACE_OS::gettimeofday().msec() << ":" <<
248-
// executionReport.TransactTime << std::endl;
249-
250246
if (quantityFilled() > 0)
251247
executionReport.AvgPx(std::nearbyint(fillCost() / quantityFilled())); // round to the nearest tick
252248
else

MatchingEngine/src/PriceDepthPublisherService.cpp

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,21 @@ int PriceDepthPublisherService::service()
7373
//
7474
// Iterate through the queue and get the latest update
7575
//
76-
77-
/*std::cout << "Queue Size : "
78-
<< _price_depth_publisher_queue_ptr->size()
79-
<< std::endl;*/
80-
81-
std::shared_ptr<DistributedATS::MarketDataUpdate> market_data_update;
76+
std::shared_ptr<DistributedATS::MarketDataUpdate> market_data_update;
8277

83-
std::map<std::string,
84-
DistributedATS_MarketDataIncrementalRefresh::MarketDataIncrementalRefresh>
85-
latestMarketDataUpdates;
78+
std::map<std::string,
79+
DistributedATS_MarketDataIncrementalRefresh::MarketDataIncrementalRefresh>
80+
latestMarketDataUpdates;
8681

87-
88-
while (_price_depth_publisher_queue_ptr->pop(market_data_update))
89-
{
90-
latestMarketDataUpdates[market_data_update->symbol] = market_data_update->priceDepth;
91-
92-
std::stringstream ss;
93-
MarketDataIncrementalRefreshLogger::log(ss, latestMarketDataUpdates[market_data_update->symbol]);
94-
LOG4CXX_INFO(logger, "MarketDataIncrementalRefresh : [" << ss.str() << "]");
95-
std::cout << "Update : " << ss.str() << std::endl;
82+
while (_price_depth_publisher_queue_ptr->pop(market_data_update))
83+
{
84+
latestMarketDataUpdates[market_data_update->symbol] = market_data_update->priceDepth;
9685

97-
}
86+
std::stringstream ss;
87+
MarketDataIncrementalRefreshLogger::log(ss, latestMarketDataUpdates[market_data_update->symbol]);
88+
LOG4CXX_INFO(logger, "MarketDataIncrementalRefresh : [" << ss.str() << "]");
89+
}
9890

99-
10091
DistributedATS_MarketDataIncrementalRefresh::MarketDataIncrementalRefresh
10192
chunkedIncrementalMarketDataRefresh;
10293

@@ -132,8 +123,6 @@ int PriceDepthPublisherService::service()
132123
chunkedIncrementalMarketDataRefresh,
133124
"MarketDataIncrementalRefresh");
134125

135-
std::cout << "Publishing chunk of " << chunkedIncrementalMarketDataRefresh.c_NoMDEntries().size() << " updates" << std::endl;
136-
137126
std::stringstream ss;
138127
MarketDataIncrementalRefreshLogger::log(
139128
ss, chunkedIncrementalMarketDataRefresh);
@@ -144,7 +133,6 @@ int PriceDepthPublisherService::service()
144133
if (ret != eprosima::fastdds::dds::RETCODE_OK) {
145134
LOG4CXX_ERROR(logger, "MarketDataIncrementalRefresh :" << ret);
146135
}
147-
148136
}
149137
}
150138

MatchingEngine/src/SecurityListDataReaderListenerImpl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ void SecurityListDataReaderListenerImpl::on_data_available(
5959
std::stringstream ss;
6060
SecurityListLogger::log(ss, security_list);
6161
LOG4CXX_INFO(logger, "SecurityList : [" << ss.str() << "]");
62-
63-
std::cout << "Security:" << ss.str() << std::endl;
64-
62+
6563
for (uint32_t sec_index = 0; sec_index < security_list.c_NoRelatedSym().size(); sec_index++)
6664
{
6765
std::string instrument = security_list.c_NoRelatedSym()[sec_index].Symbol();

MatchingEngine/src/SecurityListRequestDataWriterListener.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class SecurityListRequestDataWriterListener : public eprosima::fastdds::dds::Dat
2727
if (info.current_count_change > 0)
2828
{
2929
matched_ = info.total_count;
30-
//std::cout << "[Listener] Publisher Matched: " << matched_ << std::endl;
3130

3231
// Start thread only once
3332
bool expected = false;
@@ -36,7 +35,6 @@ class SecurityListRequestDataWriterListener : public eprosima::fastdds::dds::Dat
3635
std::thread([this, dwr]() {
3736
while (!_market_ptr->get_ready_to_trade())
3837
{
39-
//std::cout << "[Listener] Publishing Security Lise Exchange " << matched_ << std::endl;
4038
_market_ptr->publishSecurityListRequest(dwr);
4139
std::this_thread::sleep_for(std::chrono::seconds(1));
4240
}
@@ -46,11 +44,6 @@ class SecurityListRequestDataWriterListener : public eprosima::fastdds::dds::Dat
4644
else if (info.current_count_change == -1)
4745
{
4846
matched_ = info.total_count;
49-
std::cout << "[Listener] Publisher UnMatched: " << matched_ << std::endl;
50-
}
51-
else
52-
{
53-
std::cout << "[Listener] Invalid current_count_change: " << info.current_count_change << std::endl;
5447
}
5548
}
5649

MiscATS/CryptoCLOB/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ The first matching engine consumes and processes orders from the instrument grou
2323
### Starting ATS
2424

2525
```
26-
cd $DATS_HOME/MiscATS/CryptoCLOB/scipts
27-
./start_ats
26+
BASEDIR_ATS=`pwd`/CryptoCLOB python3 start_ats.py --ats CryptoCLOB/crypto_ats.json
2827
```
2928

3029
## Test client

MiscATS/MultiMatchingEngineATS/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ The first matching engine consumes and processes orders from the instrument grou
2424
### Starting ATS
2525
2626
```
27-
cd $DATS_HOME/MiscATS/MultiMatchingEngineATS/scipts
28-
./start_ats
27+
BASEDIR_ATS=`pwd`/MultiMatchingEngineATS python3 start_ats.py --ats MultiMatchingEngineATS/multi_matching_engine.json
2928
```
3029
3130
## Test client

MiscATS/USTreasuryCLOB/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ The matching engine consumes and processes orders from the instrument group MARK
2525
### Starting ATS
2626

2727
```
28-
cd $DATS_HOME/MiscATS/USTreasuryCLOB/scipts
29-
./start_ats
28+
BASEDIR_ATS=`pwd`/USTreasuryCLOB python3 start_ats.py --ats USTreasuryCLOB/ust_ats.json
3029
```
3130

3231
## Test client

cmake/DDSConfig.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ if(NOT EXISTS "${DDS_INCLUDE_DIRS}/fastdds/config.hpp")
1010

1111
include(ExternalProject)
1212

13+
1314
ExternalProject_Add(ASIO
14-
GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git
15-
GIT_TAG asio-1-28-0
16-
UPDATE_DISCONNECTED TRUE
17-
SOURCE_SUBDIR asio
18-
INSTALL_DIR ${DDS_INSTALL_PREFIX}
19-
CONFIGURE_COMMAND cd <SOURCE_DIR>/<SOURCE_SUBDIR> && ./autogen.sh && ./configure --prefix=${DDS_INSTALL_PREFIX} --exec-prefix=${DDS_INSTALL_PREFIX} --without-boost
20-
BUILD_COMMAND cd <SOURCE_DIR>/<SOURCE_SUBDIR> && make
21-
INSTALL_COMMAND cd <SOURCE_DIR>/<SOURCE_SUBDIR> && make install
15+
GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git
16+
GIT_TAG asio-1-28-0
17+
UPDATE_DISCONNECTED TRUE
18+
SOURCE_SUBDIR asio
19+
CONFIGURE_COMMAND ""
20+
BUILD_COMMAND ""
21+
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/asio/include ${DDS_INSTALL_PREFIX}/include
2222
)
2323

2424
ExternalProject_Add(FoonathanMemory

0 commit comments

Comments
 (0)