refactor: Convert various proto2 cfgs to proto3

This commit is contained in:
John Colvin committed 2023-03-20 13:23:48 -04:00
1 parent f5741d8095
commit fdb4544cb5
36 files changed
+527 -477

No files matched your search

@@ -27,7 +27,7 @@ namespace mbts.spark {
public AlgoProviderFactory(IAlgoStudioModel studio_model, OrderFactory order_factory, ISecurityAuxiliaryDataModel security_auxiliary_model) {
var from_conf = config.Configuration.get<bts.config.AlgoTypeRuleSet>();
var disposables = new List<IDisposable>();
if (from_conf.rules.Count == 0) {
if (from_conf.Rules.Count == 0) {
// There seems to be a config race bug, where the returned config values are empty, despite having entries in spark.conf.
// [John]I've only noticed it happen when attached to the debugger,
// but best to have a contingency plan in place anyways, to prevent any chance of regression.
@@ -120,7 +120,7 @@ namespace mbts.spark {
.Select(t => _get_type_data(t))
.Concat(order_factory.dynamic_types().Select(dt => _get_type_data(AlgoType.Dynamic, dt)))
.ToListLazy();
var conf_sets = from_conf.rules.Select(r => _to_security_algo_set(r, order_factory, algo_type_data)).ToList();
var conf_sets = from_conf.Rules.Select(r => _to_security_algo_set(r, order_factory, algo_type_data)).ToList();
var security_algo_provider = new AlgoProvider(
conf_sets.Select(tup => tup.standard).ToList(),
studio_model,
@@ -155,9 +155,9 @@ namespace mbts.spark {
context == null ?
new SecurityCriteriaClause() :
new SecurityCriteriaClause(
exchanges: context.exchanges?.Select(EnumHelper.parse<Venue>)?.ToArray(),
security_types: context.security_types?.Select(EnumHelper.parse<Security.ContractOneofCase>)?.Select(t => t.security_type())?.ToArray(),
symbols: context.symbols?.ToArray());
exchanges: context.Exchanges?.Select(EnumHelper.parse<Venue>)?.ToArray(),
security_types: context.SecurityTypes?.Select(EnumHelper.parse<Security.ContractOneofCase>)?.Select(t => t.security_type())?.ToArray(),
symbols: context.Symbols?.ToArray());
static (SecurityAlgoTypeSetImmutable standard, SecurityAlgoTypeSetImmutable attachable) _to_security_algo_set(
bts.config.AlgoTypeRule rule,
@@ -168,28 +168,28 @@ namespace mbts.spark {
var dynamic_types = ImmutableHashSet<string>.Empty.ToBuilder();
var attachable_factory_types = ImmutableHashSet<AlgoType>.Empty.ToBuilder();
var attachable_dynamic_types = ImmutableHashSet<string>.Empty.ToBuilder();
foreach (var a in rule.algos) {
if (Enum.TryParse(a.name, out AlgoType sys_algo) && sys_algo != AlgoType.Composite && sys_algo != AlgoType.Dynamic) {
on_sys_match(sys_algo, a.is_attachable);
foreach (var a in rule.Algos) {
if (Enum.TryParse(a.Name, out AlgoType sys_algo) && sys_algo != AlgoType.Composite && sys_algo != AlgoType.Dynamic) {
on_sys_match(sys_algo, a.IsAttachable);
continue;
}
var dyn_desc = order_factory.dynamic_descriptor(a.name);
var dyn_desc = order_factory.dynamic_descriptor(a.Name);
if (dyn_desc is not null) {
on_dyn_match(dyn_desc.DynamicOrderType, a.is_attachable);
on_dyn_match(dyn_desc.DynamicOrderType, a.IsAttachable);
continue;
}
foreach (var (name, factory, dynamic) in algo_type_data) {
if (Regex.Match(name, a.name).Success) {
if (Regex.Match(name, a.Name).Success) {
switch (factory) {
case AlgoType.None:
case AlgoType.Composite:
// unexpected, but no need to crash
continue;
case AlgoType.Dynamic:
on_dyn_match(dynamic, a.is_attachable);
on_dyn_match(dynamic, a.IsAttachable);
break;
default:
on_sys_match(factory, a.is_attachable);
on_sys_match(factory, a.IsAttachable);
break;
}
}
@@ -198,13 +198,13 @@ namespace mbts.spark {
return (
// standard
new SecurityAlgoTypeSetImmutable(
_to_clause(rule.context),
_to_clause(rule.Context),
new AlgoTypeSetImmutable(
factory_types.ToImmutable(),
dynamic_types.ToImmutable())),
// attachable
new SecurityAlgoTypeSetImmutable(
_to_clause(rule.context),
_to_clause(rule.Context),
new AlgoTypeSetImmutable(
attachable_factory_types.ToImmutable(),
attachable_dynamic_types.ToImmutable())));
+1 -1
View File
@@ -50,7 +50,7 @@ namespace bts {
ss,
user,
security_metadata,
TimeSpan.FromMilliseconds(Configuration.get<RelayOptions>().naggle_ms),
TimeSpan.FromMilliseconds(Configuration.get<RelayOptions>().NaggleMs),
TimeSpan.FromSeconds(1)) { }
public MDDaemon(
@@ -28,13 +28,13 @@ namespace mbts.spark {
// i.e. 21:30 UTC corresponds to 16:30 Central (4:30 PM), but only during *CDT*
// CDT it UTC -5
// CST is UTC -6
static readonly int sod_hh = (int)config.Configuration.get<bts.config.SODTime>().sod_hh;
static readonly int sod_mm = (int)config.Configuration.get<bts.config.SODTime>().sod_mm;
static readonly int sod_hh = (int)config.Configuration.get<bts.config.SODTime>().SodHh;
static readonly int sod_mm = (int)config.Configuration.get<bts.config.SODTime>().SodMm;
static readonly TimeZoneInfo central_tzi = TimeZoneInfo.FindSystemTimeZoneById(cst_id);
static MarketSchedule() {
var cme_schedule = config.Configuration.get<bts.md.CMETradingSchedule>();
_cme_gen_open_hrs = cme_schedule?.gen_open_hour ?? 8.5;
_cme_gen_open_hrs = cme_schedule?.GenOpenHour ?? 8.5;
}
// for object initializers
public MarketSchedule() { }
+41
View File
@@ -34,14 +34,55 @@
<Proto3 Include="../../lib/sparkproto/SparkProtos.proto" />
<Proto3 Update="../../lib/api/services/OutOfProcessURLListener.proto">
</Proto3>
<Proto3 Include="../../lib/config/protos/algo_types.proto">
<OutCS>$(ProtoOutputPath)/lib/config/protos/AlgoTypes.cs</OutCS>
</Proto3>
<Proto3 Include="../../lib/config/protos/market_data.proto">
<OutCS>$(ProtoOutputPath)/lib/config/protos/MarketData.cs</OutCS>
</Proto3>
<Proto3 Include="../../lib/config/protos/orders_fills_cleanup.proto">
<OutCS>$(ProtoOutputPath)/lib/config/protos/OrdersFillsCleanup.cs</OutCS>
</Proto3>
<Proto3 Include="../../lib/config/protos/ports.proto">
<OutCS>$(ProtoOutputPath)/lib/config/protos/Ports.cs</OutCS>
</Proto3>
<Proto3 Include="../../lib/config/protos/position_cfg.proto">
<OutCS>$(ProtoOutputPath)/lib/config/protos/PositionCfg.cs</OutCS>
</Proto3>
<Proto3 Include="../../lib/config/protos/quickbus_cfg.proto">
<OutCS>$(ProtoOutputPath)/lib/config/protos/QuickbusCfg.cs</OutCS>
</Proto3>
<Proto3 Include="../../lib/config/protos/symbols.proto">
<OutCS>$(ProtoOutputPath)/lib/config/protos/Symbols.cs</OutCS>
</Proto3>
</ItemGroup>
<ItemGroup>
<Proto2
Include="../../lib/config/protos/*.proto">
<ItemGroup>
<ExcludedFiles Include="../../lib/config/protos/algo_types.proto" />
<ExcludedFiles Include="../../lib/config/protos/cme_reference_data.proto" />
<ExcludedFiles Include="../../lib/config/protos/exchange_sim_cfg.proto" />
<ExcludedFiles Include="../../lib/config/protos/jetfix.proto" />
<ExcludedFiles Include="../../lib/config/protos/keycode.proto" />
<ExcludedFiles Include="../../lib/config/protos/logging.proto" />
<ExcludedFiles Include="../../lib/config/protos/market_data.proto" />
<ExcludedFiles Include="../../lib/config/protos/mercury_cfg.proto" />
<ExcludedFiles Include="../../lib/config/protos/orderman_cfg.proto" />
<ExcludedFiles Include="../../lib/config/protos/orders_fills_cleanup.proto" />
<ExcludedFiles Include="../../lib/config/protos/perflog_cfg.proto" />
<ExcludedFiles Include="../../lib/config/protos/ports.proto" />
<ExcludedFiles Include="../../lib/config/protos/position_cfg.proto" />
<ExcludedFiles Include="../../lib/config/protos/quickbus_cfg.proto" />
<ExcludedFiles Include="../../lib/config/protos/span.proto" />
<ExcludedFiles Include="../../lib/config/protos/spartan.proto" />
<ExcludedFiles Include="../../lib/config/protos/spreader.proto" />
<ExcludedFiles Include="../../lib/config/protos/subprocess.proto" />
<ExcludedFiles Include="../../lib/config/protos/symbols.proto" />
<ExcludedFiles Include="../../lib/config/protos/system_config.proto" />
<ExcludedFiles Include="../../lib/config/protos/testkeys.proto" />
<ExcludedFiles Include="../../lib/config/protos/threads.proto" />
</ItemGroup>
<Exclude Text="@(ExcludedFiles, ';')" />
</Proto2>
@@ -106,7 +106,7 @@ namespace bts.test {
port = (uint)((IPEndPoint)listener.LocalEndpoint).Port;
listener.Stop();
}
var cfg = new config.QuickbusNodeCfg() { my_port = port };
var cfg = new config.QuickbusNodeCfg() { MyPort = port };
var stream = new MemoryStream();
ProtoBuf.Serializer.Serialize(stream, cfg);
IntPtr qbus = ApiNativeMethods.api_create_quickbus(stream.ToArray(), stream.Length);
@@ -115,4 +115,4 @@ namespace bts.test {
#endregion
}
}
}
+4 -4
View File
@@ -135,9 +135,9 @@ namespace bts.tests.utils {
var prts = mbts.config.Configuration.get<bts.config.Ports>();
Console.WriteLine("\n\n\n\n\n\n\n\n\n\n");
Console.WriteLine("config_port: " + prts.config_port);
Console.WriteLine("qbus_port: " + prts.qbus_port);
Console.WriteLine("glbx_sim_fix_port: " + prts.glbx_sim_fix_port);
Console.WriteLine("config_port: " + prts.ConfigPort);
Console.WriteLine("qbus_port: " + prts.QbusPort);
Console.WriteLine("glbx_sim_fix_port: " + prts.GlbxSimFixPort);
Console.WriteLine("\n\n\n\n\n\n\n\n\n\n");
var ctx = new ServiceContext();
@@ -258,4 +258,4 @@ namespace bts.tests.utils {
return md_result != null;
}
}
}
}
+4 -4
View File
@@ -27,11 +27,11 @@ config::QuickbusNodeCfg get_client_node_cfg() {
node_cfg.set_hb_period_msecs(cfg.hb_period_msecs());
node_cfg.set_max_missed_hbs(cfg.max_missed_hbs());
node_cfg.set_parent_host(
cfg.has_qbus_host() ? cfg.qbus_host()
: config::get<config::SystemConfig>().config_ip());
cfg.qbus_host().empty() ? config::get<config::SystemConfig>().config_ip()
: cfg.qbus_host());
node_cfg.set_parent_port(
cfg.has_qbus_port() ? cfg.qbus_port()
: config::get<config::Ports>().qbus_port());
cfg.qbus_port() == 0 ? config::get<config::Ports>().qbus_port()
: cfg.qbus_port());
node_cfg.set_my_port(0);
return node_cfg;
}
@@ -214,6 +214,8 @@ void AdminServiceUtils::fill_connections_from_config(
c.sender_compid());
add_connection(admin_data, connection);
break;
default:
break;
}
}
for (int i = 0; i < admin_data.accounts_size(); i++)
+7 -4
View File
@@ -1,6 +1,9 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
option csharp_namespace = "bts.config";
message AlgoTypeContext {
repeated string exchanges = 1;
repeated string symbols = 2;
@@ -8,12 +11,12 @@ message AlgoTypeContext {
}
message AlgoTypeDef {
optional string name = 1;
optional bool is_attachable = 2 [ default = false ];
string name = 1;
bool is_attachable = 2;
}
message AlgoTypeRule {
optional AlgoTypeContext context = 1;
AlgoTypeContext context = 1;
repeated AlgoTypeDef algos = 2;
}
+15 -11
View File
@@ -1,11 +1,15 @@
syntax = 'proto2';
package bts.config;
import "lib/domain_model/Security.proto";
message CppConfig {
map<string, double> cpp_entry = 1;
}
message CmeSymbolMics {
map<string, bts.api.CMEMics> cme_mic = 1;
}
syntax = "proto3";
import "lib/domain_model/Security.proto";
package bts.config;
option csharp_namespace = "bts.config";
message CppConfig {
map<string, double> cpp_entry = 1;
}
message CmeSymbolMics {
map<string, bts.api.CMEMics> cme_mic = 1;
}
+9 -7
View File
@@ -1,14 +1,16 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
option csharp_namespace = "bts.config";
message ExchangeSim {
optional bool merge_with_md = 1 [ default = true ];
optional bool forward_implied = 2 [ default = false ];
bool merge_with_md = 1;
bool forward_implied = 2;
oneof source {
string replay_url = 11
[ default = "http://10.96.18.45/spark/futures.coconut" ];
string replay_file = 12 [ default = "futures.coconut" ];
string replay_url = 11;
string replay_file = 12;
bool local_relay = 13;
}
optional uint32 orders_per_level = 20 [ default = 10 ];
uint32 orders_per_level = 20;
}
+58 -93
View File
@@ -1,148 +1,113 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
message JetFIX {
message Connection {
// a friendly name used to represent this session in the UI
required string name = 10;
string name = 10;
enum JetFIXPlatform {
JET_FIX_PLATFORM_UNSPECIFIED = 0;
GLBX = 1;
CBOE = 6;
SIM = 2;
ICE = 3;
SIMICE = 4;
}
optional JetFIXPlatform platform = 15 [ default = GLBX ];
JetFIXPlatform platform = 15;
// the ip address to connect to
required string socket_connect_host_ip = 30;
string socket_connect_host_ip = 30;
// the port to connect to
required uint32 socket_connect_port = 40;
uint32 socket_connect_port = 40;
// time in seconds before reconnect attempt
optional int32 reconnect_interval = 20 [ default = 60 ];
int32 reconnect_interval = 20;
// time of day the FIX session becomes activated (local time)
optional string start_time = 50 [ default = "00:30:00" ];
string start_time = 50;
// time of day the FIX session become deactiviated (local time)
optional string end_time = 60 [ default = "23:30:00" ];
string end_time = 60;
// time in seconds between heartbeat messages (typically 30)
optional int32 seconds_between_hbs = 70 [ default = 30 ];
int32 seconds_between_hbs = 70;
// maximum number of incoming hbs we can miss before we close
// the connection
optional int32 max_missed_hbs = 75 [ default = 2 ];
int32 max_missed_hbs = 75;
// day of the week (local time) when the fix session starts (blank for every
// day)
optional string start_day = 80;
string start_day = 80;
// day of the week (local time) when the fix session ends (blank for every
// day)
optional string end_day = 90;
string end_day = 90;
optional string sender_compid = 100 [ default = "" ];
optional string target_compid = 110 [ default = "" ];
optional string sender_subid = 120 [ default = "" ];
optional string target_subid = 130 [ default = "" ];
optional string sender_locationid = 135 [ default = "US,NC" ];
optional string raw_data = 136 [ default = "" ];
optional string user_name = 138 [ default = "" ];
optional string self_match_prevention_id = 140 [ default = "" ];
optional string cti_code = 145 [ default = "1" ];
optional int32 customer_or_firm = 147 [ default = 1 ];
optional string mm_account = 150 [ default = "" ];
string sender_compid = 100;
string target_compid = 110;
string sender_subid = 120;
string target_subid = 130;
string sender_locationid = 135;
string raw_data = 136;
string user_name = 138;
string self_match_prevention_id = 140;
string cti_code = 145;
int32 customer_or_firm = 147;
string mm_account = 150;
optional int32 quote_entries_per_message = 160 [ default = 15 ];
optional int32 registered_instrument_group_count = 170 [ default = 100 ];
optional int32 seconds_to_pause = 180 [ default = 35 ];
optional int32 seconds_to_logon = 185 [ default = 5 ];
optional int32 seconds_to_logout = 190 [ default = 5 ];
optional int32 seconds_between_syncs = 200 [ default = 3 ];
int32 quote_entries_per_message = 160;
int32 registered_instrument_group_count = 170;
int32 seconds_to_pause = 180;
int32 seconds_to_logon = 185;
int32 seconds_to_logout = 190;
int32 seconds_between_syncs = 200;
optional uint32 max_qps = 210 [ default = 750 ];
uint32 max_qps = 210;
optional uint32 max_spt = 214 [ default = 100 ];
optional uint32 max_spt_window_secs = 217 [ default = 3 ];
uint32 max_spt = 214;
uint32 max_spt_window_secs = 217;
optional uint32 max_msgs_in_resend_req = 220 [ default = 2499 ];
uint32 max_msgs_in_resend_req = 220 ;
optional uint32 msg_buffer_sz = 230 [ default = 10000000 ];
optional uint32 msg_high_water_mark = 240 [ default = 2048 ];
optional uint32 seconds_to_replay = 250 [ default = 600 ];
optional bool log_fix_stream = 260 [ default = false ];
optional bool use_persisted_quote_ids = 270 [ default = true ];
optional uint32 quote_id_reservation_size = 290 [ default = 100000 ];
required uint32 cme_market_segment_id = 320;
uint32 msg_buffer_sz = 230;
uint32 msg_high_water_mark = 240;
uint32 seconds_to_replay = 250;
bool log_fix_stream = 260;
bool use_persisted_quote_ids = 270;
uint32 quote_id_reservation_size = 290;
uint32 cme_market_segment_id = 320;
optional string trading_session_id = 330 [ default = "" ];
optional int32 udf_support_indicator = 340 [ default = 1 ];
optional bool use_cme_secure_logon = 341 [ default = true ];
optional bool auto_cert_mode = 342 [ default = false ];
optional int32 price_encoding_precision = 343 [ default = 8 ];
optional uint32 max_order_msgs_per_window = 344
[ default = 166 ]; // At the CME 166 ~= 500 / 3
optional uint32 window_duration_msecs = 345
[ default = 1000 ]; // leave it alone
string trading_session_id = 330;
int32 udf_support_indicator = 340;
bool use_cme_secure_logon = 341;
bool auto_cert_mode = 342;
int32 price_encoding_precision = 343;
// At the CME 166 ~= 500 / 3
uint32 max_order_msgs_per_window = 344;
// leave it alone
uint32 window_duration_msecs = 345;
optional uint32 max_connection_attempts = 346 [ default = 10 ];
optional bool auto_fix_seq_num = 347 [ default = false ];
optional bool use_ilink3 = 348 [ default = false ];
uint32 max_connection_attempts = 346;
bool auto_fix_seq_num = 347;
bool use_ilink3 = 348;
}
repeated Connection connection = 10;
}
message JetFIXSimConnection {
required JetFIX.Connection sim = 10;
required JetFIX.Connection sim_ice = 20;
JetFIX.Connection sim = 10;
JetFIX.Connection sim_ice = 20;
}
message CannedCertSession {
required string name = 10 [ default = "" ];
string name = 10;
}
message CMECannedSecureLogon {
required string secure_logon_fil = 10
[ default =
"Session ID Access ID Secret Key "
" Creation Date "
"Expiration Date Environment \n"
"1U7 i9pLY5mVhWLXs7FWNb9X "
"8esbwiaHaqmR2rXZMkJRHt00fW6l_-ppCGoheWWuBZQ 2018-04-05 "
" 2019-04-05 CERT \n"
"1U7 ozXmORijPtJriTg6Wwny "
"A1KOwrhH8GojNotjkCfVwHRSi_OS280xihaRZwJLFKo 2018-04-03 "
" 2018-05-03 CERT \n"
"ANS 6ogfYoF54g695tqaHsFC "
"CtDkFnuDuStB1S05nC_pWvANb6FWsV2IMNKkmM3EcP4 2018-04-05 "
" 2019-04-05 NEWRELEASE \n"
"KTK IrUp518ekr8SzbfJGdPZ "
"QmilC-cKgqlIiIBs_BV59fowbPfuBWn0QjeEc1dYj38 2018-04-05 "
" 2019-04-05 NEWRELEASE \n"
"M5Y bUFtyvZgPhZFCYa434ap "
"rfZ2XLLwtHt26szWwMxYRw9uPb7jE4evEWaKuKf2uyU 2018-04-05 "
" 2019-04-05 CERT \n"
"MBX tbna9JLxT4Jlrzj0wtSS "
"EcYqrLmR4ysSIT_NCBeC2AjDo7IAHsVZ0rOZ0cpAh_o 2018-04-05 "
" 2019-04-05 CERT \n"
"MC1 0N10hKkE2B2KUt86ewd8 "
"dJ5I52JNA-6aZZ8hnO0byVKcyqA8Of6kkstfIF89AAM 2018-04-05 "
" 2019-04-05 CERT \n"
"MC5 e4uBmhQ1ebaXAeWHa7HK "
"PNOM86eofsiCwzzKUsB5yAmrNoyZypnYD72pT2A8zgc 2018-04-05 "
" 2019-04-05 CERT \n"
"MC7 S6KfCnay5UJ67P55ibHd "
"5lSs1TbX7N0p6Duu63_JDMghPUqBAWacvkM91MUv1uM 2018-04-05 "
" 2019-04-05 CERT \n"
"MC8 AbEEtBn63WIAuItPDz1c "
"n3ndjYb03Hx6wBO3me35HoONyDgO5TZKWk0tDSaX9KA 2018-04-05 "
" 2019-04-05 CERT \n"
"T39 UWggBgHWAe07aqW3ps2I "
"tbb3it0rUQSSTa0TC9QcRwkrHEMDLWhaJH4VQ0FqGB4 2018-04-05 "
" 2019-04-05 NEWRELEASE \n" ];
string secure_logon_fil = 10;
}
+12 -11
View File
@@ -1,22 +1,23 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
message KeyCode {
optional uint32 nusers = 10;
optional uint64 expiration = 20;
optional uint64 generation_time = 30;
uint32 nusers = 10;
uint64 expiration = 20;
uint64 generation_time = 30;
optional string ip = 40;
optional string port = 50;
optional bool allow_concurrent = 60;
string ip = 40;
string port = 50;
bool allow_concurrent = 60;
}
message EncryptedKeyCode {
optional string keycode = 10;
string keycode = 10;
}
message PublicKey {
// Treat these like a oneof case. If both are defined, 'key_lines' takes precedence
repeated string key_lines = 1;
optional string key_file_path = 2;
// Treat these like a oneof case. If both are defined, 'key_lines' takes precedence
repeated string key_lines = 1;
string key_file_path = 2;
}
+155 -154
View File
@@ -1,30 +1,31 @@
syntax = 'proto2';
syntax = "proto3";
package bts.md;
option csharp_namespace = "bts.md";
message MarketDataConfig {
// Allows you to turn off in-proc market data entirely
optional bool use_md = 1 [ default = true ];
optional bool use_onixs = 2 [ default = true ];
optional bool use_replay = 3 [ default = false ];
optional bool use_sim = 4 [ default = true ];
bool use_md = 1;
bool use_onixs = 2;
bool use_replay = 3;
bool use_sim = 4;
}
message PlatformMap {
// PLATFORM_MDP3ONIXS
optional string glbx_platform = 1 [ default = "PLATFORM_SIM" ];
string glbx_platform = 1;
// PLATFORM_ICEONIXS
optional string ice_platform = 2 [ default = "PLATFORM_ICEONIXS" ];
string ice_platform = 2;
}
// LOCAL TIME
message MDBootDelayWindow {
message TimeSpan {
optional string start = 1 [ default = "16:30" ];
optional string end = 2 [ default = "16:40" ];
}
optional uint32 delay_seconds = 1 [ default = 120 ];
optional TimeSpan standard = 2;
optional TimeSpan sunday = 3;
uint32 delay_seconds = 1;
string standard_start = 2;
string standard_end = 3;
string sunday_start = 4;
string sunday_end = 5;
}
//
@@ -33,171 +34,174 @@ message MDBootDelayWindow {
message PublisherOptions {
// removed 2
optional string network_interface = 3 [ default = "0.0.0.0" ];
string network_interface = 3;
// Supply either network_interface -or- network_interface_[a,b]
optional string network_interface_a = 30;
optional string network_interface_b = 31;
string network_interface_a = 30;
string network_interface_b = 31;
// removed 4,5
// removed 6,7,8
optional string channel_prefix = 9 [ default = "" ];
string channel_prefix = 9;
// Co2 options
// How old can the heartbeat be before it's considered dead
optional uint32 heartbeat_ms = 10 [ default = 5000 ];
optional bool disable_heartbeat = 11 [ default = false ];
optional uint32 heartbeat_boot_seconds = 12
[ default = 60 ]; // 1 minute grace period from shm creation
uint32 heartbeat_ms = 10;
bool disable_heartbeat = 11;
uint32 heartbeat_boot_seconds = 12;
optional bool skip_options = 13 [ default = true ];
bool skip_options = 13;
optional uint32 hot_initial = 20 [ default = 1024 ];
optional uint32 hot_growth = 21 [ default = 1024 ];
optional uint32 cold_initial = 22 [ default = 8192 ];
optional uint32 cold_growth = 23 [ default = 2048 ];
uint32 hot_initial = 20;
uint32 hot_growth = 21;
uint32 cold_initial = 22;
uint32 cold_growth = 23;
}
message ICEPublisherOptions {
optional string network_interface = 3 [ default = "0.0.0.0" ];
string network_interface = 3;
// Supply either network_interface -or- network_interface_[a,b]
optional string network_interface_a = 30;
optional string network_interface_b = 31;
string network_interface_a = 30;
string network_interface_b = 31;
}
message PlatformConfig {
required string platform = 1;
optional string exchange = 2 [ default = "VENUE_UNSET" ];
optional string type = 3 [ default = "SECURITYTYPE_UNSET" ];
string platform = 1;
string exchange = 2;
string type = 3;
}
message StreamOptions {
optional uint32 trade_log_stream_size = 2 [ default = 1024 ];
uint32 trade_log_stream_size = 2;
}
message PublisherNamespace {
optional string shared_memory_namespace = 1;
string shared_memory_namespace = 1;
}
enum CmeOnixSLogMode {
CME_ONIXS_LOG_MODE_UNSPECIFIED = 0;
CME_ONIXS_LOG_MODE_IMPORTANT = 10;
CME_ONIXS_LOG_MODE_REGULAR = 50;
CME_ONIXS_LOG_MODE_DEBUG = 100;
}
message CmeChannelConfig {
repeated string id = 2;
string feed_engine = 3;
// for re-orders
uint32 max_gap_recovery_cache_size = 11;
// for re-orders
uint32 lost_packet_wait_timeout_ms = 12;
CmeOnixSLogMode onixs_log_mode = 13;
// If using both feeds prefer the B feed for snapshots
bool prefer_backup_feeds = 15;
bool use_tcp_replay = 20;
string tcp_replay_username = 21;
string tcp_replay_password = 22;
int32 tcp_replay_connect_attempts = 23;
int32 tcp_replay_reconnect_interval_ms = 24;
int32 tcp_replay_timeout_s = 25;
uint32 recovery_queue_size = 30;
bool use_natural_refresh = 31;
bool join_snapshot_on_gap = 32;
bool load_security_db = 33;
reserved 34;
// optional BookType book_type = 34 [default = BOOKTYPE_CONSOLIDATED];
bool validate_mbo = 35;
}
message CmeFeedEngineSettings {
string name = 1;
// If num_threads is set it will use that - otherwise it will use
// channels_per_thread and the number of threads configured for this channel
// to determine the number of threads
uint32 num_threads = 2;
// Defines amount of time Feed Engine spends on socket waiting for I/O while
// running master processing loop.
uint32 data_wait = 3;
// Defines amount of time Feed Engine keeps cycling before going to sleep
// when no useful activity can be done
uint32 spin_time = 4;
uint32 channels_per_thread = 5;
// rmem_max
uint32 udp_socket_buffer_size = 11;
}
//
// CME Options
//
message CMEOptions {
enum OnixSLogMode {
None = 0;
Important = 10;
Regular = 50;
Debug = 100;
}
message FeedEngineSettings {
optional string name = 1;
// If num_threads is set it will use that - otherwise it will use
// channels_per_thread and the number of threads configured for this channel
// to determine the number of threads
optional uint32 num_threads = 2 [ default = 1 ];
// Defines amount of time Feed Engine spends on socket waiting for I/O while
// running master processing loop.
optional uint32 data_wait = 3 [ default = 10 ];
// Defines amount of time Feed Engine keeps cycling before going to sleep
// when no useful activity can be done
optional uint32 spin_time = 4 [ default = 1 ];
optional uint32 channels_per_thread = 5 [ default = 3 ];
// rmem_max
optional uint32 udp_socket_buffer_size = 11 [ default = 268435456 ]; // 256mb
}
message CMEChannel {
repeated string id = 2;
optional string feed_engine = 3 [ default = "default" ];
// for re-orders
optional uint32 max_gap_recovery_cache_size = 11 [ default = 6 ];
// for re-orders
optional uint32 lost_packet_wait_timeout_ms = 12 [ default = 10 ];
optional OnixSLogMode onixs_log_mode = 13 [ default = Important ];
// If using both feeds prefer the B feed for snapshots
optional bool prefer_backup_feeds = 15 [ default = false ];
optional bool use_tcp_replay = 20 [ default = true ];
optional string tcp_replay_username = 21 [ default = "MDPFFBLUE" ];
optional string tcp_replay_password = 22 [ default = "password01" ];
optional int32 tcp_replay_connect_attempts = 23 [ default = 3 ];
optional int32 tcp_replay_reconnect_interval_ms = 24 [ default = 30000 ];
optional int32 tcp_replay_timeout_s = 25 [ default = 10 ];
optional uint32 recovery_queue_size = 30 [ default = 640000 ];
optional bool use_natural_refresh = 31 [ default = false ];
optional bool join_snapshot_on_gap = 32 [ default = false ];
optional bool load_security_db = 33 [ default = true ];
reserved 34;
// optional BookType book_type = 34 [default = BOOKTYPE_CONSOLIDATED];
optional bool validate_mbo = 35 [ default = false ];
}
// optional string onixs_license = 1 [default = "{default}"];
reserved 1;
repeated CMEChannel channel = 3;
repeated FeedEngineSettings feed_engine = 5;
repeated CmeChannelConfig channel = 3;
repeated CmeFeedEngineSettings feed_engine = 5;
// Prevents parsing trades/rfqs/doing anything not required for quoting
optional bool quoter_mode = 6;
optional bool verbose_ticker = 7 [ default = false ];
bool quoter_mode = 6;
bool verbose_ticker = 7;
}
// ICE
enum IceOnixSLogMode {
ICE_ONIXS_LOG_MODE_UNSPECIFIED = 0;
ICE_ONIXS_LOG_MODE_FATAL = 1;
ICE_ONIXS_LOG_MODE_ERROR = 2;
ICE_ONIXS_LOG_MODE_WARNING = 3;
ICE_ONIXS_LOG_MODE_INFO = 4;
ICE_ONIXS_LOG_MODE_TRACE = 5;
ICE_ONIXS_LOG_MODE_DEBUG = 6;
}
// A channel is one onixs-ice thread
message IceChannelConfig {
string name = 1;
repeated uint32 market_type = 2;
repeated uint32 uds_market_type = 7;
uint32 udp_buffer_size = 3;
uint32 heartbeat_interval = 4;
uint32 sequence_gap_margin = 5;
uint32 gap_timeout_in_ms = 6;
int32 snapshot_recovery_timeout_in_ms = 10;
int32 maximum_number_of_snapshot_recovery_attempts = 11;
int32 maximum_size_of_snapshot_message_queue = 12;
int32 maximum_size_of_live_message_queue = 13;
string processing_thread_affinity = 20;
bool track_top_of_the_book_only = 30;
bool receive_product_definitions_only = 31;
uint32 max_multicast_message_block_size = 32;
string product_definition_cache_directory = 35;
IceOnixSLogMode onixs_log_mode = 40;
bool load_security_db = 41;
}
//
// ICE Options
//
message ICEOptions {
enum OnixSLogMode {
Fatal = 0;
Error = 1;
Warning = 2;
Info = 3;
Trace = 4;
Debug = 5;
}
// A channel is one onixs-ice thread
message ICEChannel {
required string name = 1;
repeated uint32 market_type = 2;
repeated uint32 uds_market_type = 7;
optional uint32 udp_buffer_size = 3 [ default = 4194304 ]; // 4mb
optional uint32 heartbeat_interval = 4 [ default = 36000 ];
optional uint32 sequence_gap_margin = 5 [ default = 10000 ];
optional uint32 gap_timeout_in_ms = 6 [ default = 10000 ];
optional int32 snapshot_recovery_timeout_in_ms = 10 [ default = -1 ];
optional int32 maximum_number_of_snapshot_recovery_attempts = 11
[ default = -1 ];
optional int32 maximum_size_of_snapshot_message_queue = 12 [ default = -1 ];
optional int32 maximum_size_of_live_message_queue = 13 [ default = 200000 ];
optional string processing_thread_affinity = 20 [ default = "" ];
optional bool track_top_of_the_book_only = 30 [ default = false ];
optional bool receive_product_definitions_only = 31 [ default = false ];
optional uint32 max_multicast_message_block_size = 32 [ default = 1400 ];
optional string product_definition_cache_directory = 35 [ default = "" ];
optional OnixSLogMode onixs_log_mode = 40 [ default = Warning ];
optional bool load_security_db = 41 [ default = true ];
}
// optional string onixs_license = 1 [default = "{default}"];
reserved 1;
optional string ice_config_file = 2
[ default = "ConnectivityConfiguration.Production.xml" ];
repeated ICEChannel channel = 3;
string ice_config_file = 2;
repeated IceChannelConfig channel = 3;
}
message OnixsOptions {
optional string onixs_license = 1 [ default = "{default}" ];
string onixs_license = 1;
}
message RecordOptions {
// optional string output_path = 2 [default = "/home/bts/md/today"];
optional bool enable_depth = 3 [ default = false ];
optional bool enable_future_depth = 4 [ default = true ];
optional bool record_sim = 5 [ default = false ];
bool enable_depth = 3;
bool enable_future_depth = 4;
bool record_sim = 5;
}
// If starting on Sunday pre-load the selected symbols from disk
@@ -210,45 +214,42 @@ message SecurityPreload {
//
message ReplayOptions {
// Tired of fighting with dns
optional string url = 1
[ default = "http://10.96.18.45/spark/futures.coconut" ];
string url = 1;
// 2.0 = double speed, 0.5 = half speed
optional double speed = 11 [ default = 1.0 ];
optional bool interactive = 12 [ default = false ];
optional string fallback = 20 [ default = "data_files/futures.coconut" ];
double speed = 11;
bool interactive = 12;
string fallback = 20;
}
message RelayOptions {
optional uint32 naggle_ms = 1 [ default = 100 ];
optional uint32 security_scan_interval = 2 [ default = 500 ];
optional uint32 recovery_interval = 3 [ default = 30000 ];
uint32 naggle_ms = 1;
uint32 security_scan_interval = 2;
uint32 recovery_interval = 3;
}
message CMETradingSchedule {
// we can elaborate later, but for now it's very simple:
// this is "hours after midnight, in Central Time"
optional double gen_open_hour = 1 [ default = 8.5 ]; // 8:30 am CT
double gen_open_hour = 1;
}
message SecurityExpirationCutoff {
optional uint32 max_days_after_expiration = 1 [ default = 7 ];
uint32 max_days_after_expiration = 1;
}
message DisplayFactorOverride {
message Override {
required string symbol = 1;
required string exchange = 2;
optional string type = 3;
optional double price_multiplier = 10;
}
repeated Override override = 1;
string symbol = 1;
string exchange = 2;
string type = 3;
double price_multiplier = 10;
}
message DisplayFactorOverrideList {
repeated DisplayFactorOverride items = 1;
}
message FeedHandlerConfig {
repeated string channel = 1;
optional string network_interface_a = 3 [ default = "0.0.0.0" ];
optional string network_interface_b = 4 [ default = "" ];
}
string network_interface_a = 3;
string network_interface_b = 4;
}
+2 -2
View File
@@ -1,7 +1,7 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
message Mercury {
optional uint32 queue_size = 1 [ default = 1000 ];
uint32 queue_size = 1;
}
+7 -5
View File
@@ -1,13 +1,15 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
message OrdermanCfg {
message Executor {
required string thread_name = 1;
optional bool poll = 2 [ default = false ];
string thread_name = 1;
bool poll = 2;
repeated string hosted_actor = 3;
}
repeated Executor executor = 1;
optional uint32 default_iceberg_pause_secs = 2 [ default = 0 ];
optional string fallback_cust_order_handling_inst = 3 [ default = "Y" ];
uint32 default_iceberg_pause_secs = 2;
string fallback_cust_order_handling_inst = 3;
}
@@ -1,12 +1,15 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
option csharp_namespace = "bts.config";
message OrdersSoftCleanupCutoff {
optional uint32 extra_days = 10 [ default = 1 ];
uint32 extra_days = 10;
}
message SODTime {
// utc time
optional uint32 sod_hh = 20 [ default = 16 ];
optional uint32 sod_mm = 30 [ default = 30 ];
}
uint32 sod_hh = 20;
uint32 sod_mm = 30;
}
+5 -4
View File
@@ -1,8 +1,9 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
message PerfLogCfg {
optional bool active = 1 [ default = true ];
optional uint32 max_rows = 3 [ default = 10000123 ];
optional uint32 entry_batch_size = 4 [ default = 200 ];
bool active = 1;
uint32 max_rows = 3;
uint32 entry_batch_size = 4;
}
+9 -7
View File
@@ -1,11 +1,13 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
option csharp_namespace = "bts.config";
message Ports {
// see ports.conf for actual defaults
optional int32 config_port = 1;
optional int32 qbus_port = 2;
optional int32 glbx_sim_fix_port = 3;
optional int32 ice_sim_fix_port = 5;
optional int32 replicator_port = 4;
int32 config_port = 1;
int32 qbus_port = 2;
int32 glbx_sim_fix_port = 3;
int32 ice_sim_fix_port = 5;
int32 replicator_port = 4;
}
+27 -22
View File
@@ -1,36 +1,41 @@
syntax = 'proto2';
syntax = "proto3";
import "lib/domain_model/Security.proto";
package bts.config;
message GMI_Import {
required string sftp_host = 10;
optional uint32 sftp_port = 11;
required string sftp_user = 12;
required string sftp_password = 2;
option csharp_namespace = "bts.config";
required int32 pause_between_downloads_seconds = 4 [ default = 30 ];
required int32 download_timeout_seconds = 5 [ default = 35 ];
optional string download_window_begin = 6 [ default = "22:00" ];
optional string download_window_end = 7 [ default = "23:00" ];
message GMI_Import {
string sftp_host = 10;
uint32 sftp_port = 11;
string sftp_user = 12;
string sftp_password = 2;
int32 pause_between_downloads_seconds = 4;
int32 download_timeout_seconds = 5;
string download_window_begin = 6;
string download_window_end = 7;
// These are just in case one we need to turn one of these off while
// the other remains on
optional bool disable_money_download = 8 [ default = false ];
optional bool disable_position_download = 9 [ default = false ];
bool disable_money_download = 8;
bool disable_position_download = 9;
}
message GMI_Symbol {
string gmi = 1;
string spark = 2;
bts.api.Venue venue = 3;
double price_multiplier = 4;
}
message GMI_SymbolMap {
message SymbolMap {
required string gmi = 1;
required string spark = 2;
required bts.api.Venue venue = 3;
required double price_multiplier = 4;
}
repeated SymbolMap sym = 4;
repeated GMI_Symbol sym = 4;
}
message GMI_Parser {
optional bool map_glbx_to_sim = 1 [ default = false ];
optional bool ignore_unknown_securities = 5 [ default = false ];
optional bool ignore_unsupported_security_types = 6 [ default = true ];
bool map_glbx_to_sim = 1;
bool ignore_unknown_securities = 5;
bool ignore_unsupported_security_types = 6;
}
+17 -14
View File
@@ -1,23 +1,26 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
option csharp_namespace = "bts.config";
message QuickbusNodeCfg {
optional uint32 reconnect_period_secs = 1 [ default = 5 ];
optional string parent_host = 2 [ default = "" ];
optional uint32 parent_port = 3 [ default = 0 ];
optional uint32 my_port = 4 [ default = 0 ];
optional uint32 hb_period_msecs = 5 [ default = 15000 ];
optional uint32 max_missed_hbs = 6 [ default = 3 ];
uint32 reconnect_period_secs = 1;
string parent_host = 2;
uint32 parent_port = 3;
uint32 my_port = 4;
uint32 hb_period_msecs = 5;
uint32 max_missed_hbs = 6;
}
message QuickbusCfg {
optional uint32 reconnect_period_secs = 1 [ default = 5 ];
optional string qbus_host = 2 [ default = "" ];
optional uint32 qbus_port = 3 [ default = 0 ];
optional uint32 hb_period_msecs = 5 [ default = 15000 ];
optional uint32 max_missed_hbs = 6 [ default = 3 ];
uint32 reconnect_period_secs = 1;
string qbus_host = 2;
uint32 qbus_port = 3;
uint32 hb_period_msecs = 5;
uint32 max_missed_hbs = 6;
}
message RPCConfig {
optional uint32 rpc_connect_timeout_seconds = 1 [ default = 10 ];
}
uint32 rpc_connect_timeout_seconds = 1;
}
+6 -5
View File
@@ -1,9 +1,10 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
message SpanMargin {
optional bool enabled = 10;
optional string login = 20;
optional string password = 30;
optional string url = 40;
bool enabled = 10;
string login = 20;
string password = 30;
string url = 40;
}
+19 -18
View File
@@ -1,43 +1,44 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
message SpartanTASCfg {
message TASSide {
required uint32 quantity = 2;
required int32 ticks_away = 3;
uint32 quantity = 2;
int32 ticks_away = 3;
}
message TASTrigger {
required string security = 1;
required TASSide buy = 3;
required TASSide sell = 4;
string security = 1;
TASSide buy = 3;
TASSide sell = 4;
}
required string user = 1;
required string account = 2;
string user = 1;
string account = 2;
repeated TASTrigger tas_trigger = 3;
}
message SniperPlaceholderOrderPrices {
message PriceEntry {
required string security_desc = 1;
required double buy_price = 2;
required double sell_price = 3;
string security_desc = 1;
double buy_price = 2;
double sell_price = 3;
}
repeated PriceEntry prices = 1;
}
message MarketDataDownload {
required bool write_books = 2 [ default = true ];
bool write_books = 2;
}
message PolygonDiscovery {
// Only symbols in this list are included (ignored
// if this list is left empty)
repeated string symbols = 1;
optional uint32 exp_n_months = 2 [ default = 12 ];
optional bool include_outright_futures = 3 [ default = true ];
optional uint32 active_threshold_fills = 4 [ default = 100 ];
optional uint32 maximum_securities = 5 [ default = 500 ];
optional uint32 maximum_vertices = 6 [ default = 4 ];
}
uint32 exp_n_months = 2;
bool include_outright_futures = 3;
uint32 active_threshold_fills = 4;
uint32 maximum_securities = 5;
uint32 maximum_vertices = 6;
}
+11 -8
View File
@@ -1,16 +1,19 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
message Spreader {
optional uint32 n_failed_iocs = 10 [ default = 20 ];
uint32 n_failed_iocs = 10;
// if this is set to true, the spreader internally
// generates fake fills to keep the cache (data and
// instruction) warm
message CacheWarming {
optional bool enable_fills = 10 [ default = true ];
optional bool enable_child_order_activate = 15 [ default = true ];
optional double fill_period_low = 20 [ default = 10 ];
optional double fill_period_high = 30 [ default = 50 ];
bool enable_fills = 10;
bool enable_child_order_activate = 15;
double fill_period_low = 20;
double fill_period_high = 30;
}
optional CacheWarming cache_warming = 20;
}
CacheWarming cache_warming = 20;
}
+5 -4
View File
@@ -1,12 +1,13 @@
syntax = 'proto2';
syntax = "proto3";
package bts.subprocess;
message Process {
required string exe = 1;
string exe = 1;
repeated string args = 2;
message Variable {
required string name = 1;
optional string value = 2;
string name = 1;
string value = 2;
}
repeated Variable env = 3;
}
+10 -7
View File
@@ -1,8 +1,11 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config.system_symbols;
option csharp_namespace = "bts.config.system_symbols";
message SymbolList {
optional string key = 1;
string key = 1;
repeated string symbol = 2;
}
@@ -18,9 +21,9 @@ message SecurityExchangeList {
}
message Symbols {
optional SecurityExchangeList glbx = 10;
optional SecurityExchangeList sim = 20;
optional SecurityExchangeList ice = 30;
optional SecurityExchangeList simice = 40;
optional SecurityExchangeList deribit = 50;
SecurityExchangeList glbx = 10;
SecurityExchangeList sim = 20;
SecurityExchangeList ice = 30;
SecurityExchangeList simice = 40;
SecurityExchangeList deribit = 50;
}
+17 -16
View File
@@ -1,4 +1,4 @@
syntax = 'proto2';
syntax = "proto3";
import "lib/config/extensions/extensions.proto";
@@ -8,22 +8,22 @@ package bts.config.test;
message Foo {
option (doc_string) = "This is a test key. Don't use it for real data";
optional string name = 1 [ default = "Blue Foo" ];
optional int32 id = 2 [ default = 1234 ];
string name = 1;
int32 id = 2;
repeated string email = 3;
optional string url = 4;
string url = 4;
}
message FooGroup {
required string group = 1;
required Foo foo = 2;
string group = 1;
Foo foo = 2;
}
message NamedFoo {
optional string key = 1;
optional Foo foo = 2;
string key = 1;
Foo foo = 2;
repeated Foo foox = 3;
optional string rule = 4;
string rule = 4;
}
message FooList {
@@ -39,18 +39,19 @@ message RuleRef {
option (doc_string) = "This contains properties of various types which we "
"can use as test cases for self-referenential rules";
optional string a_string = 1;
optional int32 a_int = 2;
string a_string = 1;
int32 a_int = 2;
repeated string list_string = 3;
repeated int32 list_int = 4;
repeated Foo foox = 6;
optional RuleRef nested = 5;
RuleRef nested = 5;
}
// For Config demo
message ConsoleColor {
enum Colors {
UNSPECIFIED = 0;
DarkBlue = 1;
DarkGreen = 2;
DarkTeel = 3;
@@ -67,18 +68,18 @@ message ConsoleColor {
Yellow = 14;
White = 15;
}
required Colors color = 1;
Colors color = 1;
}
message ConsoleColors {
optional ConsoleColor.Colors color = 1;
ConsoleColor.Colors color = 1;
repeated ConsoleColor.Colors colors = 2;
}
message TestSite {
required string name = 1 [ default = "NO NAME!" ];
string name = 1;
}
message TestPorts {
optional int32 config_port = 1;
int32 config_port = 1;
}
+4 -3
View File
@@ -1,9 +1,10 @@
syntax = 'proto2';
syntax = "proto3";
package bts.config;
message ThreadGroupCfg {
required string name_rx = 1 [ default = "*" ];
optional bool exclude = 2 [ default = false ];
string name_rx = 1;
bool exclude = 2;
repeated uint32 core = 3;
}
+2 -2
View File
@@ -821,11 +821,11 @@ OutFIXPtr make_logon(
buffer.add<ApplicationSystemVersion>(std::string_view{"1.0"});
buffer.add<ApplicationSystemVendor>(std::string_view{"BTS"});
if (session_cfg.has_trading_session_id()) {
if (!session_cfg.trading_session_id().empty()) {
buffer.add<fix::NoTradingSessions>(1);
buffer.add<fix::TradingSessionID>(session_cfg.trading_session_id());
}
if (session_cfg.has_udf_support_indicator())
if (session_cfg.udf_support_indicator() != 0)
buffer.add<fix::UDFSupportIndicator>(
session_cfg.udf_support_indicator());
+2 -2
View File
@@ -121,8 +121,8 @@ SessionName session_name(
SessionName session_name(config::JetFIX::Connection const &session_cfg) {
auto now = datetime::local_now();
if (session_cfg.has_start_day()) {
bts_assert(session_cfg.has_end_day());
if (!session_cfg.start_day().empty()) {
bts_assert(!session_cfg.end_day().empty());
return session_name(
now, parse_weekday(session_cfg.start_day()),
datetime::parse_duration(session_cfg.start_time()),
+2 -2
View File
@@ -15,8 +15,8 @@ namespace md {
struct DisplayFactorMapper : public ISecurityMapper {
btree::map<UserSymbol, int> _mapped;
DisplayFactorMapper() : _mapped() {
for (const auto &ov : config::get<DisplayFactorOverride>().override()) {
if (ov.has_price_multiplier()) {
for (const auto &ov : config::get<DisplayFactorOverrideList>().items()) {
if (ov.price_multiplier() != 0) {
auto venue = parse_enum<api::Venue>(
ov.exchange(), "VENUE", api::Venue_Parse);
bts_assert_msg(
+2 -2
View File
@@ -47,12 +47,12 @@ AuthSessionManager::AuthSessionManager()
bool AuthSessionManager::validate_ip_port(const bts::config::KeyCode &kc) {
bool portgood = true;
if (kc.has_port() && kc.port() != "") {
if (!kc.port().empty()) {
const auto &ports = config::get<config::Ports>();
portgood = std::to_string(ports.config_port()) == kc.port();
}
bool ipgood = true;
if (kc.has_ip() && kc.ip() != "") {
if (!kc.ip().empty()) {
auto ipmap = bts::os::host_ips();
for (const auto &x : ipmap) {
if (x.second == kc.ip()) {
+6 -5
View File
@@ -25,14 +25,15 @@ std::string get_thread_name() {
static void boot_sleep() {
auto conf = config::get<bts::md::MDBootDelayWindow>();
const auto *schedule = &conf.standard();
const auto * start = &conf.standard_start();
const auto * end = &conf.standard_end();
if (datetime::is_local_time_sunday()) {
schedule = &conf.sunday();
start = &conf.sunday_start();
end = &conf.sunday_end();
}
bts_assert(schedule);
int hh_start = 0, mm_start = 0, hh_end = 0, mm_end = 0;
sscanf(schedule->start().c_str(), "%i:%i", &hh_start, &mm_start);
sscanf(schedule->end().c_str(), "%i:%i", &hh_end, &mm_end);
sscanf(start->c_str(), "%i:%i", &hh_start, &mm_start);
sscanf(end->c_str(), "%i:%i", &hh_end, &mm_end);
if (datetime::is_local_time_between(hh_start, mm_start, hh_end, mm_end)) {
auto sleep_period = std::chrono::seconds(conf.delay_seconds());
LOG(md, Info, "Run::boot_sleep t_id{} t_name:{} sleep_period:{}",
@@ -53,13 +53,13 @@ ICEMain::ICEMain()
ICEMain::~ICEMain() {}
const ICEOptions::ICEChannel channel_settings_for(const ICEChannel &channel) {
const IceChannelConfig channel_settings_for(const ICEChannel &channel) {
const auto &config = config::get<ICEOptions>();
for (const auto &ch : config.channel()) {
if (ch.name() == channel.name)
return ch;
}
return ICEOptions::ICEChannel();
return {};
}
onixs_ice::MarketSubscriptions
@@ -156,20 +156,23 @@ unique_ptr<onixs_ice::Handler> ICEMain::prepare_handler(
//
// Network settings
const auto &pub_options = config::get<ICEPublisherOptions>();
if (pub_options.has_network_interface())
if (!pub_options.network_interface().empty()) {
settings.networkInterface = pub_options.network_interface();
else {
} else {
std::string inter;
if (pub_options.has_network_interface_a() &&
!pub_options.has_network_interface_b())
if (!pub_options.network_interface_a().empty() &&
pub_options.network_interface_b().empty()) {
inter = pub_options.network_interface_a();
if (!pub_options.has_network_interface_a() &&
pub_options.has_network_interface_b())
}
if (pub_options.network_interface_a().empty() &&
!pub_options.network_interface_b().empty()) {
inter = pub_options.network_interface_b();
if (pub_options.has_network_interface_a() &&
pub_options.has_network_interface_b())
}
if (!pub_options.network_interface_a().empty() &&
!pub_options.network_interface_b().empty()) {
inter = pub_options.network_interface_b() + ":" +
pub_options.network_interface_b();
}
settings.networkInterface = inter;
}
settings.udpBufferSize = options.udp_buffer_size();
@@ -196,13 +199,12 @@ unique_ptr<onixs_ice::Handler> ICEMain::prepare_handler(
options.processing_thread_affinity());
// if(options.has_track_top_of_the_book_only()
// settings.trackTopOfTheBookOnly = options.track_top_of_the_book_only();
if (options.has_receive_product_definitions_only())
settings.receiveProductDefinitionsOnly =
options.receive_product_definitions_only();
if (options.has_max_multicast_message_block_size() &&
options.max_multicast_message_block_size() > 0)
settings.receiveProductDefinitionsOnly =
options.receive_product_definitions_only();
if (options.max_multicast_message_block_size() > 0) {
settings.maxMulticastMessageBlockSize =
options.max_multicast_message_block_size();
}
if (options.product_definition_cache_directory() != "")
settings.productDefinitionCacheDirectory =
options.product_definition_cache_directory();
@@ -39,7 +39,7 @@ MDP3Main::MDP3Main()
MDP3Main::~MDP3Main() {}
const CMEOptions::CMEChannel channel_settings_for(const string &id) {
const CmeChannelConfig channel_settings_for(const string &id) {
const auto &config = config::get<CMEOptions>();
for (const auto &ch : config.channel()) {
bool found =
@@ -51,7 +51,7 @@ const CMEOptions::CMEChannel channel_settings_for(const string &id) {
return ch;
}
}
return CMEOptions::CMEChannel();
return {};
}
bool feed_engine_exists(const string &name) {
const auto &config = config::get<CMEOptions>();
@@ -63,13 +63,15 @@ bool feed_engine_exists(const string &name) {
}
const onixs::FeedEngineSettings feed_engine_settings_from_config(
const CMEOptions::FeedEngineSettings &settings, int feed_count) {
const CmeFeedEngineSettings &settings, int feed_count) {
onixs::FeedEngineSettings result;
if (settings.has_data_wait())
if (settings.data_wait() != 0) {
result.dataWaitTime(settings.data_wait());
if (settings.has_spin_time())
}
if (settings.spin_time() != 0) {
result.spinBeforeIdleTime(settings.spin_time());
}
result.socketBufferSize(settings.udp_socket_buffer_size());
@@ -79,7 +81,7 @@ const onixs::FeedEngineSettings feed_engine_settings_from_config(
}
// num_threads() overrides anything else
if (settings.has_num_threads()) {
if (settings.num_threads() != 0) {
result.threadCount(settings.num_threads());
} else {
// If num_threads is absent determine thread count based on #channels
@@ -92,7 +94,7 @@ size_t
count_engine_uses(const vector<CMEChannel> &channels, const string &feed_name) {
return count_if(channels.begin(), channels.end(), [&](const CMEChannel &ch) {
const auto &settings = channel_settings_for(ch.id);
return settings.has_feed_engine() && settings.feed_engine() == feed_name;
return settings.feed_engine() == feed_name;
});
}
@@ -226,27 +228,27 @@ MDP3Main::prepare_handler(const string &channel_id, MBOWriter *mbo) {
//
// Network settings
if (options.has_lost_packet_wait_timeout_ms()) {
if (options.lost_packet_wait_timeout_ms() != 0) {
settings.feeds().incrementalFeeds().lostPacketWaitTime(
(size_t)options.lost_packet_wait_timeout_ms() * 1000);
}
if (pub_options.has_network_interface()) {
if (!pub_options.network_interface().empty()) {
settings.feeds().feedANetworkInterfaces(pub_options.network_interface());
settings.feeds().feedBNetworkInterfaces(pub_options.network_interface());
} else {
if (pub_options.has_network_interface_a()) {
if (!pub_options.network_interface_a().empty()) {
settings.feeds().feedANetworkInterfaces(
pub_options.network_interface_a());
}
if (pub_options.has_network_interface_b()) {
if (!pub_options.network_interface_b().empty()) {
settings.feeds().feedBNetworkInterfaces(
pub_options.network_interface_b());
}
}
if (pub_options.has_network_interface() ||
(pub_options.has_network_interface_a() &&
pub_options.has_network_interface_b())) {
if (!pub_options.network_interface().empty() ||
(!pub_options.network_interface_a().empty() &&
!pub_options.network_interface_b().empty())) {
if (options.prefer_backup_feeds()) {
settings.feeds().instrumentFeeds().layout(
onixs::RecoveryFeedLayout::FeedBWithFailoverToFeedA);
@@ -264,14 +266,14 @@ MDP3Main::prepare_handler(const string &channel_id, MBOWriter *mbo) {
settings.feeds().snapshotFeeds().layout(layout);
settings.feeds().mboSnapshotFeeds().layout(layout);
}
} else if (pub_options.has_network_interface_a()) {
} else if (!pub_options.network_interface_a().empty()) {
auto layout = onixs::RecoveryFeedLayout::FeedAOnly;
settings.feeds().instrumentFeeds().layout(layout);
settings.feeds().incrementalFeeds().layout(
onixs::RealtimeFeedLayout::FeedAOnly);
settings.feeds().snapshotFeeds().layout(layout);
settings.feeds().mboSnapshotFeeds().layout(layout);
} else if (pub_options.has_network_interface_b()) {
} else if (!pub_options.network_interface_b().empty()) {
auto layout = onixs::RecoveryFeedLayout::FeedBOnly;
settings.feeds().instrumentFeeds().layout(layout);
settings.feeds().incrementalFeeds().layout(
@@ -293,7 +295,7 @@ MDP3Main::prepare_handler(const string &channel_id, MBOWriter *mbo) {
//
// Logging
onixs::Logger *logger;
if (options.onixs_log_mode() == CMEOptions_OnixSLogMode_None) {
if (options.onixs_log_mode() == CME_ONIXS_LOG_MODE_UNSPECIFIED) {
logger = new onixs::NullLogger();
} else {
onixs::FileLoggerSettings loggerSettings;
@@ -301,7 +303,7 @@ MDP3Main::prepare_handler(const string &channel_id, MBOWriter *mbo) {
loggerSettings.severityLevel(
(onixs::LogSeverity::Enum)options.onixs_log_mode());
logger = new onixs::FileLogger(loggerSettings);
if (options.onixs_log_mode() == CMEOptions::Debug) {
if (options.onixs_log_mode() == CME_ONIXS_LOG_MODE_DEBUG) {
// trace all the things
settings.debugLogging().traceBooks(true);
settings.debugLogging().traceFeeds(true);
@@ -185,8 +185,7 @@ BasePositionServiceServer::get_as_of_date(std::string const &sftp_file_name) {
const auto &sod = config::get<config::SODTime>();
try {
return datetime::make_ptime(
y, m, d, sod.sod_hh(), sod.has_sod_mm(), 0, 0);
return datetime::make_ptime(y, m, d, sod.sod_hh(), sod.sod_mm(), 0, 0);
} catch (std::out_of_range const &) {
return {};
}