From 44ef080e9ff88c56d7e6af1da5ae1f6a821be863 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Sat, 6 Aug 2022 13:16:47 -0400 Subject: [PATCH] ui (day fills): Format theo and driver w/ 4 dec places With the caveat that future fills' drivers are formatted according to their own tick factors (i.e., same as the "price" column). This should be good/reasonable behavior because in rare cases where futures don't drive themselves, they are most likely driven by a neighboring expiration with the same price display. --- .../Modules/Trading/DayFills/DayFillsRowVM.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/client/spark/Modules/Trading/DayFills/DayFillsRowVM.cs b/src/client/spark/Modules/Trading/DayFills/DayFillsRowVM.cs index d8a42fcd0..5c814ea52 100644 --- a/src/client/spark/Modules/Trading/DayFills/DayFillsRowVM.cs +++ b/src/client/spark/Modules/Trading/DayFills/DayFillsRowVM.cs @@ -23,10 +23,9 @@ namespace Spark.Trading { // display TickDisplaySettingsImmutable _quantity_display = Security.Defaults.quantity_display_settingsi; - TickDisplaySettingsImmutable _driver_display = Security.Defaults.price_display_settingsi; TickDisplaySettingsImmutable _theo_display = Security.Defaults.price_display_settingsi .with(tick_factors: new() { - TickBase = 1000, + TickBase = 10000, TickUnit = 1 }); @@ -85,10 +84,16 @@ namespace Spark.Trading { set => Set(ref _quantity_display, value); } public TickDisplaySettingsImmutable price_display => _data.price_display(); - public TickDisplaySettingsImmutable driver_display { - get => _driver_display; - set => Set(ref _driver_display, value); - } + + public TickDisplaySettingsImmutable driver_display => + (security?.ContractCase ?? Security.ContractOneofCase.None) switch { + Security.ContractOneofCase.Future => price_display, + _ => Security.Defaults.price_display_settingsi.with(tick_factors: new() { + TickBase = 10000, + TickUnit = 1 + }) + }; + public TickDisplaySettingsImmutable theo_display { get => _theo_display; set => Set(ref _theo_display, value);