OrderBook - assign algo-template-key to OrderDefinition when sending attached orders (if template is selected)

This commit is contained in:
John Colvin committed 2019-03-18 14:07:01 -05:00
1 parent 4e4ab52032
commit 1ca5b217fc
1 file changed
+2 -1
@@ -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}.");
}