From a1a24da7b61c06aece5b73cf2f7f28dc49b48056 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 26 Oct 2022 10:30:12 -0400 Subject: [PATCH] Make `binance` reject 1s OHLC history requests --- piker/brokers/binance.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/piker/brokers/binance.py b/piker/brokers/binance.py index 1e0f6cc4..aa189e81 100644 --- a/piker/brokers/binance.py +++ b/piker/brokers/binance.py @@ -36,7 +36,11 @@ import tractor import wsproto from .._cacheables import open_cached_client -from ._util import resproc, SymbolNotFound +from ._util import ( + resproc, + SymbolNotFound, + DataUnavailable, +) from ..log import get_logger, get_console_log from ..data import ShmArray from ..data.types import Struct @@ -397,6 +401,8 @@ async def open_history_client( datetime, # start datetime, # end ]: + if timeframe != 60: + raise DataUnavailable('Only 1m bars are supported') array = await client.bars( symbol,