mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
fix test
This commit is contained in:
parent
b0639ab319
commit
ee3b69ea63
|
@ -200,6 +200,10 @@ def calculate_expectancy(trades: pd.DataFrame) -> float:
|
|||
:param trades: DataFrame containing trades (requires columns close_date and profit_abs)
|
||||
:return: expectancy
|
||||
"""
|
||||
|
||||
if len(trades) == 0:
|
||||
return 0
|
||||
|
||||
winning_trades = trades.loc[trades['profit_abs'] > 0]
|
||||
losing_trades = trades.loc[trades['profit_abs'] < 0]
|
||||
profit_sum = winning_trades['profit_abs'].sum()
|
||||
|
|
Loading…
Reference in New Issue
Block a user