Skip to content

Commit 9c40c5d

Browse files
committed
Fix incorrect stoploss pct
1 parent 389fda0 commit 9c40c5d

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

ftui/ftui.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ def _get_open_trade_dataframe(self, ftuic):
156156
pairstr = f"{t['pair']}{suff}"
157157
rpfta = round(float(t["profit_abs"]), 2)
158158
t_dir = "S" if t["is_short"] else "L"
159-
stop_profit = round(
160-
((t["stop_loss_abs"] - t["open_rate"]) / t["stop_loss_abs"]) * 100, 2
161-
)
159+
stop_profit = t['stop_loss_pct']
162160

163161
max_profit = 0
164162
if t["max_rate"] is not None and t['max_rate'] != 0:

ftui/screens/main_bot_screen.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,7 @@ def _render_open_trade_summary(self, ftuic):
400400

401401
stop_profit = "--- "
402402
if t["stop_loss_abs"] is not None and t["stop_loss_abs"] != 0:
403-
stop_profit = round(
404-
((t["stop_loss_abs"] - t["open_rate"]) / t["stop_loss_abs"]) * 100, 2
405-
)
403+
stop_profit = t['stop_loss_pct']
406404
stp_txt = (
407405
f"{t['stop_loss_abs']} [red]({stop_profit}%)"
408406
if stop_profit <= 0

0 commit comments

Comments
 (0)