Fix locking - should round before storing to have a consistent picture
This commit is contained in:
@@ -388,7 +388,8 @@ def test_is_pair_locked(default_conf):
|
||||
pair = 'BTC/USDT'
|
||||
# Lock until 14:30
|
||||
lock_time = datetime(2020, 5, 1, 14, 30, 0, tzinfo=timezone.utc)
|
||||
strategy.lock_pair(pair, lock_time)
|
||||
# Subtract 2 seconds, as locking rounds up to the next candle.
|
||||
strategy.lock_pair(pair, lock_time - timedelta(seconds=2))
|
||||
|
||||
assert not strategy.is_pair_locked(pair)
|
||||
# latest candle is from 14:20, lock goes to 14:30
|
||||
|
@@ -15,7 +15,7 @@ from freqtrade.exceptions import (DependencyException, ExchangeError, Insufficie
|
||||
InvalidOrderException, OperationalException, PricingError,
|
||||
TemporaryError)
|
||||
from freqtrade.freqtradebot import FreqtradeBot
|
||||
from freqtrade.persistence import Order, PairLocks, Trade
|
||||
from freqtrade.persistence import Order, Trade
|
||||
from freqtrade.persistence.models import PairLock
|
||||
from freqtrade.rpc import RPCMessageType
|
||||
from freqtrade.state import RunMode, State
|
||||
|
Reference in New Issue
Block a user