diff --git a/src/client/spark/Orders/OrderPropertiesEditorVM.cs b/src/client/spark/Orders/OrderPropertiesEditorVM.cs index 4fe0a40fb..e5a90d0e1 100644 --- a/src/client/spark/Orders/OrderPropertiesEditorVM.cs +++ b/src/client/spark/Orders/OrderPropertiesEditorVM.cs @@ -60,6 +60,7 @@ namespace mbts.spark { readonly ListCollectionView _algo_definitions_view, _favorite_algo_definitions_view; readonly TableUpdateBuffer _definitions_buffer = new TableUpdateBuffer(d => d.key); readonly ObservableAggregateCollection _algo_param_rows = new ObservableAggregateCollection(); + readonly AlgoDefinitionVM the_anchor_algo_def_vm; IReadOnlyDictionary _algo_metadata = DictionaryHelper.empty(); IReadOnlyDictionary _favorite_algos_index = DictionaryHelper.empty(); IDisposable _algo_param_rows_hook; @@ -68,6 +69,7 @@ namespace mbts.spark { public OrderPropertiesEditorVM(OrdersModel model, IObservable security_md_source, IObservable order_properties) { _model = model; + the_anchor_algo_def_vm = AlgoDefinitionVM.create(_model, OrderDataHelper.Defaults.AlgoData(CustomOrderDefinition.CustomOneofCase.Limit)); var security_source = security_md_source.Select(smd => smd.security); _security = backing(nameof(security), security_source, SecurityDataHelper.Defaults.SecurityImmutable); security_source = _security.observe_current(true); @@ -238,7 +240,11 @@ namespace mbts.spark { void _selected_algo_definition_Changed(AlgoDefinitionVM old_value, AlgoDefinitionVM new_value, SelectionReason reason) { Disposable.dispose(ref _algo_param_rows_hook); if (old_value != null) - _selected_algo_stack.Push(old_value.key); + // Taha feels that we should always revert to a Limit order either when the user explicity unchecks a sticky button + // or when a non-sticky button is pressed. Rather than completely remove the stack at this time (b/c it may be come + // back in the future), let's just always push a specfic def_vm.key onto it [Limit] ;) + //_selected_algo_stack.Push(old_value.key); + _selected_algo_stack.Push(the_anchor_algo_def_vm.key); if (new_value != null) { if (use_algo_param_grid) _algo_param_rows_hook = _connect_algo_param_rows(new_value, _algo_param_rows);