Skip to content

Commit 3743e92

Browse files
authored
Merge pull request #14 from freqtrade/table_lev_1
Fix dash open table if shorting
2 parents 8060bbc + d1cec12 commit 3743e92

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ftui/screens/dashboard_screen.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,18 +281,26 @@ def update_dashboard_all_open_trades(self):
281281
client_dict = self.app.client_dict
282282
client_dfs = self.app.client_dfs
283283

284+
trading_mode = "spot"
285+
284286
all_open_df = pd.DataFrame()
285287
for n, cl in client_dict.items():
288+
# if any bots are in futures mode, add leverage column
289+
tm = cl.get_client_config().get("trading_mode", "spot")
290+
if tm != "spot":
291+
trading_mode = tm
286292
if cl.name in client_dfs and "op_data" in client_dfs[cl.name]:
287293
data = client_dfs[cl.name]["op_data"].copy()
288294
if not data.empty:
289295
all_open_df = pd.concat([all_open_df, data])
290296

291-
row_data = self._render_open_trade_data(all_open_df)
297+
row_data = self._render_open_trade_data(
298+
all_open_df, trading_mode=trading_mode
299+
)
292300

293301
dt = self.query_one("#all-open-trades-table")
294302
table = fth.dash_open_trades_table(
295-
row_data, trading_mode=cl.get_client_config().get("trading_mode")
303+
row_data, trading_mode=trading_mode
296304
)
297305

298306
worker = get_current_worker()

0 commit comments

Comments
 (0)