Skip to content

Commit

Permalink
Fix flake8 problems
Browse files Browse the repository at this point in the history
  • Loading branch information
froggleston committed Jul 15, 2023
1 parent 7eced95 commit 3ce17b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions freqtrade/rpc/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,19 +526,19 @@ def _rpc_trade_statistics(
mean_winning_profit = (winning_profit / winning_trades) if winning_trades > 0 else 0
mean_losing_profit = (losing_profit / losing_trades) if losing_trades > 0 else 0

winrate = (winning_trades / closed_trade_count)*100 if closed_trade_count > 0 else 0
winrate = (winning_trades / closed_trade_count) * 100 if closed_trade_count > 0 else 0
loserate = (100 - winrate)

expectancy = 1.0
if mean_winning_profit > 0 and mean_losing_profit > 0:
expectancy = (1 + (mean_winning_profit / mean_losing_profit)) * (winrate / 100) - 1
else:
if mean_winning_profit == 0:
expectancy = 0.0

expectancy_rate = (
((winrate/100) * mean_winning_profit) -
((loserate/100) * mean_losing_profit)
((winrate / 100) * mean_winning_profit) -
((loserate / 100) * mean_losing_profit)
)

trades_df = DataFrame([{'close_date': trade.close_date.strftime(DATETIME_PRINT_FORMAT),
Expand Down

0 comments on commit 3ce17b7

Please sign in to comment.