flake8
This commit is contained in:
@@ -13,10 +13,10 @@ from freqtrade.data.btanalysis import (BT_DATA_COLUMNS, analyze_trade_parallelis
|
|||||||
load_backtest_metadata, load_trades, load_trades_from_db)
|
load_backtest_metadata, load_trades, load_trades_from_db)
|
||||||
from freqtrade.data.history import load_data, load_pair_history
|
from freqtrade.data.history import load_data, load_pair_history
|
||||||
from freqtrade.data.metrics import (calculate_cagr, calculate_calmar, calculate_csum,
|
from freqtrade.data.metrics import (calculate_cagr, calculate_calmar, calculate_csum,
|
||||||
calculate_expectancy_ratio, calculate_market_change,
|
calculate_expectancy, calculate_expectancy_ratio,
|
||||||
calculate_max_drawdown, calculate_sharpe, calculate_sortino,
|
calculate_market_change, calculate_max_drawdown,
|
||||||
calculate_underwater, combine_dataframes_with_mean,
|
calculate_sharpe, calculate_sortino, calculate_underwater,
|
||||||
create_cum_profit)
|
combine_dataframes_with_mean, create_cum_profit)
|
||||||
from freqtrade.exceptions import OperationalException
|
from freqtrade.exceptions import OperationalException
|
||||||
from freqtrade.util import dt_utc
|
from freqtrade.util import dt_utc
|
||||||
from tests.conftest import CURRENT_TEST_STRATEGY, create_mock_trades
|
from tests.conftest import CURRENT_TEST_STRATEGY, create_mock_trades
|
||||||
@@ -338,6 +338,7 @@ def test_calculate_csum(testdatadir):
|
|||||||
with pytest.raises(ValueError, match='Trade dataframe empty.'):
|
with pytest.raises(ValueError, match='Trade dataframe empty.'):
|
||||||
csum_min, csum_max = calculate_csum(DataFrame())
|
csum_min, csum_max = calculate_csum(DataFrame())
|
||||||
|
|
||||||
|
|
||||||
def test_calculate_expectancy(testdatadir):
|
def test_calculate_expectancy(testdatadir):
|
||||||
filename = testdatadir / "backtest_results/backtest-result.json"
|
filename = testdatadir / "backtest_results/backtest-result.json"
|
||||||
bt_data = load_backtest_data(filename)
|
bt_data = load_backtest_data(filename)
|
||||||
@@ -349,6 +350,7 @@ def test_calculate_expectancy(testdatadir):
|
|||||||
assert isinstance(expectancy, float)
|
assert isinstance(expectancy, float)
|
||||||
assert pytest.approx(expectancy) == 0.07151374226574791
|
assert pytest.approx(expectancy) == 0.07151374226574791
|
||||||
|
|
||||||
|
|
||||||
def test_calculate_expectancy_ratio(testdatadir):
|
def test_calculate_expectancy_ratio(testdatadir):
|
||||||
filename = testdatadir / "backtest_results/backtest-result.json"
|
filename = testdatadir / "backtest_results/backtest-result.json"
|
||||||
bt_data = load_backtest_data(filename)
|
bt_data = load_backtest_data(filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user