Merge branch 'spartan_tas' of bitbucket.org:bluetradesys/spark into spartan_tas
This commit is contained in:
commit
5f454bcd6e
3 files changed
+233
-2
No files matched your search
+5
-2
@@ -321,9 +321,12 @@ MDP3Quantity FifoMergedSecurityMatcher::_fill(
|
||||
uint32_t fills_pos = effects->size();
|
||||
auto target_fill_qty = std::min(quantity, get_qty(dtop));
|
||||
// this is temp hack to ensure partial fills are appropriately created
|
||||
if (!implied_matching_status())
|
||||
auto fill_price = get_price(dtop);
|
||||
if (!implied_matching_status()) {
|
||||
target_fill_qty = quantity;
|
||||
auto rem = matcher()->fill(key, side, get_price(dtop), target_fill_qty, effects, true);
|
||||
fill_price = price;
|
||||
}
|
||||
auto rem = matcher()->fill(key, side, fill_price, target_fill_qty, effects, true);
|
||||
auto fill_qty = target_fill_qty - rem;
|
||||
quantity -= fill_qty;
|
||||
DIAG("filled ", fill_qty, ". Order now: ", ord_desc());
|
||||
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
#include "lib/orderman/orders/algo/IAlgoOrder.h"
|
||||
#include "lib/orderman/orders/algo/IAlgoServices.h"
|
||||
#include "AlgoServicesBridge.h"
|
||||
|
||||
using namespace bts::spartan::mdp3;
|
||||
using namespace bts::api;
|
||||
|
||||
namespace bts {
|
||||
namespace orderman {
|
||||
|
||||
struct AlgoServicesBridge::PImpl {
|
||||
std::vector<PositionUpdate> pos;
|
||||
PImpl(){
|
||||
}
|
||||
};
|
||||
|
||||
AlgoServicesBridge::AlgoServicesBridge(){
|
||||
}
|
||||
|
||||
Price AlgoServicesBridge::price() const{
|
||||
return Price(0);
|
||||
}
|
||||
|
||||
Quantity AlgoServicesBridge::quantity() const {
|
||||
return Quantity(0);
|
||||
}
|
||||
|
||||
Quantity AlgoServicesBridge::total_fills() const{
|
||||
return Quantity(0);
|
||||
}
|
||||
|
||||
bool AlgoServicesBridge::is_shutting_down() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<PositionUpdate> const& AlgoServicesBridge::current_positions() const {
|
||||
return me->pos;
|
||||
}
|
||||
|
||||
trace::CorID AlgoServicesBridge::get_correlation_id() const {
|
||||
trace::CorID cid;
|
||||
return cid;
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::subscribe_book(SecurityKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::unsubscribe_book(SecurityKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::subscribe_settlement(SecurityKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::unsubscribe_settlement(SecurityKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::subscribe_child_change(OrderKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::unsubscribe_child_change(OrderKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::subscribe_timer() {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::unsubscribe_timer() {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::subscribe_ticker(SecurityKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::unsubscribe_ticker(SecurityKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::subscribe_status(SecurityKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::unsubscribe_status(SecurityKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::subscribe_position() {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::unsubscribe_position() {
|
||||
}
|
||||
|
||||
OrderKey AlgoServicesBridge::launch_child(ChildTemplate &,
|
||||
Price, Quantity,
|
||||
bool) {
|
||||
OrderKey ok(0);
|
||||
return ok;
|
||||
}
|
||||
|
||||
OrderKey AlgoServicesBridge::launch_child(
|
||||
api::orderman::OrderDefinition const &,
|
||||
Price, Quantity,
|
||||
bool) {
|
||||
OrderKey ok(0);
|
||||
return ok;
|
||||
}
|
||||
|
||||
// Child order maintenance
|
||||
void AlgoServicesBridge::update_child(
|
||||
OrderKey,
|
||||
api::orderman::Update const &){
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::cancel_child(OrderKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::detach_child(OrderKey) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::detach_all_children() {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::cancel(const std::string&) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::terminate_error(const std::string&) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::complete() {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::set_ladder_visibility(bool) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::update_custom_state(const api::orderman::DynamicOrderState&) {
|
||||
}
|
||||
|
||||
void AlgoServicesBridge::update_fill_state(Quantity, Price) {
|
||||
}
|
||||
|
||||
} // namespace orderman
|
||||
} // namespace bts
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
#pragma once
|
||||
|
||||
#include "lib/orderman/orders/algo/IAlgoOrder.h"
|
||||
#include "lib/orderman/orders/algo/IAlgoServices.h"
|
||||
|
||||
namespace bts {namespace api {namespace orderman{class CustomOrderDefinition;}}}
|
||||
namespace bts {namespace spartan {namespace mdp3{class ISimServices;}}}
|
||||
|
||||
namespace bts {
|
||||
namespace orderman {
|
||||
|
||||
class ChildTemplate;
|
||||
class IBeforeLaunchAlgoServices;
|
||||
struct SniperPolygon;
|
||||
struct SecData;
|
||||
|
||||
class AlgoServicesBridge : public IAlgoServices{
|
||||
public:
|
||||
AlgoServicesBridge();
|
||||
~AlgoServicesBridge(){}
|
||||
|
||||
Price price() const override;
|
||||
|
||||
Quantity quantity() const override;
|
||||
|
||||
Quantity total_fills() const override;
|
||||
|
||||
bool is_shutting_down() const override;
|
||||
|
||||
std::vector<PositionUpdate> const& current_positions() const override;
|
||||
|
||||
trace::CorID get_correlation_id() const override;
|
||||
|
||||
void subscribe_book(SecurityKey) override;
|
||||
|
||||
void unsubscribe_book(SecurityKey) override;
|
||||
|
||||
void subscribe_settlement(SecurityKey) override;
|
||||
|
||||
void unsubscribe_settlement(SecurityKey) override;
|
||||
|
||||
void subscribe_child_change(OrderKey) override;
|
||||
|
||||
void unsubscribe_child_change(OrderKey) override;
|
||||
|
||||
void subscribe_timer() override;
|
||||
|
||||
void unsubscribe_timer() override;
|
||||
|
||||
void subscribe_ticker(SecurityKey) override;
|
||||
|
||||
void unsubscribe_ticker(SecurityKey) override;
|
||||
|
||||
void subscribe_status(SecurityKey) override;
|
||||
|
||||
void unsubscribe_status(SecurityKey) override;
|
||||
|
||||
void subscribe_position() override;
|
||||
|
||||
void unsubscribe_position() override;
|
||||
|
||||
OrderKey launch_child(ChildTemplate &, Price, Quantity,
|
||||
bool subscribe = true) override;
|
||||
|
||||
OrderKey launch_child(api::orderman::OrderDefinition const &, Price,
|
||||
Quantity, bool subscribe = true) override;
|
||||
|
||||
// Child order maintenance
|
||||
void update_child(OrderKey child, api::orderman::Update const &) override;
|
||||
void cancel_child(OrderKey child) override;
|
||||
void detach_child(OrderKey child) override;
|
||||
void detach_all_children() override;
|
||||
|
||||
void cancel(std::string const &msg = "") override;
|
||||
|
||||
void terminate_error(std::string const &msg) override;
|
||||
|
||||
void complete() override;
|
||||
|
||||
void set_ladder_visibility(bool is_visible) override;
|
||||
|
||||
void update_custom_state(api::orderman::DynamicOrderState const&) override;
|
||||
|
||||
void update_fill_state(Quantity total_fills, Price last_price) override;
|
||||
|
||||
private:
|
||||
struct PImpl;
|
||||
std::unique_ptr<PImpl> me;
|
||||
};
|
||||
|
||||
} // namespace orderman
|
||||
} // namespace bts
|
||||
Reference in new issue
Block a user