diff --git a/src/client/spark/Modules/Trading/OrderBook/OrderBookVM.cs b/src/client/spark/Modules/Trading/OrderBook/OrderBookVM.cs index e94a1c8e5..5c1a207f4 100644 --- a/src/client/spark/Modules/Trading/OrderBook/OrderBookVM.cs +++ b/src/client/spark/Modules/Trading/OrderBook/OrderBookVM.cs @@ -137,7 +137,8 @@ namespace mbts.spark { uint size = attach_vm.size_calculator.value ?? 0; var algo = attach_vm.algo_vm.algo_root.created_assigned(); var order_tups = selected_rows.Select(r => r.order_tuple); - await Task.WhenAll(order_tups.Select(t => _model.send_order(t.order.Def.with(attach_target_order_key: t.order.Key, custom_def: algo), price, size))); + uint? algo_template_key = attach_vm.algo_vm.algo_root.id.is_persisted ? attach_vm.algo_vm.algo_root.id.persisted.id_uint : (uint?)null; + await Task.WhenAll(order_tups.Select(t => _model.send_order(t.order.Def.with(attach_target_order_key: t.order.Key, custom_def: algo, algo_template_key: algo_template_key), price, size))); } catch (Exception ex) { Log.Ui.error($"Error sending attached orders: {ex}."); }