Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
109fee099f | ||
|
|
747b44c48d | ||
|
|
4b091a1259 | ||
|
|
7c0e310f6a | ||
|
|
f7309c389e | ||
|
|
df1dbd76b5 | ||
|
|
deaf8b6ad5 | ||
|
|
5e0edd00f4 | ||
|
|
f25a667ff0 | ||
|
|
4f3eaa8b9c | ||
|
|
5098767363 | ||
|
|
4d52de3f09 | ||
|
|
9864d18a60 | ||
|
|
2aaa3258a0 | ||
|
|
6e98e11c9e | ||
|
|
fa4d50b643 | ||
|
|
1590c6d6f6 | ||
|
|
224d0689b0 | ||
|
|
c69fa3a410 | ||
|
|
14307f9fd8 | ||
|
|
819a984ccd | ||
|
|
d76b04b752 | ||
|
|
4904763811 | ||
|
|
073294adac | ||
|
|
753bb1b493 | ||
|
|
8891e89c70 | ||
|
|
d3305b7990 |
No files matched your search
@@ -4,6 +4,20 @@ weight = 3
|
||||
sort_by = "weight"
|
||||
insert_anchor_links = "right"
|
||||
+++
|
||||
## 1.5.5
|
||||
- Fixed Market View 'stale working orders' bug
|
||||
|
||||
## 1.5.4
|
||||
- Avoided logging when warming up cache
|
||||
|
||||
## 1.5.3
|
||||
- Fixed sounds startup issue
|
||||
|
||||
## 1.5.2
|
||||
- Added better logging to AlgoDefinitionService
|
||||
|
||||
## 1.5.1
|
||||
- Fixed missing securities in the Fills and P&L windows.
|
||||
|
||||
## 1.5.0
|
||||
### User Visible Changes
|
||||
@@ -21,7 +35,7 @@ insert_anchor_links = "right"
|
||||
- The escape key now closes the floating order book
|
||||
#### Bug Fixes
|
||||
- Fixed the "Since Open" time filter to use the exchange open time rather than 8:30 AM
|
||||
- Fixed a bug in the order book where sometimes parent orders whould not update their last message column.
|
||||
- Fixed a bug in the order book where sometimes parent orders would not update their last message column.
|
||||
|
||||
#### Algos
|
||||
- Added OCO Algo
|
||||
|
||||
+1
-1
Submodule docker/linux updated: 8d82558f90...ce08a5129f.
@@ -25,20 +25,28 @@ namespace bts.shell {
|
||||
}
|
||||
|
||||
static class NotificationServiceExtensions {
|
||||
/// TODO: remove this extension and force callers to use the appropriate 'link' method in <see cref="INotificationService"/> (it is smelly, and is NOT ACTUALLY STRONGLY TYPED)
|
||||
public static IDisposable link<T>(this INotificationService notification_service, IPredicate<T> predicate, SoundNotification sound) {
|
||||
if (predicate is IPredicate<OrderTuple> orp)
|
||||
return notification_service.link_to_order(orp, sound);
|
||||
if (predicate is IPredicate<OrderSecurity> osp) {
|
||||
// Note: watch out for implicit types as generic type arguments (although OrderSecurity can be implicitly cast to OrderTuple, IPredicate<OrderSecurity> CANNOT be implicitly cast to IPredicate<OrderTuple>)
|
||||
return notification_service.link_to_order(PredicateBuilder.create<OrderTuple>(ot => osp.trigger(new OrderSecurity(ot.Item1, ot.Item2))), sound);
|
||||
}
|
||||
if (predicate is IPredicate<Activity> ap)
|
||||
return notification_service.link_to_activity(ap, sound);
|
||||
throw new ArgumentException(nameof(predicate));
|
||||
Log.Ui.error($"Unable to activate sound-trigger (unrecognized predicate type '{typeof(T)}').");
|
||||
return Disposable.empty;
|
||||
}
|
||||
|
||||
/// TODO: remove this extension and force callers to use the appropriate 'link' method in <see cref="INotificationService"/> (it is smelly, and is NOT ACTUALLY STRONGLY TYPED)
|
||||
public static IDisposable link<T>(this INotificationService notification_service, INotificationPredicate<T> toast_notification_predicate) {
|
||||
if (toast_notification_predicate is INotificationPredicate<OrderTuple> orp)
|
||||
return notification_service.link_to_order(orp);
|
||||
if (toast_notification_predicate is INotificationPredicate<Activity> ap)
|
||||
return notification_service.link_to_activity(ap);
|
||||
throw new ArgumentException(nameof(toast_notification_predicate));
|
||||
Log.Ui.error($"Unable to activate toast-notification-trigger (unrecognized predicate type '{typeof(T)}').");
|
||||
return Disposable.empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ namespace mbts.spark {
|
||||
public readonly AlgoData? algo;
|
||||
public readonly AlgoDefinitionMetadata? algo_meta;
|
||||
|
||||
public FillTuple(FillImmutable fill, OrderSecurityAlgoMeta? order_tuple) {
|
||||
this.fill = fill;
|
||||
public FillTuple((SecurityImmutable? sec, FillImmutable val) fill, OrderSecurityAlgoMeta? order_tuple) {
|
||||
this.fill = fill.val;
|
||||
this.security = fill.sec;
|
||||
if (order_tuple is OrderSecurityAlgoMeta osam) {
|
||||
order = osam.order;
|
||||
security = osam.security;
|
||||
algo = osam.algo;
|
||||
algo_meta = osam.meta;
|
||||
}
|
||||
|
||||
@@ -91,12 +91,13 @@ namespace mbts.spark {
|
||||
_service.subscribei_fills()
|
||||
.Naggle(interval, scheduler)
|
||||
.PermissionFilter(admin_model.on_admin_data)
|
||||
.join(sstore, f => f.SecurityKey)
|
||||
.Table().Cache();
|
||||
var fill_order_tuples_join = on_fills.LeftJoin(
|
||||
on_order_tuples,
|
||||
f => f.FillKey,
|
||||
f => f.val.FillKey,
|
||||
o => o.order.Key,
|
||||
f => f.OrderKey,
|
||||
f => f.val.OrderKey,
|
||||
(f, fk, o, ok) => new FillTuple(f, o),
|
||||
(f, fk, ok) => new FillTuple(f, null),
|
||||
f => f.fill.FillKey);
|
||||
@@ -284,7 +285,7 @@ namespace mbts.spark {
|
||||
// DO NOT REMOVE (END)
|
||||
|
||||
public static IObservable<ITableUpdateTransform<OrderRecordImmutable, uint>> on_security_root_orders(this OrdersModel orders_model, uint security_key) =>
|
||||
orders_model.on_security_orders(security_key).Scan(new RootOrderData(), (rod, table) => {
|
||||
orders_model.on_security_orders(security_key).AddRemoveOnly().Scan(new RootOrderData(), (rod, table) => {
|
||||
// ** using HashSet/List pairs, rather than a Dictionary, because TableUpdateTransform calls for IReadOnlyLists, while Dictionary.Values only implements IReadOnlyCollection.
|
||||
// (this way, we avoid copying both added/removed Dictionary.Values to new Lists at the end, see comment at bottom of method if this is unclear) **
|
||||
var added_root_keys = new HashSet<uint>();
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace bts {
|
||||
// The following are not implemented. If you need them get to work.
|
||||
HasOption("path", "Path inside the row to use for display. Ex: 'Id' or 'Name' ", ignore);
|
||||
HasOption("all", "Invlude 'all' rows on every print", _ => _all = true);
|
||||
HasAdditionalArguments(null, " [nothing]");
|
||||
}
|
||||
public override int Run(string[] remainingArguments) {
|
||||
var arg = this.get_argument("method");
|
||||
|
||||
@@ -1 +1 @@
|
||||
set(sources api/apicore.proto;api/apigateway.proto;api/apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/services/AdminService.proto;api/services/ApiUnitTestService.proto;api/services/AuthService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/jetfix.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/jetfix.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/perflog_cfg.proto;config/protos/quickbus_cfg.proto;config/protos/spreader.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MDClient.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityCache.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SecurityOracle.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/protos/co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/md2_tests.cpp;md/test/synthetic_book_merge_tests.cpp;os/os.cpp;os/tests/os_tests.cpp;quickbus/core/LocalNode.cpp;quickbus/core/Quickbus.cpp;quickbus/core/SubscriptionID.cpp;quickbus/core/TableID.cpp;quickbus/message_model/Update.cpp;quickbus/message_model/merge_updates.cpp;quickbus/network/QBConnection.cpp;quickbus/network/QBConnectionManager.cpp;quickbus/network/endpoint_description.cpp;quickbus/network/quickbus_msgs.proto;quickbus/pubsub/TablePublisher.cpp;quickbus/pubsub/TableSubscriber.cpp;quickbus/pubsub/tests/qb_pubsub_tests.cpp;quickbus/routing/INode.cpp;quickbus/routing/NodeID.cpp;quickbus/routing/Router.cpp;quickbus/rpc/RPCClient.cpp;quickbus/rpc/RPCServer.cpp;quickbus/rpc/RPCSessionID.cpp;quickbus/rpc/rpc_utils.cpp;quickbus/rpc/tests/qb_rpc_tests.cpp;quickbus/tests/quickbus_tests.cpp;sparkproto/SparkProtos.proto;testing/catch_test_runner.cpp;utils/AuthToken.cpp;utils/Dispatcher.cpp;utils/GrowableSPSCQueue.cpp;utils/HTTPStream.cpp;utils/PBUtils.cpp;utils/Puid.cpp;utils/SecureLogon.cpp;utils/SharedMemory.cpp;utils/Sqlite_utils.cpp;utils/Uuid.cpp;utils/datetime.cpp;utils/download.cpp;utils/file_utils.cpp;utils/init_spark_lib.cpp;utils/is_unittest_environment.cpp;utils/stats.cpp;utils/tests/AuthTokenTests.cpp;utils/thread_manager.cpp)
|
||||
set(sources api/apicore.proto;api/apigateway.proto;api/apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/service_helpers/AlgoServiceUtils.cpp;api/services/AdminService.proto;api/services/AlgoDefinitionService.proto;api/services/AlgoService.proto;api/services/ApiUnitTestService.proto;api/services/AuthService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/jetfix.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/jetfix.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/perflog_cfg.proto;config/protos/quickbus_cfg.proto;config/protos/spreader.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MDClient.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityCache.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SecurityOracle.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/protos/co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/md2_tests.cpp;md/test/synthetic_book_merge_tests.cpp;os/os.cpp;os/tests/os_tests.cpp;quickbus/core/LocalNode.cpp;quickbus/core/Quickbus.cpp;quickbus/core/SubscriptionID.cpp;quickbus/core/TableID.cpp;quickbus/message_model/Update.cpp;quickbus/message_model/merge_updates.cpp;quickbus/network/QBConnection.cpp;quickbus/network/QBConnectionManager.cpp;quickbus/network/endpoint_description.cpp;quickbus/network/quickbus_msgs.proto;quickbus/pubsub/TablePublisher.cpp;quickbus/pubsub/TableSubscriber.cpp;quickbus/pubsub/tests/qb_pubsub_tests.cpp;quickbus/routing/INode.cpp;quickbus/routing/NodeID.cpp;quickbus/routing/Router.cpp;quickbus/rpc/RPCClient.cpp;quickbus/rpc/RPCServer.cpp;quickbus/rpc/RPCSessionID.cpp;quickbus/rpc/rpc_utils.cpp;quickbus/rpc/tests/qb_rpc_tests.cpp;quickbus/tests/quickbus_tests.cpp;sparkproto/SparkProtos.proto;testing/catch_test_runner.cpp;utils/AuthToken.cpp;utils/Dispatcher.cpp;utils/GrowableSPSCQueue.cpp;utils/HTTPStream.cpp;utils/PBUtils.cpp;utils/Puid.cpp;utils/SecureLogon.cpp;utils/SharedMemory.cpp;utils/Sqlite_utils.cpp;utils/Uuid.cpp;utils/datetime.cpp;utils/download.cpp;utils/file_utils.cpp;utils/init_spark_lib.cpp;utils/is_unittest_environment.cpp;utils/stats.cpp;utils/tests/AuthTokenTests.cpp;utils/thread_manager.cpp)
|
||||
@@ -110,6 +110,7 @@ void LoggerHub::do_work() {
|
||||
std::this_thread::sleep_for(10ms);
|
||||
}
|
||||
|
||||
auto start = Timer::now();
|
||||
for (;;) {
|
||||
auto all_shutdown = false;
|
||||
{
|
||||
@@ -117,7 +118,7 @@ void LoggerHub::do_work() {
|
||||
consume_log_recs();
|
||||
all_shutdown = me->loggers.empty();
|
||||
}
|
||||
if (all_shutdown)
|
||||
if (all_shutdown || std::abs(sec_diff(start, Timer::now())) > 2)
|
||||
return;
|
||||
else
|
||||
std::this_thread::yield();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "NativeOrder.h"
|
||||
|
||||
#include "lib/api/services/OrderService.pb.h"
|
||||
#include "lib/domain_model/Security.h"
|
||||
#include "lib/jetfix/codec/FIXFragment.h"
|
||||
#include "lib/jetfix/codec/FieldDefinitions.h"
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/domain_model/Security.h"
|
||||
#include "lib/orderman/order_factory/IOrderFactory.h"
|
||||
#include "lib/orderman/order_router/OrderRouter.h"
|
||||
#include "lib/orderman/orderman_utils/ExecutionReport.h"
|
||||
@@ -276,7 +276,8 @@ void NativeOrder::on_init_from_exe_report(
|
||||
|
||||
NativeOrder::~NativeOrder() {}
|
||||
|
||||
bool NativeOrder::_on_activate(Price p, Quantity q,
|
||||
bool NativeOrder::_on_activate(log::Level reject_level,
|
||||
log::Level transition_level, Price p, Quantity q,
|
||||
bts::orderman::OrderServices &services,
|
||||
trace::CorID const &trace) {
|
||||
auto scoped_log =
|
||||
@@ -295,11 +296,12 @@ bool NativeOrder::_on_activate(Price p, Quantity q,
|
||||
|
||||
// is our gateway connected?
|
||||
if (!me->services->is_gateway_connected(*me->session_services)) {
|
||||
LOG(OrderMan, Warn,
|
||||
LOG(OrderMan, reject_level,
|
||||
"Attempt to send order to a disconnected gateway. "
|
||||
"Dropping order {}",
|
||||
key().value());
|
||||
transition(ORDER_STATUS_REJECTED_BY_SPARK, "Exchange gateway is down");
|
||||
transition(transition_level, ORDER_STATUS_REJECTED_BY_SPARK,
|
||||
"Exchange gateway is down");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -308,13 +310,13 @@ bool NativeOrder::_on_activate(Price p, Quantity q,
|
||||
UserID(me->definition.user_id()),
|
||||
AccountID(me->definition.account_id()));
|
||||
if (!lqr.ok) {
|
||||
LOG(OrderMan, Warn,
|
||||
LOG(OrderMan, reject_level,
|
||||
"Unauthorized order attempted. User: {} on "
|
||||
"Account: {}. Msg: {} Order: {}. Dropping order",
|
||||
me->definition.user(), me->definition.account(), lqr.error_msg,
|
||||
key().value());
|
||||
|
||||
transition(ORDER_STATUS_REJECTED_BY_SPARK,
|
||||
transition(transition_level, ORDER_STATUS_REJECTED_BY_SPARK,
|
||||
fmt::format("Unauthorized order: {}", lqr.error_msg));
|
||||
return false;
|
||||
}
|
||||
@@ -325,24 +327,24 @@ bool NativeOrder::_on_activate(Price p, Quantity q,
|
||||
q);
|
||||
|
||||
if (!lqr.ok) {
|
||||
LOG(OrderMan, Warn,
|
||||
LOG(OrderMan, reject_level,
|
||||
"New order would breach limit. User: {} Account: "
|
||||
"{} Msg: {} Order: {}. Dropping order",
|
||||
me->definition.user(), me->definition.account(), lqr.error_msg,
|
||||
key().value());
|
||||
|
||||
transition(ORDER_STATUS_REJECTED_BY_SPARK,
|
||||
transition(transition_level, ORDER_STATUS_REJECTED_BY_SPARK,
|
||||
fmt::format("Order would breach limit: {}", lqr.error_msg));
|
||||
return false;
|
||||
}
|
||||
|
||||
// are we under the messaging threshold?
|
||||
if (!me->services->governor(*me->session_services).can_send()) {
|
||||
LOG(OrderMan, Warn,
|
||||
LOG(OrderMan, reject_level,
|
||||
"New order would cause breach of messaging "
|
||||
"limits. Dropping order {}",
|
||||
key().value());
|
||||
transition(ORDER_STATUS_REJECTED_BY_SPARK,
|
||||
transition(transition_level, ORDER_STATUS_REJECTED_BY_SPARK,
|
||||
"Messaging threshold breached");
|
||||
return false;
|
||||
}
|
||||
@@ -391,7 +393,7 @@ void NativeOrder::warm_up_activate(OrderServicesData &data,
|
||||
bts_assert(!me->services);
|
||||
me->services = &services;
|
||||
init_order_services(data, services);
|
||||
_on_activate(Price(0), Quantity(0), services, trace::CorID{});
|
||||
_on_activate(NoLog, NoLog, Price(0), Quantity(0), services, trace::CorID{});
|
||||
|
||||
me->services->unsubscribe_from_exe_report(*me->session_services,
|
||||
me->exe_report_sid);
|
||||
@@ -411,7 +413,7 @@ void NativeOrder::on_activate(Price p, Quantity q,
|
||||
|
||||
case ORDER_STATUS_INACTIVE:
|
||||
// this is a brand new order
|
||||
if (_on_activate(p, q, services, trace)) {
|
||||
if (_on_activate(Warn, Info, p, q, services, trace)) {
|
||||
me->services->queue_fix(*me->session_services,
|
||||
jetfix::MessageTypes::NewOrderSingle,
|
||||
me->create_encoding, trace);
|
||||
@@ -1044,20 +1046,28 @@ bool NativeOrder::has_exchange_order_id() {
|
||||
return get_native_state(me->state).exchange_order_id().size();
|
||||
}
|
||||
|
||||
void NativeOrder::transition(api::orderman::OrderStatus new_status,
|
||||
void NativeOrder::transition(log::Level level,
|
||||
api::orderman::OrderStatus new_status,
|
||||
std::string const &msg) {
|
||||
auto const &from = OrderStatus_Name(me->state.status());
|
||||
auto const &to = OrderStatus_Name(new_status);
|
||||
LOG(OrderMan, Info, "Transitioning order {} from {} to {}. Msg: {}",
|
||||
key().value(), from, to, msg);
|
||||
if (me->state.status() != new_status) {
|
||||
LOG(OrderMan, level, "Transitioning order {} from {} to {}. Msg: {}",
|
||||
key().value(), from, to, msg);
|
||||
}
|
||||
me->state.set_status(new_status);
|
||||
me->state.set_last_msg(msg);
|
||||
}
|
||||
|
||||
void NativeOrder::transition(api::orderman::OrderStatus new_status,
|
||||
std::string const &msg) {
|
||||
transition(Info, new_status, msg);
|
||||
}
|
||||
|
||||
void NativeOrder::transition(api::orderman::OrderStatus new_status) {
|
||||
auto const &from = OrderStatus_Name(me->state.status());
|
||||
auto const &to = OrderStatus_Name(new_status);
|
||||
if (from != to)
|
||||
if (me->state.status() != new_status)
|
||||
LOG(OrderMan, Info, "Transitioning order {} from {} to {}", key().value(),
|
||||
from, to);
|
||||
else
|
||||
|
||||
@@ -32,14 +32,15 @@ class NativeOrder : public Order {
|
||||
void on_init_from_exe_report(ExecutionReport const &,
|
||||
const PreActivationOrderServices &);
|
||||
|
||||
protected:
|
||||
void warm_up_activate(OrderServicesData &,OrderServices&) override;
|
||||
|
||||
protected:
|
||||
void warm_up_activate(OrderServicesData &, OrderServices &) override;
|
||||
|
||||
private:
|
||||
struct PImpl;
|
||||
std::unique_ptr<PImpl> me;
|
||||
|
||||
bool _on_activate(Price, Quantity, bts::orderman::OrderServices &,
|
||||
bool _on_activate(log::Level reject_level, log::Level transition_level,
|
||||
Price, Quantity, bts::orderman::OrderServices &,
|
||||
trace::CorID const &);
|
||||
void on_exe_report(const NewExecutionReportEvent &);
|
||||
void on_cancel_reject(const CancelRejectEvent &);
|
||||
@@ -49,6 +50,8 @@ protected:
|
||||
void init_fix();
|
||||
void add_exchange_order_id_to_fix();
|
||||
|
||||
void transition(log::Level level, api::orderman::OrderStatus new_state,
|
||||
std::string const &msg);
|
||||
void transition(api::orderman::OrderStatus new_state,
|
||||
std::string const &msg);
|
||||
void transition(api::orderman::OrderStatus new_state);
|
||||
|
||||
@@ -26,9 +26,19 @@ AlgoDefinitionServiceServer::AlgoDefinitionServiceServer(ServiceContext& context
|
||||
}
|
||||
AlgoDefinitionServiceServer::~AlgoDefinitionServiceServer() { }
|
||||
|
||||
struct Trace {
|
||||
Trace(std::string const &msg) : msg(msg) {LOG(Gen, Info, "begin {}",msg);}
|
||||
~Trace() {LOG(Gen, Info, "end {}",msg);}
|
||||
std::string msg;
|
||||
};
|
||||
|
||||
void AlgoDefinitionServiceServer::save_algo_definition(
|
||||
const UpdateRequest& request,
|
||||
const APIResponse<UpdateResponse>& response) {
|
||||
|
||||
Trace t(fmt::format("{} {}", __PRETTY_FUNCTION__,
|
||||
utils::pb::to_string(request)));
|
||||
|
||||
UpdateResponse response_data;
|
||||
response_data.set_success(false);
|
||||
stringstream error;
|
||||
@@ -71,6 +81,10 @@ void AlgoDefinitionServiceServer::save_algo_definition(
|
||||
|
||||
void AlgoDefinitionServiceServer::remove_algo_definition(
|
||||
const RemoveRequest& request, const APIResponse<RemoveResponse>& response) {
|
||||
|
||||
Trace t(fmt::format("{} {}", __PRETTY_FUNCTION__,
|
||||
utils::pb::to_string(request)));
|
||||
|
||||
RemoveResponse response_data;
|
||||
response_data.set_success(false);
|
||||
const Row* row = _find_row(request.key());
|
||||
@@ -96,9 +110,12 @@ void AlgoDefinitionServiceServer::remove_algo_definition(
|
||||
#endif
|
||||
}
|
||||
response(response_data);
|
||||
|
||||
LOG(Gen, Info, "AlgoServiceServer.remove_algo_definition end");
|
||||
}
|
||||
|
||||
const Row* AlgoDefinitionServiceServer::_find_row(const uint32_t key) {
|
||||
Trace t(fmt::format("{} {}", __PRETTY_FUNCTION__,key));
|
||||
const auto& table = me->publisher.state_data();
|
||||
const auto it = table.find(key);
|
||||
if (it != table.end())
|
||||
@@ -107,7 +124,9 @@ const Row* AlgoDefinitionServiceServer::_find_row(const uint32_t key) {
|
||||
}
|
||||
|
||||
uint32_t AlgoDefinitionServiceServer::_get_unused_key() {
|
||||
auto table = me->publisher.state_data();
|
||||
Trace t(__PRETTY_FUNCTION__);
|
||||
|
||||
auto const &table = me->publisher.state_data();
|
||||
uint32_t unused = 1;
|
||||
while (table.find(unused) != table.end())
|
||||
unused++;
|
||||
@@ -115,6 +134,8 @@ uint32_t AlgoDefinitionServiceServer::_get_unused_key() {
|
||||
}
|
||||
|
||||
RowMetadata AlgoDefinitionServiceServer::_mk_metadata(const uint32_t user_id) {
|
||||
Trace t(__PRETTY_FUNCTION__);
|
||||
|
||||
RowMetadata meta;
|
||||
meta.set_is_active(true);
|
||||
meta.set_creator_user_id(user_id);
|
||||
@@ -122,6 +143,8 @@ RowMetadata AlgoDefinitionServiceServer::_mk_metadata(const uint32_t user_id) {
|
||||
}
|
||||
|
||||
void AlgoDefinitionServiceServer::_publish_all() {
|
||||
Trace t(__PRETTY_FUNCTION__);
|
||||
|
||||
map<string, map<string, string>> all_data = me->store->retrieve_all();
|
||||
auto table=all_data.find(me->table_name);
|
||||
if (table!=all_data.end()) {
|
||||
@@ -138,6 +161,8 @@ void AlgoDefinitionServiceServer::_publish_all() {
|
||||
}
|
||||
|
||||
bool AlgoDefinitionServiceServer::_publish_update(bool insert, const Row& row) {
|
||||
Trace t(fmt::format("{} {} {}", __PRETTY_FUNCTION__,insert,utils::pb::to_string(row)));
|
||||
|
||||
string ser;
|
||||
if(row.SerializeToString(&ser)) {
|
||||
if (insert)
|
||||
@@ -154,4 +179,4 @@ bool AlgoDefinitionServiceServer::_publish_update(bool insert, const Row& row) {
|
||||
} // namespace algo
|
||||
} // namespace orderman
|
||||
} // namespace api
|
||||
} // namespace bts
|
||||
} // namespace bts
|
||||
@@ -338,8 +338,6 @@ unique_ptr<MDP3Listener> MDP3Main::prepare_listener(onixs::Handler& handler, con
|
||||
producer_channels.push_back(_producer.get_channel(symbol.symbol().c_str(), symbol.type(), symbol.exchange()));
|
||||
}
|
||||
|
||||
const auto& options = channel_settings_for(channel.id);
|
||||
|
||||
unique_ptr<MDP3Listener> listener(new MDP3Listener(_index, _producer, /*_settlement_recorder,*/ producer_channels));
|
||||
for (auto& symbol : channel.symbols) {
|
||||
listener->add_filter_symbol(symbol.symbol());
|
||||
|
||||
Reference in new issue
Block a user