chore: improve statement sequence for improved short circuiting
This commit is contained in:
@@ -1353,9 +1353,9 @@ class Backtesting:
|
|||||||
# don't open on the last row
|
# don't open on the last row
|
||||||
# We only open trades on the main candle, not on detail candles
|
# We only open trades on the main candle, not on detail candles
|
||||||
if (
|
if (
|
||||||
(self._position_stacking or len(LocalTrade.bt_trades_open_pp[pair]) == 0)
|
can_enter
|
||||||
and can_enter
|
|
||||||
and trade_dir is not None
|
and trade_dir is not None
|
||||||
|
and (self._position_stacking or len(LocalTrade.bt_trades_open_pp[pair]) == 0)
|
||||||
and not PairLocks.is_pair_locked(pair, row[DATE_IDX], trade_dir)
|
and not PairLocks.is_pair_locked(pair, row[DATE_IDX], trade_dir)
|
||||||
):
|
):
|
||||||
if self.trade_slot_available(LocalTrade.bt_open_open_trade_count):
|
if self.trade_slot_available(LocalTrade.bt_open_open_trade_count):
|
||||||
|
|||||||
Reference in New Issue
Block a user