diff --git a/src/client/spark/Daemons/OrderTicketDaemon.cs b/src/client/spark/Daemons/OrderTicketDaemon.cs index 70cfa834f..084eae94b 100644 --- a/src/client/spark/Daemons/OrderTicketDaemon.cs +++ b/src/client/spark/Daemons/OrderTicketDaemon.cs @@ -38,7 +38,7 @@ namespace bts.shell { [ImportingConstructor] public OrderTicketDaemon(IBus bus, OrdersModel model, UserSettingsHub settings_hub, ErrorReporter error_reporter) - : this(bus, model, settings_hub, error_reporter, Configuration.get().close_on_send) { } + : this(bus, model, settings_hub, error_reporter, Configuration.get().CloseOnSend) { } public OrderTicketDaemon(IBus bus, OrdersModel model, UserSettingsHub settings_hub, ErrorReporter error_reporter, bool close_on_send) { _bus = bus; diff --git a/src/client/spark/Daemons/ShellLatencyDaemon.cs b/src/client/spark/Daemons/ShellLatencyDaemon.cs index 195c4a19c..806575cdc 100644 --- a/src/client/spark/Daemons/ShellLatencyDaemon.cs +++ b/src/client/spark/Daemons/ShellLatencyDaemon.cs @@ -1,107 +1,113 @@ -using bts.api.core; -using bts.metrics; - -using mbts.config; -using mbts.ui; - -using Spark.Core.Disposables; - -using System; -using System.Composition; -using System.Linq; -using System.Net.NetworkInformation; -using System.Threading.Tasks; - -namespace bts.perf { - [Export, Export(typeof(IShellDaemon))] - class ShellLatencyDaemon : IShellDaemon, IDisposable { - readonly ShellLatencyService _service; - readonly string _hostname; - readonly string _version; - readonly string _username; - IDisposable _subs; - Ping _pinger = new Ping(); - - [ImportingConstructor] - public ShellLatencyDaemon(ShellLatencyService service, Lazy user) { - _service = service; - _version = Configuration.get().Version; - _username = user.Value.name; - _hostname = Environment.MachineName; - - _forever_ping_host(_pinger); - _subs = Disposable.Create( - _pinger, - _service.subscribei_clock().Subscribe(on_tick) - ); - } - - void on_tick(Update update) { - if (update.added.Any()) { - var tick = update.added.Last(); - _service.report_async(new Report() { - HostName = _hostname, - Version = _version, - User = _username, - Timestamp = tick.Timestamp - }); - } - } - - async void _forever_ping_host(Ping pinger) { - var config = Configuration.get(); - string server_ip = Configuration.get().ConfigIp; - int delay = config.workloop_milliseconds_interval; - int _current_missed_ping_count = 0; - - if (config.shell_ping_is_enabled && pinger != null) { - while (true) { - try { - await Task.Delay(delay); - var response = await pinger.SendPingAsync(server_ip, config.timeout_milliseconds_threshold); - if (response.Status == IPStatus.Success) { - _current_missed_ping_count = 0; - if (response.RoundtripTime > config.logging_milliseconds_threshold) { - Log.Ui.warn($"Ping response not received in a timely manner:\n" + - $"\tAddress:\t{response.Address}\n" + - $"\tRoundTrip:\t{response.RoundtripTime} ms"); - } - // potentially reset delay to initial work period (no-op otherwise) - delay = config.workloop_milliseconds_interval; - } else { - _current_missed_ping_count++; - delay = _get_exp_delay(_current_missed_ping_count, config.workloop_milliseconds_interval, config.maximum_backoff_milliseconds); - Log.Ui.warn($"Ping was not successful. Ping response: {response.Status}. Missed ping count: {_current_missed_ping_count}. Backing off for {delay} milliseconds."); - } - } catch (PingException e) { - _current_missed_ping_count++; - delay = _get_exp_delay(_current_missed_ping_count, config.workloop_milliseconds_interval, config.maximum_backoff_milliseconds); - Log.Ui.error($"Ping exception. {e}\nBacking off for {delay} milliseconds."); - } - } // end while - } - - // since we're returning milliseconds here up to a 1 minute delay - // we don't need to go crazy with the power, else we will get - // an ArgumentOutOfRangeExecption. - // Int.MaxValue = 2^31, so we need to be below that - // Also, even if we're under the 2^31 int.maxvalue, we don't want to be multed over it - // so that is why we have checked() here. - int _get_exp_delay(int retry_num, int min_interval, int max_delay) { - // add some jitter up to half the max delay so we don't - // have a ping spike from all clients at once - var jitter_amount = new Random().Next(max_delay / 2); - int power_factor = (int)Math.Pow(2, Math.Min(retry_num, 32) - 1); - try { - return Math.Min(checked(min_interval * power_factor + jitter_amount), max_delay + jitter_amount); - } catch (OverflowException) { - return max_delay + jitter_amount; - } - } - } - - public void Dispose() { - Disposable.dispose(ref _subs); - } - } -} +using bts.api.core; +using bts.metrics; + +using mbts.config; +using mbts.ui; + +using Spark.Core.Disposables; + +using System; +using System.Composition; +using System.Linq; +using System.Net.NetworkInformation; +using System.Threading.Tasks; + +namespace bts.perf { + [Export, Export(typeof(IShellDaemon))] + class ShellLatencyDaemon : IShellDaemon, IDisposable { + readonly ShellLatencyService _service; + readonly string _hostname; + readonly string _version; + readonly string _username; + IDisposable _subs; + Ping _pinger = new Ping(); + + [ImportingConstructor] + public ShellLatencyDaemon(ShellLatencyService service, Lazy user) { + _service = service; + _version = Configuration.get().Version; + _username = user.Value.name; + _hostname = Environment.MachineName; + + _forever_ping_host(_pinger); + _subs = Disposable.Create( + _pinger, + _service.subscribei_clock().Subscribe(on_tick) + ); + } + + void on_tick(Update update) { + if (update.added.Any()) { + var tick = update.added.Last(); + _service.report_async(new Report() { + HostName = _hostname, + Version = _version, + User = _username, + Timestamp = tick.Timestamp + }); + } + } + + async void _forever_ping_host(Ping pinger) { + var config = Configuration.get(); + string server_ip = Configuration.get().ConfigIp; + int delay = config.WorkloopMillisecondsInterval; + int _current_missed_ping_count = 0; + + if (config.ShellPingIsEnabled && pinger != null) { + while (true) { + try { + await Task.Delay(delay); + var response = await pinger.SendPingAsync(server_ip, config.TimeoutMillisecondsThreshold); + if (response.Status == IPStatus.Success) { + _current_missed_ping_count = 0; + if (response.RoundtripTime > config.LoggingMillisecondsThreshold) { + Log.Ui.warn($"Ping response not received in a timely manner:\n" + + $"\tAddress:\t{response.Address}\n" + + $"\tRoundTrip:\t{response.RoundtripTime} ms"); + } + // potentially reset delay to initial work period (no-op otherwise) + delay = config.WorkloopMillisecondsInterval; + } else { + _current_missed_ping_count++; + delay = _get_exp_delay( + _current_missed_ping_count, + config.WorkloopMillisecondsInterval, + config.MaximumBackoffMilliseconds); + Log.Ui.warn($"Ping was not successful. Ping response: {response.Status}. Missed ping count: {_current_missed_ping_count}. Backing off for {delay} milliseconds."); + } + } catch (PingException e) { + _current_missed_ping_count++; + delay = _get_exp_delay( + _current_missed_ping_count, + config.WorkloopMillisecondsInterval, + config.MaximumBackoffMilliseconds); + Log.Ui.error($"Ping exception. {e}\nBacking off for {delay} milliseconds."); + } + } // end while + } + + // since we're returning milliseconds here up to a 1 minute delay + // we don't need to go crazy with the power, else we will get + // an ArgumentOutOfRangeExecption. + // Int.MaxValue = 2^31, so we need to be below that + // Also, even if we're under the 2^31 int.maxvalue, we don't want to be multed over it + // so that is why we have checked() here. + int _get_exp_delay(int retry_num, int min_interval, int max_delay) { + // add some jitter up to half the max delay so we don't + // have a ping spike from all clients at once + var jitter_amount = new Random().Next(max_delay / 2); + int power_factor = (int)Math.Pow(2, Math.Min(retry_num, 32) - 1); + try { + return Math.Min(checked(min_interval * power_factor + jitter_amount), max_delay + jitter_amount); + } catch (OverflowException) { + return max_delay + jitter_amount; + } + } + } + + public void Dispose() { + Disposable.dispose(ref _subs); + } + } +} diff --git a/src/client/spark/Modules/Analytics/VolSurface/VolSurfaceWindow.cs b/src/client/spark/Modules/Analytics/VolSurface/VolSurfaceWindow.cs index 89c23cc35..e9462c96a 100644 --- a/src/client/spark/Modules/Analytics/VolSurface/VolSurfaceWindow.cs +++ b/src/client/spark/Modules/Analytics/VolSurface/VolSurfaceWindow.cs @@ -28,7 +28,7 @@ public override string window_type => WINDOW_TYPE; string ISharedWindow.thread_id => - config.Configuration.get().vol_surface ? "VolSurface" : null; + config.Configuration.get().VolSurface ? "VolSurface" : null; public int vs_id => _startup_data.id; public string vs_name { get; } diff --git a/src/client/spark/Modules/Market/MarketView/MarketViewWindow.cs b/src/client/spark/Modules/Market/MarketView/MarketViewWindow.cs index d01565ea0..2f9cbb4f2 100644 --- a/src/client/spark/Modules/Market/MarketView/MarketViewWindow.cs +++ b/src/client/spark/Modules/Market/MarketView/MarketViewWindow.cs @@ -67,7 +67,8 @@ namespace mbts.spark { _settings_hub = settings_hub; _settings_manager = settings_hub.create_mview_settings_manager(state.grid); Icon.Freeze(); - thread_id = config.Configuration.get().market_view ? "MarketView" : null; + thread_id = config.Configuration.get().MarketView ? + "MarketView" : null; _dispose = Disposable.Create(() => { Disposable.dispose(ref _subscriptions); _vm.Dispose(); diff --git a/src/client/spark/Modules/Market/TimeAndSalesWindowFactory.cs b/src/client/spark/Modules/Market/TimeAndSalesWindowFactory.cs index 9190d0a61..33f5cb1dc 100644 --- a/src/client/spark/Modules/Market/TimeAndSalesWindowFactory.cs +++ b/src/client/spark/Modules/Market/TimeAndSalesWindowFactory.cs @@ -44,7 +44,7 @@ public override Task load(TimeAndSalesSettings state) { var conf = Configuration.get(); - var thread_id = Configuration.get().time_and_sales ? + var thread_id = Configuration.get().TimeAndSales ? TimeAndSalesWindow.WINDOW_TYPE_NAME : null; var settings_man = new WindowSettingsManager( _settings_hub, state.grid, s => s.time_and_sales_grid, (s, g) => s.with(time_and_sales: g)); @@ -54,7 +54,7 @@ _consumer, state, settings_man, - conf.can_pause_updates, + conf.CanPauseUpdates, _security_auxiliary_model.get_display_quantity_divisor, thread_id); return Task.FromResult(win); diff --git a/src/client/spark/Modules/ShellModuleCollection.cs b/src/client/spark/Modules/ShellModuleCollection.cs index 15c8e6c21..e4eecf5f8 100644 --- a/src/client/spark/Modules/ShellModuleCollection.cs +++ b/src/client/spark/Modules/ShellModuleCollection.cs @@ -26,9 +26,9 @@ namespace bts { static bool _is_hidden(IShellModule module) { var props = Configuration.get(); string name = module.GetType().Name; - foreach (var p in props.module) { - if (p.name.ToLower() == name.ToLower()) { - return !p.visible; + foreach (var p in props.Module) { + if (p.Name.ToLower() == name.ToLower()) { + return !p.Visible; } } return false; diff --git a/src/client/spark/Modules/Spreader/SyntheticManagementWindow.cs b/src/client/spark/Modules/Spreader/SyntheticManagementWindow.cs index d0fdef973..3165cbf6c 100644 --- a/src/client/spark/Modules/Spreader/SyntheticManagementWindow.cs +++ b/src/client/spark/Modules/Spreader/SyntheticManagementWindow.cs @@ -43,7 +43,7 @@ namespace mbts.spark { _state = state; _settings_manager = settings_manager; Icon.Freeze(); - thread_id = config.Configuration.get().synthetic_management ? + thread_id = config.Configuration.get().SyntheticManagement ? "SyntheticManagement" : null; _dispose = Disposable.Create(() => { Disposable.dispose(ref _vm); diff --git a/src/client/spark/Modules/Trading/AlgoStudio/AlgoStudioWindow.cs b/src/client/spark/Modules/Trading/AlgoStudio/AlgoStudioWindow.cs index 83bdd1bcd..92a2ea2ab 100644 --- a/src/client/spark/Modules/Trading/AlgoStudio/AlgoStudioWindow.cs +++ b/src/client/spark/Modules/Trading/AlgoStudio/AlgoStudioWindow.cs @@ -43,7 +43,8 @@ namespace mbts.spark { : base(NAME, bus, factory, SparkCommands.ShowAlgoStudio.icon) { _model = model; _state = state; - thread_id = config.Configuration.get().algo_studio ? "AlgoStudio" : null; + thread_id = config.Configuration.get().AlgoStudio ? + "AlgoStudio" : null; _dispose = Disposable.Create(_dispose_core); } @@ -74,12 +75,12 @@ namespace mbts.spark { _commands.Add(new SparkCommandCommand("Add Algo", Icons.AddBoxes, _vm.add_definition_cmd)); _commands.Add(new SparkCommandCommand("Clone Algo", Icons.CopyBoxes, _vm.clone_selected_definition_cmd)); _commands.Add(new SparkCommandCommand("Save Algo", Icons.DiskFile, _vm.save_cmd) { - show_in_toolbar = _ui_configuration.can_save_specific + show_in_toolbar = _ui_configuration.CanSaveSpecific }); _commands.Add(new SparkCommandCommand("Save All", Icons.Disk, ObservantAsyncCommand.create(_vm.save_all, out var save_all_observer))); _resources.Add(_vm.subscribe_dirty().OnDispatcher().Subscribe(save_all_observer)); // undo/redo - if (_ui_configuration.can_undo_redo) { + if (_ui_configuration.CanUndoRedo) { // undo var undo_cmd = new ObservantCommand(() => _vm.selected_definition?.try_undo()); var undo_spark_cmd = new SparkCommandCommand("Undo", Icons.UndoCircular, undo_cmd); diff --git a/src/client/spark/Modules/Trading/AlgoStudio/Model/IAlgoStudioModel.cs b/src/client/spark/Modules/Trading/AlgoStudio/Model/IAlgoStudioModel.cs index 7adadaa41..af2fe078f 100644 --- a/src/client/spark/Modules/Trading/AlgoStudio/Model/IAlgoStudioModel.cs +++ b/src/client/spark/Modules/Trading/AlgoStudio/Model/IAlgoStudioModel.cs @@ -17,10 +17,10 @@ namespace mbts.spark { static class AlgoStudioModelUtils { public static IReadOnlyDictionary get_dynamic_resources(bts.config.AlgoStudioOptions ui_configuration) => new Dictionary { - { AlgoStudioWindow.ShowAlgoToolBarRenameDefinitionKey, ui_configuration.can_modify_definition_name && ui_configuration.show_algo_toolbar_rename }, - { AlgoStudioWindow.ShowAlgoToolBarSaveDefinitionKey, ui_configuration.can_modify_definition_values && ui_configuration.show_algo_toolbar_save }, - { AlgoStudioWindow.ShowAlgoToolBarRevertDefinitionKey, ui_configuration.show_algo_toolbar_revert }, - { AlgoStudioWindow.ShowAlgoToolBarUndoRedoDefinitionKey, ui_configuration.show_algo_toolbar_undo_redo } + { AlgoStudioWindow.ShowAlgoToolBarRenameDefinitionKey, ui_configuration.CanModifyDefinitionName && ui_configuration.ShowAlgoToolbarRename }, + { AlgoStudioWindow.ShowAlgoToolBarSaveDefinitionKey, ui_configuration.CanModifyDefinitionValues && ui_configuration.ShowAlgoToolbarSave }, + { AlgoStudioWindow.ShowAlgoToolBarRevertDefinitionKey, ui_configuration.ShowAlgoToolbarRevert }, + { AlgoStudioWindow.ShowAlgoToolBarUndoRedoDefinitionKey, ui_configuration.ShowAlgoToolbarUndoRedo } }; } } diff --git a/src/client/spark/Modules/Trading/AlgoStudio/VM/AlgoDefinitionVM.cs b/src/client/spark/Modules/Trading/AlgoStudio/VM/AlgoDefinitionVM.cs index 9c6ec2980..5f916b221 100644 --- a/src/client/spark/Modules/Trading/AlgoStudio/VM/AlgoDefinitionVM.cs +++ b/src/client/spark/Modules/Trading/AlgoStudio/VM/AlgoDefinitionVM.cs @@ -69,9 +69,9 @@ namespace mbts.spark { _permissions_mask.mask = init_permissions; _permissions_mask.raw = init_permissions; var resources = new List(); - if (!model.algo_model.ui_configuration.can_modify_definition_values) + if (!model.algo_model.ui_configuration.CanModifyDefinitionValues) editing_permissions_mask ^= (AlgoEditingPermissions.AllowEditValues | AlgoEditingPermissions.AllowSaveValues); - if (!model.algo_model.ui_configuration.can_modify_definition_structure) + if (!model.algo_model.ui_configuration.CanModifyDefinitionStructure) editing_permissions_mask ^= (AlgoEditingPermissions.AllowEditStructure | AlgoEditingPermissions.AllowSaveStructure); key = def_data.key; algos_view = ObservableAutoWrapper.create_sorted_wrapper(_algo_roots, AlgoCollectionHelper.algo_vm_comparer); @@ -132,7 +132,11 @@ namespace mbts.spark { case AlgoKey.Mode.Persisted: _metadata = new AlgoDefinitionMetadata(key); resources.Add(model.algo_model.metadata_service.subscribe_metadata(key).OnDispatcher().Subscribe(_on_metadata)); - _edit_pane_vs_model.set_state(VisualStateNames.Name.GroupName, conf.can_modify_definition_name ? VisualStateNames.Name.Active : VisualStateNames.Name.CannotRenameDefinition); + _edit_pane_vs_model.set_state( + VisualStateNames.Name.GroupName, + conf.CanModifyDefinitionName ? + VisualStateNames.Name.Active : + VisualStateNames.Name.CannotRenameDefinition); break; case AlgoKey.Mode.Factory: _edit_pane_vs_model.set_state(VisualStateNames.Name.GroupName, VisualStateNames.Name.Inactive); diff --git a/src/client/spark/Modules/Trading/DayFills/DayFillsWindow.cs b/src/client/spark/Modules/Trading/DayFills/DayFillsWindow.cs index cfc898df0..0a5cfa3d9 100644 --- a/src/client/spark/Modules/Trading/DayFills/DayFillsWindow.cs +++ b/src/client/spark/Modules/Trading/DayFills/DayFillsWindow.cs @@ -56,7 +56,7 @@ namespace Spark.Trading { IWindowSettingsManager settings_manager, UserTuple user) : base(WINDOW_TITLE, bus, save, Icons.DayFills) { - thread_id = Configuration.get().day_fills ? + thread_id = Configuration.get().DayFills ? WINDOW_TYPE_NAME : null; _position_model = position_model; _security_metadata = security_metadata; diff --git a/src/client/spark/Modules/Trading/Fills/FillsWindow.cs b/src/client/spark/Modules/Trading/Fills/FillsWindow.cs index bdb9683b4..92e6e751d 100644 --- a/src/client/spark/Modules/Trading/Fills/FillsWindow.cs +++ b/src/client/spark/Modules/Trading/Fills/FillsWindow.cs @@ -40,7 +40,8 @@ namespace mbts.spark { _orders_model = orders_model; _state = state; _settings_manager = settings_manager; - thread_id = config.Configuration.get().fills ? "Fills" : null; + thread_id = config.Configuration.get().Fills ? + "Fills" : null; _dispose = Disposable.Create(() => { if (_commands != null) { _commands.OfType().DisposeAll(); diff --git a/src/client/spark/Modules/Trading/Ladder/LadderSettings.cs b/src/client/spark/Modules/Trading/Ladder/LadderSettings.cs index 0db140d31..d73cfb050 100644 --- a/src/client/spark/Modules/Trading/Ladder/LadderSettings.cs +++ b/src/client/spark/Modules/Trading/Ladder/LadderSettings.cs @@ -573,7 +573,7 @@ namespace mbts.spark { static LadderSettings() { var knobs = config.Configuration.get(); - mimic_tt = knobs.mimic_tt; + mimic_tt = knobs.MimicTt; } // Default proto constructor diff --git a/src/client/spark/Modules/Trading/Ladder/LadderWindowFactory.cs b/src/client/spark/Modules/Trading/Ladder/LadderWindowFactory.cs index bddeab924..4e202def8 100644 --- a/src/client/spark/Modules/Trading/Ladder/LadderWindowFactory.cs +++ b/src/client/spark/Modules/Trading/Ladder/LadderWindowFactory.cs @@ -58,7 +58,7 @@ _sec_meta_store = sec_meta_store; _ladder_conf = new LadderConfig( Configuration.get(), - Configuration.get().ladder); + Configuration.get().Ladder); _thread_id_provider = ShellWindowThreadIDFactory.create(_window_type, _ladder_conf.ladders_on_threads); _mbo = mbo; _dispose = Disposable.Create( @@ -117,10 +117,10 @@ public readonly TimeSpan security_timeout; public LadderConfig(bts.config.LadderKnobs knobs, bool ladders_on_threads) { - max_open_ladders = knobs.max_open_ladders; - open_algo_popup_on_select = knobs.open_algo_popup_on_select; - use_algo_param_grid = knobs.use_algo_param_grid; - security_timeout = TimeSpan.FromSeconds(Math.Max(15, knobs.security_timeout_secs)); + max_open_ladders = knobs.MaxOpenLadders; + open_algo_popup_on_select = knobs.OpenAlgoPopupOnSelect; + use_algo_param_grid = knobs.UseAlgoParamGrid; + security_timeout = TimeSpan.FromSeconds(Math.Max(15, knobs.SecurityTimeoutSecs)); this.ladders_on_threads = ladders_on_threads; } } diff --git a/src/client/spark/Modules/Trading/Ladder/View/LadderGridHost.cs b/src/client/spark/Modules/Trading/Ladder/View/LadderGridHost.cs index daae5e32d..8ad25b3d7 100644 --- a/src/client/spark/Modules/Trading/Ladder/View/LadderGridHost.cs +++ b/src/client/spark/Modules/Trading/Ladder/View/LadderGridHost.cs @@ -103,16 +103,18 @@ namespace mbts.spark { static LadderGridHost() { var knobs = config.Configuration.get(); - _show_scrollbar = knobs.show_scrollbar; - _lighten_market_cells = knobs.lighten_market_cells; - _initial_row_count = (int)knobs.scrollable_tick_window_size; + _show_scrollbar = knobs.ShowScrollbar; + _lighten_market_cells = knobs.LightenMarketCells; + _initial_row_count = (int)knobs.ScrollableTickWindowSize; // For market cell backgrounds, 0 means null. Note that the full // range of colors can still be expressed, as zero is merely one of // 2^24 possible representations of 'transparent.' - if (knobs.bid_market_cell_background != 0) + if (knobs.BidMarketCellBackground != 0) { _bid_market_cell_background = BTSColors.Ladder.bid_column_background; - if (knobs.ask_market_cell_background != 0) + } + if (knobs.AskMarketCellBackground != 0) { _ask_market_cell_background = BTSColors.Ladder.ask_column_background; + } } public LadderGridHost() { diff --git a/src/client/spark/Modules/Trading/Ladder/View/LadderView.xaml.cs b/src/client/spark/Modules/Trading/Ladder/View/LadderView.xaml.cs index c094f59f1..2782e99eb 100644 --- a/src/client/spark/Modules/Trading/Ladder/View/LadderView.xaml.cs +++ b/src/client/spark/Modules/Trading/Ladder/View/LadderView.xaml.cs @@ -29,7 +29,7 @@ namespace mbts.spark { static LadderView() { var knobs = config.Configuration.get(); - MimicTT = knobs.mimic_tt; + MimicTT = knobs.MimicTt; } public static bool MimicTT { get; } diff --git a/src/client/spark/Modules/Trading/ManualFills/ManualFillsWindowFactory.cs b/src/client/spark/Modules/Trading/ManualFills/ManualFillsWindowFactory.cs index 535bbab68..307aceae1 100644 --- a/src/client/spark/Modules/Trading/ManualFills/ManualFillsWindowFactory.cs +++ b/src/client/spark/Modules/Trading/ManualFills/ManualFillsWindowFactory.cs @@ -54,9 +54,9 @@ namespace Spark.Trading { public bool modal_transactions { get; } public static ManualFillsConfig read() => new( - mbts.config.Configuration.get().manual_fills ? + mbts.config.Configuration.get().ManualFills ? ManualFillsWindow.WINDOW_TYPE_NAME : null, - mbts.config.Configuration.get().modal_transactions); + mbts.config.Configuration.get().ModalTransactions); } } } diff --git a/src/client/spark/Modules/Trading/OpenOrders/OpenOrdersWindow.cs b/src/client/spark/Modules/Trading/OpenOrders/OpenOrdersWindow.cs index 84d4a6144..b60b055a1 100644 --- a/src/client/spark/Modules/Trading/OpenOrders/OpenOrdersWindow.cs +++ b/src/client/spark/Modules/Trading/OpenOrders/OpenOrdersWindow.cs @@ -50,7 +50,7 @@ namespace Spark.Trading { OpenOrdersSettings settings, IWindowSettingsManager settings_manager) : base(WINDOW_TITLE, bus, save, Icons.open_orders) { - thread_id = Configuration.get().open_orders ? + thread_id = Configuration.get().OpenOrders ? WINDOW_TYPE_NAME : null; _orders_model = orders_model; _security_metadata = security_metadata; diff --git a/src/client/spark/Modules/Trading/OrderBook/OrderBookColumns.cs b/src/client/spark/Modules/Trading/OrderBook/OrderBookColumns.cs index 6c5d23eb7..f02bfb6f9 100644 --- a/src/client/spark/Modules/Trading/OrderBook/OrderBookColumns.cs +++ b/src/client/spark/Modules/Trading/OrderBook/OrderBookColumns.cs @@ -1342,7 +1342,8 @@ namespace mbts.spark { Brushes.Transparent : BTSColors.Orders.working_order_background); - static readonly bool _animate_child_order_rows = mbts.config.Configuration.get().animate_child_order_rows; + static readonly bool _animate_child_order_rows = + mbts.config.Configuration.get().AnimateChildOrderRows; public static BindingBase _get_background_binding() { var mb = new MultiBinding { Converter = _background_converter }; diff --git a/src/client/spark/Modules/Trading/OrderBook/OrderBookVM.cs b/src/client/spark/Modules/Trading/OrderBook/OrderBookVM.cs index d5cc117e1..152441a5b 100644 --- a/src/client/spark/Modules/Trading/OrderBook/OrderBookVM.cs +++ b/src/client/spark/Modules/Trading/OrderBook/OrderBookVM.cs @@ -1050,11 +1050,11 @@ namespace mbts.spark { var top = config.Configuration.get(); var offset = config.Configuration.get(); _algo_type_conf = new Dictionary { - { CustomOrderDefinition.CustomOneofCase.Cover, (cover.show_price, cover.show_quantity) }, - { CustomOrderDefinition.CustomOneofCase.Join, (join.show_price, join.show_quantity) }, - { CustomOrderDefinition.CustomOneofCase.Lean, (lean.show_price, lean.show_quantity) }, - { CustomOrderDefinition.CustomOneofCase.Top, (top.show_price, top.show_quantity) }, - { CustomOrderDefinition.CustomOneofCase.Offset, (offset.show_price, offset.show_quantity) } + { CustomOrderDefinition.CustomOneofCase.Cover, (cover.ShowPrice, cover.ShowQuantity) }, + { CustomOrderDefinition.CustomOneofCase.Join, (join.ShowPrice, join.ShowQuantity) }, + { CustomOrderDefinition.CustomOneofCase.Lean, (lean.ShowPrice, lean.ShowQuantity) }, + { CustomOrderDefinition.CustomOneofCase.Top, (top.ShowPrice, top.ShowQuantity) }, + { CustomOrderDefinition.CustomOneofCase.Offset, (offset.ShowPrice, offset.ShowQuantity) } }; } diff --git a/src/client/spark/Modules/Trading/OrderBook/OrderBookWindow.cs b/src/client/spark/Modules/Trading/OrderBook/OrderBookWindow.cs index 8bbc49324..3654d4b5e 100644 --- a/src/client/spark/Modules/Trading/OrderBook/OrderBookWindow.cs +++ b/src/client/spark/Modules/Trading/OrderBook/OrderBookWindow.cs @@ -70,7 +70,8 @@ namespace mbts.spark { _state = state; _settings_manager = settings_manager; _can_edit_specific_algo_params = can_edit_specific_algo_params; - thread_id = config.Configuration.get().order_book ? "OrderBook" : null; + thread_id = config.Configuration.get().OrderBook ? + "OrderBook" : null; _dispose = Disposable.Create(() => { _thread_init_resources.DisposeAll(true); Disposable.dispose(ref _attachment_exit_sub); diff --git a/src/client/spark/Modules/Trading/OrderBook/OrderBookWindowFactory.cs b/src/client/spark/Modules/Trading/OrderBook/OrderBookWindowFactory.cs index 501c0e76b..6c82a26ab 100644 --- a/src/client/spark/Modules/Trading/OrderBook/OrderBookWindowFactory.cs +++ b/src/client/spark/Modules/Trading/OrderBook/OrderBookWindowFactory.cs @@ -35,7 +35,7 @@ namespace bts.shell { ISecurityMetadataStore sec_meta_store, UserSettingsHub settings_hub) : base(owner, "SparkOrderBookWindow") { var raw_config = Configuration.get(); - _config = new OrderBookConfig(raw_config.can_edit_specific_algo_params); + _config = new OrderBookConfig(raw_config.CanEditSpecificAlgoParams); _bus = bus; _notification_service = notification_service; _notification_service_data_cache = notification_service_data_cache; diff --git a/src/client/spark/Modules/Trading/OrderBook/View/OrderBookGridView.xaml.cs b/src/client/spark/Modules/Trading/OrderBook/View/OrderBookGridView.xaml.cs index 9afde67ef..d02e0ffc5 100644 --- a/src/client/spark/Modules/Trading/OrderBook/View/OrderBookGridView.xaml.cs +++ b/src/client/spark/Modules/Trading/OrderBook/View/OrderBookGridView.xaml.cs @@ -70,7 +70,7 @@ namespace mbts.spark { var bg_binding = new MultiBinding(); bg_binding.Bindings.Add(new Binding(nameof(OrderBookRowVM.status))); bg_binding.Bindings.Add(new Binding(nameof(ListBoxItem.IsSelected)) { RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(ListBoxItem), 1) }); - double overlay_opacity = config.Configuration.get().status_color_opacity_when_selected; + double overlay_opacity = config.Configuration.get().StatusColorOpacityWhenSelected; if (overlay_opacity > 0.1 && overlay_opacity < 0.9) { bg_binding.Converter = ValueConverter.create((status, is_selected) => { var color = _status_color(status); diff --git a/src/client/spark/Modules/Trading/PNL/PNLWindow.cs b/src/client/spark/Modules/Trading/PNL/PNLWindow.cs index 8a30710b2..8041d0595 100644 --- a/src/client/spark/Modules/Trading/PNL/PNLWindow.cs +++ b/src/client/spark/Modules/Trading/PNL/PNLWindow.cs @@ -82,7 +82,7 @@ namespace bts.shell { _settings = settings; _pnl_conf = pnl_conf ?? new(Configuration.get()); int window_id = Interlocked.Increment(ref _window_id_counter); - thread_id = Configuration.get().pnl ? + thread_id = Configuration.get().Pnl ? WINDOW_TYPE : null; _logger = new LoggerContext(Log.Ui, $"[{WINDOW_TYPE}_{window_id}] ", null); _dispose = Disposable.Create(dispose); diff --git a/src/client/spark/Modules/Trading/PNL/PNLWindowFactory.cs b/src/client/spark/Modules/Trading/PNL/PNLWindowFactory.cs index 6774c55ed..1adddd3f1 100644 --- a/src/client/spark/Modules/Trading/PNL/PNLWindowFactory.cs +++ b/src/client/spark/Modules/Trading/PNL/PNLWindowFactory.cs @@ -46,7 +46,7 @@ namespace bts.shell { _position_model = position_model; _sec_meta_store = sec_meta_store; _pnl_conf = new PNLConfig(Configuration.get()); - _thread_id_provider = ShellWindowThreadIDFactory.create(_window_type, Configuration.get().pnl); + _thread_id_provider = ShellWindowThreadIDFactory.create(_window_type, Configuration.get().Pnl); _dispose = bus.subscribe(SparkTags.ShowPNLTag).OnDispatcher().Subscribe(_show); } @@ -76,8 +76,8 @@ namespace bts.shell { show_pause_resume; public PNLConfig(bts.config.PNLOptions options) { - enable_animations = options.enable_animations; - show_pause_resume = options.show_pause_resume; + enable_animations = options.EnableAnimations; + show_pause_resume = options.ShowPauseResume; } } diff --git a/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportWindow.cs b/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportWindow.cs index deb857a95..2fce51767 100644 --- a/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportWindow.cs +++ b/src/client/spark/Modules/Trading/ReconcileReport/ReconcileReportWindow.cs @@ -52,7 +52,7 @@ namespace Spark.Trading { IWindowSettingsManager settings_manager, UserTuple user) : base("Reconcile Report", bus, save, Icons.Reports) { - thread_id = Configuration.get().reconcile_report ? + thread_id = Configuration.get().ReconcileReport ? WINDOW_TYPE_NAME : null; _position_model = position_model; _security_metadata = security_metadata; diff --git a/src/client/spark/Predicates/Data/Events/OrderSentEventPredicate.cs b/src/client/spark/Predicates/Data/Events/OrderSentEventPredicate.cs index 32e14002b..13c572987 100644 --- a/src/client/spark/Predicates/Data/Events/OrderSentEventPredicate.cs +++ b/src/client/spark/Predicates/Data/Events/OrderSentEventPredicate.cs @@ -34,7 +34,8 @@ class OrderSentEventPredicate : IEquatable { static readonly int _type_hash = typeof(OrderSentEventPredicate).GetHashCode(); // arbitrary short time period (can override in config) - static readonly TimeSpan _stale_order_threshold = TimeSpan.FromSeconds(config.Configuration.get().stale_order_threshold_seconds); + static readonly TimeSpan _stale_order_threshold = TimeSpan.FromSeconds( + config.Configuration.get().StaleOrderThresholdSeconds); public enum PredicateTypeOneofCase { [Description("(any order)")] diff --git a/src/client/spark/Risk/Combo/ComboReportWindow.cs b/src/client/spark/Risk/Combo/ComboReportWindow.cs index f98c79772..e358f5423 100644 --- a/src/client/spark/Risk/Combo/ComboReportWindow.cs +++ b/src/client/spark/Risk/Combo/ComboReportWindow.cs @@ -30,7 +30,7 @@ namespace mbts.analytics { IBus bus, ISaveWindow save, ComboReportSettings settings) : base(settings.id.ToString(), bus, save, Icons.Reports) { - thread_id = config.Configuration.get().combo_report ? + thread_id = config.Configuration.get().ComboReport ? "Combo" : null; _settings = settings; _dispose = Disposable.Create(() => (_vm, _model)); diff --git a/src/client/spark/Risk/Slide/SlideReportWindow.cs b/src/client/spark/Risk/Slide/SlideReportWindow.cs index ec69f6e2d..5e589ddb4 100644 --- a/src/client/spark/Risk/Slide/SlideReportWindow.cs +++ b/src/client/spark/Risk/Slide/SlideReportWindow.cs @@ -35,7 +35,7 @@ namespace mbts.analytics { ISaveWindow save, SlideReportSettings settings) : base(settings.id.ToString(), bus, save, Icons.Reports) { - thread_id = config.Configuration.get().slide_report ? "Slide" : null; + thread_id = config.Configuration.get().SlideReport ? "Slide" : null; _settings = settings; _dispose = Disposable.Create(() => Disposable.dispose(ref _vm)); } diff --git a/src/client/spark/Security/ISecurityAuxiliaryDataModel.cs b/src/client/spark/Security/ISecurityAuxiliaryDataModel.cs index c59ddc197..8fab0eb7a 100644 --- a/src/client/spark/Security/ISecurityAuxiliaryDataModel.cs +++ b/src/client/spark/Security/ISecurityAuxiliaryDataModel.cs @@ -28,9 +28,9 @@ namespace mbts.spark { public SecurityAuxiliaryDataModel() { var sym_config = Configuration.get(); - var sym_config_items = Configuration.get().items; + var sym_config_items = Configuration.get().Items; foreach (var item in sym_config_items) - _auxiliary_data[item.symbol] = new SecurityAuxiliaryData(item.display_quantity_divisor); + _auxiliary_data[item.Symbol] = new SecurityAuxiliaryData(item.DisplayQuantityDivisor); } public SecurityAuxiliaryData? get_auxiliary_data(SecurityImmutable security) => diff --git a/src/client/spark/ShellBootstrapper.cs b/src/client/spark/ShellBootstrapper.cs index 42337e578..6ee1fd6f1 100644 --- a/src/client/spark/ShellBootstrapper.cs +++ b/src/client/spark/ShellBootstrapper.cs @@ -91,7 +91,7 @@ } public override void CreateShell(ShellModel model) { - if (Configuration.get().software_only) { + if (Configuration.get().SoftwareOnly) { System.Windows.Media.RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly; } diff --git a/src/client/spark/view/Shell/Workspaces/WorkspacesModel.cs b/src/client/spark/view/Shell/Workspaces/WorkspacesModel.cs index a9431c9ed..3c4d8a775 100644 --- a/src/client/spark/view/Shell/Workspaces/WorkspacesModel.cs +++ b/src/client/spark/view/Shell/Workspaces/WorkspacesModel.cs @@ -128,7 +128,7 @@ namespace mbts.ui.shell { } public async void save_workspace_periodically() { - TimeSpan interval = TimeSpan.FromSeconds(Configuration.get().save_timer); + TimeSpan interval = TimeSpan.FromSeconds(Configuration.get().SaveTimer); await Task.Delay(interval); while (!_closing) { var workspace = await get_workspace_async(); diff --git a/src/client/spark/view/Spark/Ladder/MBO/MBOPopupModel.cs b/src/client/spark/view/Spark/Ladder/MBO/MBOPopupModel.cs index 1c90cc74d..1004adca6 100644 --- a/src/client/spark/view/Spark/Ladder/MBO/MBOPopupModel.cs +++ b/src/client/spark/view/Spark/Ladder/MBO/MBOPopupModel.cs @@ -129,7 +129,7 @@ namespace mbts.spark { #region static public static readonly MBOSecurityQueryImmutable default_query = (MBOSecurityQueryImmutable) new MBOSecurityQuery { - Limit = Configuration.get().max_mbo_orders + Limit = Configuration.get().MaxMboOrders }; #endregion } diff --git a/src/client/spark/view/Spark/Utilities/WorkLoop.cs b/src/client/spark/view/Spark/Utilities/WorkLoop.cs index 8e90bff72..59a17b6aa 100644 --- a/src/client/spark/view/Spark/Utilities/WorkLoop.cs +++ b/src/client/spark/view/Spark/Utilities/WorkLoop.cs @@ -16,8 +16,8 @@ namespace mbts.spark { static WorkLoop() { var timer_params = config.Configuration.get(); - default_priority = Enum.TryParse(timer_params.priority, true, out DispatcherPriority p) ? p : DispatcherPriority.ApplicationIdle; - default_interval = TimeSpan.FromMilliseconds(timer_params.interval_ms); + default_priority = Enum.TryParse(timer_params.Priority, true, out DispatcherPriority p) ? p : DispatcherPriority.ApplicationIdle; + default_interval = TimeSpan.FromMilliseconds(timer_params.IntervalMs); } /// diff --git a/src/client/spark_api/spark_api.csproj b/src/client/spark_api/spark_api.csproj index eb8b959e9..45e7ce610 100644 --- a/src/client/spark_api/spark_api.csproj +++ b/src/client/spark_api/spark_api.csproj @@ -58,6 +58,9 @@ $(ProtoOutputPath)/lib/config/protos/Toggles.cs + + $(ProtoOutputPath)/lib/config/protos/Ui.cs + @@ -87,6 +90,7 @@ + diff --git a/src/lib/config/protos/ui.proto b/src/lib/config/protos/ui.proto index 172de7c34..3b97d48da 100644 --- a/src/lib/config/protos/ui.proto +++ b/src/lib/config/protos/ui.proto @@ -1,64 +1,67 @@ -syntax = 'proto2'; +syntax = "proto3"; + package bts.config; +option csharp_namespace = "bts.config"; + message Shell { repeated string modules = 1; } message ShellSettingsConfig { // Save the UI state every 5 minutes by default - optional uint32 save_timer = 1 [ default = 300 ]; + uint32 save_timer = 1; } message ShellRenderMode { - optional bool software_only = 1 [ default = false ]; + bool software_only = 1; +} + +message ModuleProps { + string name = 1; + bool visible = 2; } message IShellModuleProps { - message ModuleProps { - optional string name = 1; - optional bool visible = 2 [ default = true ]; - } - repeated ModuleProps module = 1; } message GridSettings { - optional string font_family = 1 [ default = "Calibri" ]; - optional float font_size = 2 [ default = 10 ]; - optional string locale = 3 [ default = "en-us" ]; + string font_family = 1; + float font_size = 2; + string locale = 3; - optional uint32 row_height = 10 [ default = 16 ]; - optional uint32 col_width = 11 [ default = 75 ]; + uint32 row_height = 10; + uint32 col_width = 11; // Default grid colors - optional uint32 color_background = 20 [ default = 0xFFFFFF ]; // White - optional uint32 color_foreground = 21 [ default = 0 ]; // Black - optional uint32 color_grid_line = 22 [ default = 0x778899 ]; // LightSlateGray + uint32 color_background = 20; + uint32 color_foreground = 21; + uint32 color_grid_line = 22; } message ShellLimits { - optional bool kill_on_close = 1 [ default = true ]; - optional uint64 limit_memory_mb = 2; - optional uint64 limit_group_memory_mb = 3; + bool kill_on_close = 1; + uint64 limit_memory_mb = 2; + uint64 limit_group_memory_mb = 3; } message MultiThreadedWindows { - optional bool market_view = 1 [ default = true ]; - optional bool time_and_sales = 2 [ default = true ]; - optional bool order_book = 3 [ default = true ]; - optional bool fills = 4 [ default = true ]; - optional bool manual_fills = 9 [ default = true ]; - optional bool pnl = 5 [ default = true ]; - optional bool algo_studio = 6 [ default = true ]; - optional bool ladder = 7 [ default = true ]; - optional bool synthetic_management = 8 [ default = true ]; - optional bool vol_surface = 10 [ default = true ]; - optional bool slide_report = 11 [ default = true ]; - optional bool combo_report = 12 [ default = true ]; - optional bool reconcile_report = 13 [ default = true ]; - optional bool day_fills = 14 [ default = true ]; - optional bool open_orders = 15 [ default = true ]; + bool market_view = 1; + bool time_and_sales = 2; + bool order_book = 3; + bool fills = 4; + bool manual_fills = 9; + bool pnl = 5; + bool algo_studio = 6; + bool ladder = 7; + bool synthetic_management = 8; + bool vol_surface = 10; + bool slide_report = 11; + bool combo_report = 12; + bool reconcile_report = 13; + bool day_fills = 14; + bool open_orders = 15; } message LadderKnobs { @@ -68,18 +71,18 @@ message LadderKnobs { // // It seems like all priorities // higher than ApplicationIdle choke the main thread. - optional string priority = 1 [ default = "ApplicationIdle" ]; - optional double interval_ms = 2 [ default = 100 ]; - optional uint32 seconds_to_recenter = 3 [ default = 300 ]; - optional uint32 max_open_ladders = 4 [ default = 75 ]; - optional uint32 security_timeout_secs = 5 [ default = 60 ]; - optional bool open_algo_popup_on_select = 6 [ default = false ]; - optional bool use_algo_param_grid = 7 [ default = true ]; - optional uint32 max_mbo_orders = 8 [ default = 200 ]; - optional bool show_scrollbar = 9 [ default = false ]; + string priority = 1; + double interval_ms = 2; + uint32 seconds_to_recenter = 3; + uint32 max_open_ladders = 4; + uint32 security_timeout_secs = 5; + bool open_algo_popup_on_select = 6; + bool use_algo_param_grid = 7; + uint32 max_mbo_orders = 8; + bool show_scrollbar = 9; // DJ wants bid/ask cells with markets (i.e., size > 0) to have a // lighter background than those without markets. - optional bool lighten_market_cells = 10 [ default = true ]; + bool lighten_market_cells = 10; // For market cell backgrounds, 0 means 'ignore this color setting' (i.e., // employ the ladder's default behavior instead). @@ -94,54 +97,54 @@ message LadderKnobs { // Pure Red : 0xFFFF0000 // Pure Blue : 0xFF00FF00 // Pure Green : 0xFF0000FF - optional uint32 bid_market_cell_background = 11; - optional uint32 ask_market_cell_background = 12; - optional bool mimic_tt = 13 [ default = true ]; + uint32 bid_market_cell_background = 11; + uint32 ask_market_cell_background = 12; + bool mimic_tt = 13; // Defines the number of price rows rendered by the ladder. The smaller this // window is, the cheaper it is to render the ladder grid (redraw prices, // sizes, etc.). However, if the window is too small, scrolling may appear // choppy. - optional uint32 scrollable_tick_window_size = 14 [ default = 256 ]; + uint32 scrollable_tick_window_size = 14; } message OrderBookOptions { - optional bool animate_child_order_rows = 1 [ default = false ]; - optional double status_color_opacity_when_selected = 2 [ default = 0.35 ]; - optional bool can_edit_specific_algo_params = 3 [ default = false ]; + bool animate_child_order_rows = 1; + double status_color_opacity_when_selected = 2; + bool can_edit_specific_algo_params = 3; } message OrderTicketOptions { - optional bool close_on_send = 1 [ default = true ]; + bool close_on_send = 1; } message OrderAlerts { // When the client sees an order for the first time, this time period is used // to determine if the order is actually new, or [presumably]just arrived bc // shell is still initializing, or the server restarted. - optional int32 stale_order_threshold_seconds = 1 [ default = 60 ]; + int32 stale_order_threshold_seconds = 1; } message ShellPingOptions { - optional bool shell_ping_is_enabled = 1 [ default = true ]; - optional int32 workloop_milliseconds_interval = 2 [ default = 5000 ]; + bool shell_ping_is_enabled = 1; + int32 workloop_milliseconds_interval = 2; // 4000 is default Windows ping timeout as specified here: // https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490968(v=technet.10) - optional int32 timeout_milliseconds_threshold = 3 [ default = 4000 ]; - optional int32 logging_milliseconds_threshold = 4 [ default = 50 ]; - optional int32 maximum_backoff_milliseconds = 5 [ default = 60000 ]; + int32 timeout_milliseconds_threshold = 3; + int32 logging_milliseconds_threshold = 4; + int32 maximum_backoff_milliseconds = 5; } message PNLOptions { - optional bool show_new_pnl = 1 [ default = true ]; - optional bool show_old_pnl = 2 [ default = false ]; - optional bool show_pause_resume = 3 [ default = false ]; - optional bool enable_animations = 4 [ default = false ]; + bool show_new_pnl = 1; + bool show_old_pnl = 2; + bool show_pause_resume = 3; + bool enable_animations = 4; } message TimeAndSalesOptions { // Adds a 'pause/resume updates' toggle button to the spark menu if set to // true. This may be helpful when debugging, or diagnosing problems. - optional bool can_pause_updates = 1 [ default = false ]; + bool can_pause_updates = 1; } message AlgoStudioOptions { @@ -150,62 +153,62 @@ message AlgoStudioOptions { DefinitionsAndTemplates = 1; } - optional bool can_modify_definition_name = 1 [ default = true ]; - optional bool can_modify_definition_values = 2 [ default = true ]; - optional bool can_modify_definition_structure = 3 [ default = true ]; - optional bool can_save_specific = 4 [ default = false ]; - optional bool can_undo_redo = 5 [ default = false ]; + bool can_modify_definition_name = 1; + bool can_modify_definition_values = 2; + bool can_modify_definition_structure = 3; + bool can_save_specific = 4; + bool can_undo_redo = 5; // Props below are vestiges from the algo 'template' model in the original // spec (as opposed to the 'flat' definition model used now). // ------------------------------------------------------------------- - // optional bool include_custom_templates = 6 [default = true]; - // optional bool include_legacy_custom_templates = 7 [default = true]; - // optional bool show_badges_in_tree_view = 8 [default = false]; - // optional AddTemplateButton add_template_button = 9 [default = None]; - // optional ModelType model_type = 10 [default = FlatDefinitions]; + // bool include_custom_templates = 6 [default = true]; + // bool include_legacy_custom_templates = 7 [default = true]; + // bool show_badges_in_tree_view = 8 [default = false]; + // AddTemplateButton add_template_button = 9 [default = None]; + // ModelType model_type = 10 [default = FlatDefinitions]; // ------------------------------------------------------------------- - optional bool show_algo_toolbar_rename = 11 [ default = false ]; - optional bool show_algo_toolbar_revert = 12 [ default = false ]; - optional bool show_algo_toolbar_save = 13 [ default = false ]; - optional bool show_algo_toolbar_undo_redo = 14 [ default = false ]; + bool show_algo_toolbar_rename = 11; + bool show_algo_toolbar_revert = 12; + bool show_algo_toolbar_save = 13; + bool show_algo_toolbar_undo_redo = 14; } // TODO: The following algo-type specific attach ui messages should be // consolidated into a single location, along with other algo-type metadata. message CoverAttachUIOptions { - optional bool show_price = 1 [ default = false ]; - optional bool show_quantity = 2 [ default = false ]; + bool show_price = 1; + bool show_quantity = 2; } message JoinAttachUIOptions { - optional bool show_price = 1 [ default = false ]; - optional bool show_quantity = 2 [ default = false ]; + bool show_price = 1; + bool show_quantity = 2; } message LeanAttachUIOptions { - optional bool show_price = 1 [ default = false ]; - optional bool show_quantity = 2 [ default = false ]; + bool show_price = 1; + bool show_quantity = 2; } message TopAttachUIOptions { - optional bool show_price = 1 [ default = false ]; - optional bool show_quantity = 2 [ default = false ]; + bool show_price = 1; + bool show_quantity = 2; } message OffsetAttachUIOptions { - optional bool show_price = 1 [ default = false ]; - optional bool show_quantity = 2 [ default = false ]; + bool show_price = 1; + bool show_quantity = 2; } message ManualFillsOptions { - optional bool modal_transactions = 1 [ default = true ]; + bool modal_transactions = 1; } message SymbolUIConfigurationItem { - optional string symbol = 1 [ default = "" ]; - optional uint32 display_quantity_divisor = 2 [ default = 1 ]; + string symbol = 1; + uint32 display_quantity_divisor = 2; } message SymbolUIConfiguration {