Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70bf5e0c95 | ||
|
|
2bae938549 |
No files matched your search
@@ -34,9 +34,18 @@ namespace mbts.spark {
|
||||
readonly Property<uint> _orders_column_width, _bid_column_width, _price_column_width, _ask_column_width, _last_column_width, _volume_column_width, _piq_column_width;
|
||||
readonly Property<ulong> _volume;
|
||||
readonly Property<bool> _auto_clear;
|
||||
readonly PropertyAutoWrapper<LadderSettings, bool> _show_day, _show_high, _show_low, _show_open, _show_settlement, _show_volume, _show_account,
|
||||
_show_tif, _show_order_type, _show_size_preset, _show_auto_clear, _show_clear, _show_cancel_buys,
|
||||
_show_cancel_sells, _show_cancel_all, _show_zoom, _show_status_message;
|
||||
readonly PropertyAutoWrapper<LadderSettings, bool>
|
||||
_show_account,
|
||||
_show_tif,
|
||||
_show_order_type,
|
||||
_show_size_preset,
|
||||
_show_auto_clear,
|
||||
_show_clear,
|
||||
_show_cancel_buys,
|
||||
_show_cancel_sells,
|
||||
_show_cancel_all,
|
||||
_show_zoom,
|
||||
_show_status_message;
|
||||
readonly PropertyAutoWrapper<LadderSettings, Brush> _bid_background, _bid_foreground, _ask_background, _ask_foreground;
|
||||
double
|
||||
_position,
|
||||
@@ -109,12 +118,6 @@ namespace mbts.spark {
|
||||
(_ask_background = brush_prop(nameof(ask_background), s => s.ask_column.background)).set,
|
||||
(_ask_foreground = brush_prop(nameof(ask_foreground), s => s.ask_column.foreground)).set,
|
||||
// bool visibility props
|
||||
(_show_day = bool_prop(nameof(show_day), s => s.day_visible)).set,
|
||||
(_show_high = bool_prop(nameof(show_high), s => s.high_visible)).set,
|
||||
(_show_low = bool_prop(nameof(show_low), s => s.low_visible)).set,
|
||||
(_show_open = bool_prop(nameof(show_open), s => s.open_visible)).set,
|
||||
(_show_settlement = bool_prop(nameof(show_settlement), s => s.settle_visible)).set,
|
||||
(_show_volume = bool_prop(nameof(show_volume), s => s.volume_visible)).set,
|
||||
(_show_account = bool_prop(nameof(show_account), s => s.account_visible)).set,
|
||||
(_show_tif = bool_prop(nameof(show_tif), s => s.tif_visible)).set,
|
||||
(_show_order_type = bool_prop(nameof(show_order_type), s => s.order_type_visible)).set,
|
||||
@@ -147,11 +150,23 @@ namespace mbts.spark {
|
||||
_volume_column_width.set(s.volume_column.general.width);
|
||||
// left panel/zoom
|
||||
day_change_style.load_from(s.panel_price_point_settings.day_change);
|
||||
day_change_style.show = s.day_visible;
|
||||
// open
|
||||
open_style.load_from(s.panel_price_point_settings.open);
|
||||
open_style.show = s.open_visible;
|
||||
// session low
|
||||
session_low_style.load_from(s.panel_price_point_settings.session_low);
|
||||
session_low_style.show = s.low_visible;
|
||||
// session high
|
||||
session_high_style.load_from(s.panel_price_point_settings.session_high);
|
||||
session_high_style.show = s.high_visible;
|
||||
// settlement
|
||||
settlement_style.load_from(s.panel_price_point_settings.settlement);
|
||||
settlement_style.show = s.settle_visible;
|
||||
// volume
|
||||
volume_style.load_from(s.panel_price_point_settings.volume);
|
||||
volume_style.show = s.volume_visible;
|
||||
// left panel gen display
|
||||
_left_panel_width.set(s.order_entry_panel_initial_width);
|
||||
_zoom_factor.set(s.zoom_factor);
|
||||
RaisePropertyChanged(nameof(day_change_font_color), nameof(day_change_background_color));
|
||||
@@ -325,12 +340,6 @@ namespace mbts.spark {
|
||||
public Brush bid_foreground => _bid_foreground.view;
|
||||
public Brush ask_background => _ask_background.view;
|
||||
public Brush ask_foreground => _ask_foreground.view;
|
||||
public bool show_day => _show_day.view;
|
||||
public bool show_high => _show_high.view;
|
||||
public bool show_low => _show_low.view;
|
||||
public bool show_open => _show_open.view;
|
||||
public bool show_settlement => _show_settlement.view;
|
||||
public bool show_volume => _show_volume.view;
|
||||
public bool show_account => _show_account.view;
|
||||
public bool show_tif => _show_tif.view;
|
||||
public bool show_order_type => _show_order_type.view;
|
||||
|
||||
@@ -59,11 +59,20 @@ namespace mbts.spark {
|
||||
public static int index_of(double[] prices, double price, IComparer<double> comparer) =>
|
||||
Array.BinarySearch(prices, price, comparer);
|
||||
|
||||
public static GlyphRun format_text(string text, int row, double row_height, LadderColumnSettings settings, GlyphContext glyph_context, LadderSettings.PriceDisplayFormat price_display_format = LadderSettings.PriceDisplayFormat.Default) =>
|
||||
public static GlyphRun format_text(
|
||||
string text,
|
||||
int row,
|
||||
double row_height,
|
||||
LadderColumnSettings settings,
|
||||
GlyphContext glyph_context,
|
||||
LadderSettings.PriceDisplayFormat price_display_format = LadderSettings.PriceDisplayFormat.Default) =>
|
||||
glyph_context.get_glyph_run(
|
||||
// long term there is probably a better way to get rid of the separator, such as in the TickExtensions._format_tick
|
||||
price_display_format == LadderSettings.PriceDisplayFormat.Integer ? text.Replace(tick_separator_period, string.Empty).Replace(tick_separator_dash, string.Empty) : text,
|
||||
settings.font_size, settings.width, row_height, HorizontalAlignment.Center, 0, VerticalAlignment.Center, row * row_height, true);
|
||||
price_display_format == LadderSettings.PriceDisplayFormat.Integer ?
|
||||
text.Replace(tick_separator_period, string.Empty).Replace(tick_separator_dash, string.Empty) :
|
||||
text,
|
||||
settings.font_size, settings.width, row_height, HorizontalAlignment.Right,
|
||||
-4, VerticalAlignment.Center, row * row_height, true);
|
||||
|
||||
public static double[] gen_prices(double mid, int row_count, ContractSpecificationImmutable spec) {
|
||||
// require odd number
|
||||
|
||||
@@ -372,7 +372,7 @@
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Background="{Binding day_change_background_color, Converter={x:Static converters:ColorToBrushConverter.Instance}}"
|
||||
Visibility="{Binding show_day_change, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding day_change_style.show, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
ToolTip="Day Change"
|
||||
Style="{StaticResource LeftPanelPricePointBorder}"
|
||||
>
|
||||
@@ -403,7 +403,7 @@
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Background="{Binding volume_style.background_color, Converter={x:Static converters:ColorToBrushConverter.Instance}}"
|
||||
Visibility="{Binding show_volume, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding volume_style.show, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
ToolTip="Volume"
|
||||
Style="{StaticResource LeftPanelPricePointBorder}"
|
||||
>
|
||||
@@ -438,7 +438,7 @@
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Background="{Binding session_high_style.background_color, Converter={x:Static converters:ColorToBrushConverter.Instance}}"
|
||||
Visibility="{Binding show_session_high, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding session_high_style.show, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
ToolTip="Session High"
|
||||
Style="{StaticResource LeftPanelPricePointBorder}"
|
||||
>
|
||||
@@ -467,7 +467,7 @@
|
||||
<Border
|
||||
Grid.Row="3"
|
||||
Background="{Binding session_low_style.background_color, Converter={x:Static converters:ColorToBrushConverter.Instance}}"
|
||||
Visibility="{Binding show_session_low, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding session_low_style.show, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
ToolTip="Session Low"
|
||||
Style="{StaticResource LeftPanelPricePointBorder}"
|
||||
>
|
||||
@@ -496,7 +496,7 @@
|
||||
<Border
|
||||
Grid.Row="4"
|
||||
Background="{Binding open_style.background_color, Converter={x:Static converters:ColorToBrushConverter.Instance}}"
|
||||
Visibility="{Binding show_open, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding open_style.show, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
ToolTip="Open"
|
||||
Style="{StaticResource LeftPanelPricePointBorder}"
|
||||
>
|
||||
@@ -525,7 +525,7 @@
|
||||
<Border
|
||||
Grid.Row="5"
|
||||
Background="{Binding settlement_style.background_color, Converter={x:Static converters:ColorToBrushConverter.Instance}}"
|
||||
Visibility="{Binding show_settlement, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding settlement_style.show, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
ToolTip="Settlement"
|
||||
Style="{StaticResource LeftPanelPricePointBorder}"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user