Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3dbfca8304 | ||
|
|
661e224fd5 |
No files matched your search
+8
@@ -0,0 +1,8 @@
|
||||
#include "SpreaderWrapper.h"
|
||||
|
||||
namespace bts::integration {
|
||||
SpreaderWrapper::SpreaderWrapper(
|
||||
const bts::api::SyntheticContract &, IOrderGateway &) {}
|
||||
void SpreaderWrapper::on_order_update(const OrderUpdate &) {}
|
||||
void SpreaderWrapper::update_book(const bts::orderman::Book &) {}
|
||||
} // namespace bts::integration
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
|
||||
#include "lib/api/services/OrderService.pb.h"
|
||||
#include "lib/domain_model/Security.pb.h"
|
||||
#include "lib/domain_model/common.h"
|
||||
#include "lib/mercury/events/TimerEvent.h"
|
||||
#include "lib/orderman/events/BookUpdateEvent.h"
|
||||
#include "lib/orderman/events/OrderStateUpdateEvent.h"
|
||||
#include "lib/orderman/orderman_utils/Book.h"
|
||||
#include "lib/orderman/orderman_utils/orderman_common.h"
|
||||
#include "lib/orderman/orders/Order.h"
|
||||
#include "lib/orderman/orders/spreader_orders/spreader/ISpreaderManager.h"
|
||||
#include "lib/orderman/orders/spreader_orders/spreader/SpreaderBookkeepingData.h"
|
||||
#include "lib/orderman/orders/spreader_orders/spreader/SpreaderCacheWarmingState.h"
|
||||
#include "lib/orderman/orders/spreader_orders/spreader_states/SpreaderEndStateWorker.h"
|
||||
#include "lib/orderman/orders/spreader_orders/spreader_states/SpreaderStartStateWorker.h"
|
||||
#include "lib/orderman/orders/spreader_orders/spreader_states/SpreaderState.h"
|
||||
#include "lib/orderman/orders/spreader_orders/spreader_states/SpreaderWaitingForCancelAllStateWorker.h"
|
||||
#include "lib/orderman/orders/spreader_orders/spreader_states/SpreaderWaitingForInitialDataStateWorker.h"
|
||||
#include "lib/orderman/orders/spreader_orders/spreader_states/SpreaderWorkingStateWorker.h"
|
||||
#include "lib/sparkproto/SparkProtos.pb.h"
|
||||
#include "lib/utils/bts_chrono.h"
|
||||
#include "lib/utils/is_unittest_environment.h"
|
||||
#include <memory>
|
||||
|
||||
namespace bts::integration {
|
||||
|
||||
// needs to be implemented by 3rd party
|
||||
class IOrderGateway {
|
||||
virtual bts::orderman::OrderKey send_order(
|
||||
const bts::api::orderman::OrderDefinition &order_def) = 0;
|
||||
};
|
||||
|
||||
struct OrderUpdate;
|
||||
class IOrderSync {
|
||||
virtual void on_order_update(const OrderUpdate &update) = 0;
|
||||
};
|
||||
|
||||
struct OrderUpdate {
|
||||
bts::orderman::OrderKey key;
|
||||
api::orderman::OrderStatus status;
|
||||
double price;
|
||||
uint32_t quantity;
|
||||
uint32_t filled_quantity;
|
||||
double avg_price;
|
||||
};
|
||||
|
||||
class SpreaderWrapper : public IOrderSync {
|
||||
public:
|
||||
SpreaderWrapper(
|
||||
const bts::api::SyntheticContract &synthetic_contract,
|
||||
IOrderGateway &order_gateway);
|
||||
void on_order_update(const OrderUpdate &update) override;
|
||||
void update_book(const bts::orderman::Book &book);
|
||||
void update_spreader(Price price, Quantity qty);
|
||||
};
|
||||
} // namespace bts::integration
|
||||
@@ -92,6 +92,8 @@ bts::co2::TradingStatus convert_trading_status(
|
||||
return bts::co2::TradingStatus::TRADINGSTATUS_NORMAL;
|
||||
case emumba::market_data::security_state::state::preopen:
|
||||
return bts::co2::TradingStatus::TRADINGSTATUS_PRE_OPEN;
|
||||
case emumba::market_data::security_state::state::closed:
|
||||
return bts::co2::TradingStatus::TRADINGSTATUS_CLOSED;
|
||||
}
|
||||
bts_assert(false);
|
||||
return bts::co2::TradingStatus::TRADINGSTATUS_UNKNOWN;
|
||||
|
||||
Reference in new issue
Block a user