(feat) add args to dist function

This commit is contained in:
cardosofede
2024-05-21 17:41:30 -05:00
parent 2e3df3b637
commit 5d8d435f77
2 changed files with 7 additions and 5 deletions

View File

@@ -2,13 +2,13 @@ import plotly.graph_objects as go
import frontend.visualization.theme as theme import frontend.visualization.theme as theme
def create_executors_distribution_traces(config): def create_executors_distribution_traces(buy_spreads, sell_spreads, buy_amounts_pct, sell_amounts_pct, total_amount_quote):
colors = theme.get_color_scheme() colors = theme.get_color_scheme()
buy_spread_distributions = [spread * 100 for spread in config["buy_spreads"]] buy_spread_distributions = [spread * 100 for spread in buy_spreads]
sell_spread_distributions = [spread * 100 for spread in config["sell_spreads"]] sell_spread_distributions = [spread * 100 for spread in sell_spreads]
buy_order_amounts_quote = [amount * config["total_amount_quote"] for amount in config["buy_amounts_pct"]] buy_order_amounts_quote = [amount * total_amount_quote for amount in buy_amounts_pct]
sell_order_amounts_quote = [amount * config["total_amount_quote"] for amount in config["sell_amounts_pct"]] sell_order_amounts_quote = [amount * total_amount_quote for amount in sell_amounts_pct]
buy_order_levels = len(buy_spread_distributions) buy_order_levels = len(buy_spread_distributions)
sell_order_levels = len(sell_spread_distributions) sell_order_levels = len(sell_spread_distributions)

View File

@@ -8,6 +8,8 @@ def get_default_layout(title=None, height=800, width=1800):
"width": width, "width": width,
"margin": {"l": 20, "r": 20, "t": 50, "b": 20}, "margin": {"l": 20, "r": 20, "t": 50, "b": 20},
"xaxis_rangeslider_visible": False, "xaxis_rangeslider_visible": False,
"hovermode": "x unified",
"showlegend": False,
} }
if title: if title:
layout["title"] = title layout["title"] = title