SPARK-348 Nonworking orders should not be displayed in ladder
This commit is contained in:
1 parent
1dc084ac93
commit
8495c3ecf1
3 files changed
+8
-1
No files matched your search
@@ -30,6 +30,7 @@ namespace mbts.spark {
|
||||
public static string short_description(this OrderRecordImmutable order) =>
|
||||
$"{order.Def.Side} {order.State.Quantity} at {order.State.Price}";
|
||||
public static bool has_parent(this OrderRecordImmutable order) => order.ParentKey != 0;
|
||||
public static bool is_active(this OrderRecordImmutable order) => order.State.Status == bts.api.orderman2.OrderStatus.Working;
|
||||
#endregion
|
||||
|
||||
public static string display_name(this IMessage order) => camel_to_title_case(order.Descriptor.Name);
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace mbts.spark
|
||||
show_ticket_command = new DelegateCommand(show_ticket);
|
||||
|
||||
// Orders
|
||||
_internal_orders = _model.order_gateway.get_security_orders_collection(security.Id);
|
||||
_internal_orders = _model.order_gateway.get_active_security_orders_collection(security.Id);
|
||||
orders = new ObservableAutoWrapper<OrderVM, OrderRecordImmutable>(_internal_orders, create_ordervm);
|
||||
|
||||
// Settings
|
||||
|
||||
@@ -118,6 +118,12 @@ namespace mbts.spark
|
||||
|
||||
public static ITableUpdateCollection<OrderRecordImmutable, uint> get_security_orders_collection(this OrdersModel orders_model, HashSet<uint> securities) =>
|
||||
new TableUpdateCollection<OrderRecordImmutable, uint>(orders_model.on_orders.ObserveOnDispatcher(), o => securities.Contains(o.Def.SecurityKey));
|
||||
|
||||
public static ITableUpdateCollection<OrderRecordImmutable, uint> get_active_security_orders_collection(this OrdersModel orders_model, uint security) =>
|
||||
get_active_security_orders_collection(orders_model, new HashSet<uint>(new[] { security }));
|
||||
|
||||
public static ITableUpdateCollection<OrderRecordImmutable, uint> get_active_security_orders_collection(this OrdersModel orders_model, HashSet<uint> securities) =>
|
||||
new TableUpdateCollection<OrderRecordImmutable, uint>(orders_model.on_orders.ObserveOnDispatcher(), o => securities.Contains(o.Def.SecurityKey) && o.is_active());
|
||||
#endregion
|
||||
|
||||
#region Cancel Orders
|
||||
|
||||
Reference in new issue
Block a user