Merge remote-tracking branch 'origin/master' into SPARK-1944-attach/detach/update
This commit is contained in:
commit
f09607caaf
105 files changed
+5666
-455
No files matched your search
@@ -500,10 +500,11 @@ void ExchangeSimApplication::update_md(std::string const &sec_desc) {
|
||||
for (auto &t : new_trades)
|
||||
handle.add_trade(
|
||||
utils::TimeStamp::now(),
|
||||
md::PriceSize_from_double<7>(t.price.value() * price_factor,
|
||||
t.quantity.value()),
|
||||
md::PriceSize_from_double<ex_sim::precision>(t.price.value() * price_factor,t.quantity.value()),
|
||||
datetime::ll_now(),
|
||||
co2::AGGRESSOR_SIDE_NONE);
|
||||
t.bid_aggressor ? co2::AGGRESSOR_SIDE_BUY
|
||||
: ( t.ask_aggressor ? co2::AGGRESSOR_SIDE_SELL
|
||||
: co2::AGGRESSOR_SIDE_NONE) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,6 +558,42 @@ void ExchangeSimApplication::on_settlement(md::Security const& sec, md::IntPrice
|
||||
}
|
||||
}
|
||||
|
||||
void ExchangeSimApplication::on_high(md::Security const& sec, md::Price price) {
|
||||
auto sec_desc = get_sim_sec_desc(sec);
|
||||
auto iter = me->md_producer_handles.find(sec_desc);
|
||||
if (iter != me->md_producer_handles.end()) {
|
||||
auto &handle = iter->second;
|
||||
handle.update_session_high(utils::TimeStamp::now(), price);
|
||||
}
|
||||
}
|
||||
|
||||
void ExchangeSimApplication::on_low(md::Security const& sec, md::Price price) {
|
||||
auto sec_desc = get_sim_sec_desc(sec);
|
||||
auto iter = me->md_producer_handles.find(sec_desc);
|
||||
if (iter != me->md_producer_handles.end()) {
|
||||
auto &handle = iter->second;
|
||||
handle.update_session_low(utils::TimeStamp::now(), price);
|
||||
}
|
||||
}
|
||||
|
||||
void ExchangeSimApplication::on_open(md::Security const& sec, md::Price price) {
|
||||
auto sec_desc = get_sim_sec_desc(sec);
|
||||
auto iter = me->md_producer_handles.find(sec_desc);
|
||||
if (iter != me->md_producer_handles.end()) {
|
||||
auto &handle = iter->second;
|
||||
handle.update_opening(utils::TimeStamp::now(), price, datetime::today());
|
||||
}
|
||||
}
|
||||
|
||||
void ExchangeSimApplication::on_close(md::Security const& sec, md::Price price) {
|
||||
auto sec_desc = get_sim_sec_desc(sec);
|
||||
auto iter = me->md_producer_handles.find(sec_desc);
|
||||
if (iter != me->md_producer_handles.end()) {
|
||||
auto &handle = iter->second;
|
||||
handle.update_closing(utils::TimeStamp::now(), price, datetime::today());
|
||||
}
|
||||
}
|
||||
|
||||
void ExchangeSimApplication::on_depth(
|
||||
md::Security const &sec,
|
||||
md::PriceSize bids[md::COCONUT_MAX_DEPTH],
|
||||
|
||||
Reference in new issue
Block a user