ui (day fills): Format price w/ sec's tick factors
This commit is contained in:
1 parent
201746e561
commit
fef8d2c413
3 files changed
+14
-8
No files matched your search
@@ -5,7 +5,9 @@ namespace Spark.Trading {
|
||||
using bts.api.orderman;
|
||||
using bts.utils;
|
||||
|
||||
using mbts;
|
||||
using mbts.analytics;
|
||||
using mbts.spark;
|
||||
|
||||
using System;
|
||||
|
||||
@@ -69,6 +71,17 @@ namespace Spark.Trading {
|
||||
public double pos_theta => trade.pos_theta;
|
||||
public double pos_oev => trade.pos_oev;
|
||||
|
||||
public bts.api.domain.TickDisplaySettingsImmutable price_display(
|
||||
bts.api.domain.SecurityMetadataItemImmutable? meta = null) {
|
||||
var rv = meta.HasValue && meta.Value.HasValue && meta.Value.Value.HasPriceDisplay ?
|
||||
meta.Value.Value.PriceDisplay : Security.Defaults.price_display_settingsi;
|
||||
if (security.HasValue) {
|
||||
rv = rv.with(
|
||||
tick_factors: security.spec_or_default().tick_factors().to_api_tick_factors());
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
public static DayFillsRowData from_trade(IPNLTradeRow trade) =>
|
||||
new(trade);
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ namespace Spark.Trading {
|
||||
|
||||
// display
|
||||
TickDisplaySettingsImmutable _quantity_display = Security.Defaults.quantity_display_settingsi;
|
||||
TickDisplaySettingsImmutable _price_display = Security.Defaults.price_display_settingsi;
|
||||
TickDisplaySettingsImmutable _driver_display = Security.Defaults.price_display_settingsi;
|
||||
TickDisplaySettingsImmutable _theo_display = Security.Defaults.price_display_settingsi
|
||||
.with(tick_factors: new() {
|
||||
@@ -85,10 +84,7 @@ namespace Spark.Trading {
|
||||
get => _quantity_display;
|
||||
set => Set(ref _quantity_display, value);
|
||||
}
|
||||
public TickDisplaySettingsImmutable price_display {
|
||||
get => _price_display;
|
||||
set => Set(ref _price_display, value);
|
||||
}
|
||||
public TickDisplaySettingsImmutable price_display => _data.price_display();
|
||||
public TickDisplaySettingsImmutable driver_display {
|
||||
get => _driver_display;
|
||||
set => Set(ref _driver_display, value);
|
||||
|
||||
@@ -150,9 +150,6 @@ namespace Spark.Trading {
|
||||
if (!meta.HasValue) {
|
||||
return rvm;
|
||||
}
|
||||
if (meta.Value.HasPriceDisplay) {
|
||||
rvm.price_display = meta.Value.PriceDisplay;
|
||||
}
|
||||
if (meta.Value.HasQuantityDisplay) {
|
||||
rvm.quantity_display = meta.Value.QuantityDisplay;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user