fix flake8

This commit is contained in:
Italo 2022-01-20 21:00:33 +00:00
parent a9f14ac119
commit e35a1e4a01

View File

@ -235,11 +235,12 @@ def plot_trades(fig, trades: pd.DataFrame) -> make_subplots:
# Trades can be empty # Trades can be empty
if trades is not None and len(trades) > 0: if trades is not None and len(trades) > 0:
# Create description for sell summarizing the trade # Create description for sell summarizing the trade
trades['desc'] = trades.apply(lambda row: f"{row['profit_ratio']:.2%}, " + \ trades['desc'] = trades.apply(
(f"{row['buy_tag']}, " if row['buy_tag'] is not None else "") + \ lambda row: f"{row['profit_ratio']:.2%}, " +
f"{row['sell_reason']}, " + \ (f"{row['buy_tag']}, " if row['buy_tag'] is not None else "") +
f"{row['trade_duration']} min", f"{row['sell_reason']}, " +
axis=1) f"{row['trade_duration']} min",
axis=1)
trade_buys = go.Scatter( trade_buys = go.Scatter(
x=trades["open_date"], x=trades["open_date"],
y=trades["open_rate"], y=trades["open_rate"],