SPARK-1464

I couldn't get the order price to default to the bid, but sending to John
This commit is contained in:
Kevin Darby authored and Taha Afzal committed 2018-07-19 10:36:37 -04:00
1 parent 52001a55c6
commit 4d99ffc86c
2 files changed
+15 -5

No files matched your search

@@ -23,8 +23,8 @@ namespace mbts.spark
this.selected_child_order_type = new InlineUserProperty<CustomOneofCase>(selected_child_order_type, true);
this.child_order_types = new InlineUserProperty<IReadOnlyCollection<CustomOneofCase>>(child_order_types, true);
trigger_price_type = new InlineUserProperty<TriggerPriceType>(TriggerPriceType.LastTradePrice, false);
order_price = new InlineUserProperty<double>(double.NaN, false);
trigger_price_type = new InlineUserProperty<TriggerPriceType>(TriggerPriceType.Bid, false);
order_price = new InlineUserProperty<double>(double.NaN, true);
}
public readonly InlineUserProperty<CustomOneofCase> selected_child_order_type;
public readonly InlineUserProperty<IReadOnlyCollection<CustomOneofCase>> child_order_types;
@@ -43,7 +43,7 @@ namespace mbts.spark
IOrderTypeVM _child_order;
IDisposable _dispose, _child_order_errors_sub;
public TriggerPriceType trigger_price_type { get; set; } = TriggerPriceType.LastTradePrice;
public TriggerPriceType trigger_price_type { get; set; } = TriggerPriceType.Bid;
public double order_price { get; set; } = double.NaN;
public TriggerOrderVM(OrdersModel model, IObservable<SecurityImmutable> security_source)
@@ -84,7 +84,7 @@ namespace mbts.spark
_validate();
}
public IEnumerable<TriggerPriceType> trigger_price_types => EnumHelper.get_values<TriggerPriceType>();
public IEnumerable<TriggerPriceType> trigger_price_types => EnumHelper.get_values_except<TriggerPriceType>(TriggerPriceType.LastTradePrice);
public override void assign_to(CustomOrderDefinition value)
{
@@ -108,6 +108,16 @@ namespace mbts.spark
value.Trigger = i;
}
}
public double price_tick
{
get { return _security.Value.ContractSpec.LowTick; }
}
public ContractSpecificationImmutable spec
{
get { return _security.Value.ContractSpec; }
}
public ICollection<IOrderTypeVM> child_order_types
{
@@ -362,7 +362,7 @@
SelectedItem="{Binding trigger_price_type}"
/>
<TextBlock Grid.Row="3" VerticalAlignment="Center">Order Price</TextBlock>
<c:TickUpDownDouble Grid.Row="3" Grid.Column="2" Value="{Binding order_price}"/>
<usp:PriceEntryControl Grid.Row="3" Grid.Column="2" Value="{Binding order_price}" ContractSpec="{Binding spec}" />
<TextBlock Grid.Row="5">Child</TextBlock>
<uag:OrderDetailsPopupControl
Grid.Row="5" Grid.Column="2"