fix flake 8 compliancy
This commit is contained in:
parent
a246b2ec3f
commit
ba430a3a27
@ -44,6 +44,7 @@ def hyperopt_results():
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def hyperopt_results_min_median_drawdown():
|
||||
return pd.DataFrame(
|
||||
@ -52,10 +53,12 @@ def hyperopt_results_min_median_drawdown():
|
||||
'profit_percent': [0.1, 0.1, -0.1, 0.1, 0.1],
|
||||
'profit_abs': [0.2, 0.2, -0.2, 0.2, 0.2],
|
||||
'trade_duration': [10, 30, 10, 30, 10],
|
||||
'sell_reason': [SellType.ROI, SellType.ROI, SellType.STOP_LOSS,SellType.ROI, SellType.ROI]
|
||||
'sell_reason':
|
||||
[SellType.ROI, SellType.ROI, SellType.STOP_LOSS, SellType.ROI, SellType.ROI]
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def hyperopt_results_max_median_drawdown():
|
||||
return pd.DataFrame(
|
||||
@ -64,10 +67,12 @@ def hyperopt_results_max_median_drawdown():
|
||||
'profit_percent': [0.3, -0.1, -0.1, -0.1, 0.3],
|
||||
'profit_abs': [0.6, -0.2, -0.2, -0.2, 0.6],
|
||||
'trade_duration': [10, 30, 10, 30, 10],
|
||||
'sell_reason': [SellType.ROI, SellType.STOP_LOSS, SellType.STOP_LOSS,SellType.STOP_LOSS, SellType.ROI]
|
||||
'sell_reason':
|
||||
[SellType.ROI, SellType.STOP_LOSS, SellType.STOP_LOSS, SellType.STOP_LOSS, SellType.ROI]
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
# Functions for recurrent object patching
|
||||
def create_trials(mocker, hyperopt, testdatadir) -> None:
|
||||
"""
|
||||
@ -328,7 +333,13 @@ def test_sharpe_loss_prefers_higher_profits(default_conf, hyperopt_results) -> N
|
||||
assert over < correct
|
||||
assert under > correct
|
||||
|
||||
# When the profit a two backtests are the same i prefer to take the one that minimise the median drawdown
|
||||
|
||||
"""
|
||||
When the profit a two backtests are the same i prefer to take
|
||||
the one that minimise the median drawdown
|
||||
"""
|
||||
|
||||
|
||||
def test_calmar_loss_prefers_higher_profits(default_conf,
|
||||
hyperopt_results_min_median_drawdown,
|
||||
hyperopt_results_max_median_drawdown) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user