Harden trading, training, and monitoring
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from crypto_spot_bot.market_data import _closed_candles, _is_closed_kline_row
|
||||
from crypto_spot_bot.market_data import _candles_due, _closed_candles, _is_closed_kline_row
|
||||
from crypto_spot_bot.models import Candle
|
||||
|
||||
|
||||
@@ -19,3 +19,10 @@ def test_closed_candles_excludes_current_open_interval() -> None:
|
||||
def test_websocket_kline_requires_confirmed_candle() -> None:
|
||||
assert _is_closed_kline_row({"start": 7_200_000, "confirm": False}, "60") is False
|
||||
assert _is_closed_kline_row({"start": 7_200_000, "confirm": True}, "60") is True
|
||||
|
||||
|
||||
def test_rest_candles_refresh_only_after_next_bar_closes() -> None:
|
||||
candle = Candle(10 * 60_000, 1, 1, 1, 1, 1)
|
||||
|
||||
assert _candles_due([candle], "1", now_ms=11 * 60_000 + 30_000) is False
|
||||
assert _candles_due([candle], "1", now_ms=12 * 60_000) is True
|
||||
|
||||
Reference in New Issue
Block a user