no overlapping trades only if max_open_trades > 0
This commit is contained in:
parent
e3c6b7c16e
commit
bc7f44de40
@ -102,9 +102,9 @@ def backtest(config: Dict, processed, mocker, max_open_trades=0):
|
||||
# for each buy point
|
||||
lock_pair_until = None
|
||||
for row in ticker[ticker.buy == 1].itertuples(index=True):
|
||||
if max_open_trades > 0:
|
||||
if lock_pair_until is not None and row.Index <= lock_pair_until:
|
||||
continue
|
||||
if max_open_trades > 0:
|
||||
# Check if max_open_trades has already been reached for the given date
|
||||
if not trade_count_lock.get(row.date, 0) < max_open_trades:
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user