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.
This commit is contained in:
1 parent
fef8d2c413
commit
44ef080e9f
1 file changed
+11
-6
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user