diff --git a/doc/user/content/release_notes/_index.md b/doc/user/content/release_notes/_index.md index 7d635f87a..9326622cd 100644 --- a/doc/user/content/release_notes/_index.md +++ b/doc/user/content/release_notes/_index.md @@ -12,6 +12,8 @@ insert_anchor_links = "right" - Fixed double counting of spread legs in limits - Removed expired fills from the system - Improved handling of orders with undiscovered securities + - Added feedback to the ladder when the user attempts to middle click on bid/ask columns using an order that does not have parameters + - Fixed display of algo studio algo types in order book ## 2.1.4 ### User Visible Changes - Fixed handling of cancel button in security picker diff --git a/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs b/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs index ef8d80395..f8cbef51c 100644 --- a/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs +++ b/src/client/spark/Modules/Trading/Ladder/View/LadderTactileAdorner.cs @@ -149,11 +149,33 @@ namespace mbts.spark { } void _host_PreviewMouseDown(object sender, MouseButtonEventArgs e) { + // When middle click over bid or ask columns: + // Non-parameterizalbe order: change cursor to No indicating sending an order is not possible + // Parameterizable order: if qty is null/0, flash and No cursor + var pos = e.GetPosition(_host); + var column_type = _host._column_for_point(pos).column_type; + var selected_algo_can_expand = _host._vm.order_properties_vm?.selected_algo_definition?.algo_root?.can_expand ?? true; + if (e.MiddleButton == MouseButtonState.Pressed && + (column_type == LadderGridHost.ColumnType.Bid || column_type == LadderGridHost.ColumnType.Ask)) { + if (!selected_algo_can_expand) { + _host.Cursor = Cursors.No; + } + if (selected_algo_can_expand && (_host._vm.size_calculator.value ?? 0) == 0) { + _host._vm.size_calculator.flash_error(); + _host.Cursor = Cursors.No; + } + } + _is_mouse_down = true; InvalidateVisual(); } void _host_MouseUp(object sender, MouseButtonEventArgs e) { + // This will reset the cursor appropriately if the middle mouse button + // has been pressed while over the bid or ask columns + var point = e.GetPosition(_host); + _set_current_row_and_column(point); + _is_mouse_down = false; _is_mouse_dragging = false; InvalidateVisual(); diff --git a/src/client/spark/Orders/OrderSecurity.cs b/src/client/spark/Orders/OrderSecurity.cs index 06ebce996..d53bada62 100644 --- a/src/client/spark/Orders/OrderSecurity.cs +++ b/src/client/spark/Orders/OrderSecurity.cs @@ -37,8 +37,8 @@ namespace bts.api.orderman { this.piq = piq; this.algo = algo; this.meta = meta; - root_algo = new AlgoData(order.Def.CustomDef); - root_meta = null; + root_algo = algo ?? new AlgoData(order.Def.CustomDef); + root_meta = meta; } public OrderSecurity(SecurityImmutable? sec, OrderRecordImmutable order, uint? piq, AlgoData? algo, AlgoDefinitionMetadata? meta, AlgoData? rootalgo = null, AlgoDefinitionMetadata? rootmeta = null) { this.security = sec;