In backtesting, ensure we don't buy the same pair again before selling (#139)
* in backtesting, ensure we don't buy before we sell * no overlapping trades only if max_open_trades > 0 * --limit-max-trades now --realistic-simulation
This commit is contained in:
committed by
Michael Egger
parent
cfbfe90aa0
commit
371ee1e457
@@ -109,7 +109,7 @@ def test_start_backtesting(mocker):
|
||||
live=True,
|
||||
loglevel=20,
|
||||
ticker_interval=1,
|
||||
limit_max_trades=True,
|
||||
realistic_simulation=True,
|
||||
)
|
||||
start_backtesting(args)
|
||||
assert env_mock == {
|
||||
@@ -117,7 +117,7 @@ def test_start_backtesting(mocker):
|
||||
'BACKTEST_LIVE': 'true',
|
||||
'BACKTEST_CONFIG': 'config.json',
|
||||
'BACKTEST_TICKER_INTERVAL': '1',
|
||||
'BACKTEST_LIMIT_MAX_TRADES': 'true',
|
||||
'BACKTEST_REALISTIC_SIMULATION': 'true',
|
||||
}
|
||||
assert pytest_mock.call_count == 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user