mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-12 19:23:55 +00:00
Use proper type for exit_reason in tests
This commit is contained in:
parent
2ec4449558
commit
b8a4752636
|
@ -67,10 +67,10 @@ def test_backtest_analysis_nomock(default_conf, mocker, caplog, testdatadir, use
|
||||||
"enter_tag_long_b",
|
"enter_tag_long_b",
|
||||||
],
|
],
|
||||||
"exit_reason": [
|
"exit_reason": [
|
||||||
ExitType.ROI,
|
ExitType.ROI.value,
|
||||||
ExitType.EXIT_SIGNAL,
|
ExitType.EXIT_SIGNAL.value,
|
||||||
ExitType.STOP_LOSS,
|
ExitType.STOP_LOSS.value,
|
||||||
ExitType.TRAILING_STOP_LOSS,
|
ExitType.TRAILING_STOP_LOSS.value,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -1709,7 +1709,7 @@ def test_backtest_start_multi_strat_nomock(default_conf, mocker, caplog, testdat
|
||||||
"open_rate": [0.104445, 0.10302485],
|
"open_rate": [0.104445, 0.10302485],
|
||||||
"close_rate": [0.104969, 0.103541],
|
"close_rate": [0.104969, 0.103541],
|
||||||
"is_short": [False, False],
|
"is_short": [False, False],
|
||||||
"exit_reason": [ExitType.ROI, ExitType.ROI],
|
"exit_reason": [ExitType.ROI.value, ExitType.ROI.value],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
result2 = pd.DataFrame(
|
result2 = pd.DataFrame(
|
||||||
|
@ -1729,7 +1729,7 @@ def test_backtest_start_multi_strat_nomock(default_conf, mocker, caplog, testdat
|
||||||
"open_rate": [0.104445, 0.10302485, 0.122541],
|
"open_rate": [0.104445, 0.10302485, 0.122541],
|
||||||
"close_rate": [0.104969, 0.103541, 0.123541],
|
"close_rate": [0.104969, 0.103541, 0.123541],
|
||||||
"is_short": [False, False, False],
|
"is_short": [False, False, False],
|
||||||
"exit_reason": [ExitType.ROI, ExitType.ROI, ExitType.STOP_LOSS],
|
"exit_reason": [ExitType.ROI.value, ExitType.ROI.value, ExitType.STOP_LOSS.value],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
backtestmock = MagicMock(
|
backtestmock = MagicMock(
|
||||||
|
|
|
@ -415,10 +415,10 @@ def test_hyperopt_format_results(hyperopt):
|
||||||
"is_short": [False, False, False, False],
|
"is_short": [False, False, False, False],
|
||||||
"stake_amount": [0.01, 0.01, 0.01, 0.01],
|
"stake_amount": [0.01, 0.01, 0.01, 0.01],
|
||||||
"exit_reason": [
|
"exit_reason": [
|
||||||
ExitType.ROI,
|
ExitType.ROI.value,
|
||||||
ExitType.STOP_LOSS,
|
ExitType.STOP_LOSS.value,
|
||||||
ExitType.ROI,
|
ExitType.ROI.value,
|
||||||
ExitType.FORCE_EXIT,
|
ExitType.FORCE_EXIT.value,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
@ -507,10 +507,10 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None:
|
||||||
"is_short": [False, False, False, False],
|
"is_short": [False, False, False, False],
|
||||||
"stake_amount": [0.01, 0.01, 0.01, 0.01],
|
"stake_amount": [0.01, 0.01, 0.01, 0.01],
|
||||||
"exit_reason": [
|
"exit_reason": [
|
||||||
ExitType.ROI,
|
ExitType.ROI.value,
|
||||||
ExitType.STOP_LOSS,
|
ExitType.STOP_LOSS.value,
|
||||||
ExitType.ROI,
|
ExitType.ROI.value,
|
||||||
ExitType.FORCE_EXIT,
|
ExitType.FORCE_EXIT.value,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
|
|
@ -116,10 +116,10 @@ def test_generate_backtest_stats(default_conf, testdatadir, tmp_path):
|
||||||
"is_short": [False, False, False, False],
|
"is_short": [False, False, False, False],
|
||||||
"stake_amount": [0.01, 0.01, 0.01, 0.01],
|
"stake_amount": [0.01, 0.01, 0.01, 0.01],
|
||||||
"exit_reason": [
|
"exit_reason": [
|
||||||
ExitType.ROI,
|
ExitType.ROI.value,
|
||||||
ExitType.STOP_LOSS,
|
ExitType.STOP_LOSS.value,
|
||||||
ExitType.ROI,
|
ExitType.ROI.value,
|
||||||
ExitType.FORCE_EXIT,
|
ExitType.FORCE_EXIT.value,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
@ -183,10 +183,10 @@ def test_generate_backtest_stats(default_conf, testdatadir, tmp_path):
|
||||||
"is_short": [False, False, False, False],
|
"is_short": [False, False, False, False],
|
||||||
"stake_amount": [0.01, 0.01, 0.01, 0.01],
|
"stake_amount": [0.01, 0.01, 0.01, 0.01],
|
||||||
"exit_reason": [
|
"exit_reason": [
|
||||||
ExitType.ROI,
|
ExitType.ROI.value,
|
||||||
ExitType.ROI,
|
ExitType.ROI.value,
|
||||||
ExitType.STOP_LOSS,
|
ExitType.STOP_LOSS.value,
|
||||||
ExitType.FORCE_EXIT,
|
ExitType.FORCE_EXIT.value,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
@ -444,7 +444,7 @@ def test_text_table_exit_reason():
|
||||||
"wins": [2, 0, 0],
|
"wins": [2, 0, 0],
|
||||||
"draws": [0, 0, 0],
|
"draws": [0, 0, 0],
|
||||||
"losses": [0, 0, 1],
|
"losses": [0, 0, 1],
|
||||||
"exit_reason": [ExitType.ROI, ExitType.ROI, ExitType.STOP_LOSS],
|
"exit_reason": [ExitType.ROI.value, ExitType.ROI.value, ExitType.STOP_LOSS.value],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user