Make `binance` reject 1s OHLC history requests
parent
553d0557b6
commit
a1a24da7b6
|
@ -36,7 +36,11 @@ import tractor
|
||||||
import wsproto
|
import wsproto
|
||||||
|
|
||||||
from .._cacheables import open_cached_client
|
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 ..log import get_logger, get_console_log
|
||||||
from ..data import ShmArray
|
from ..data import ShmArray
|
||||||
from ..data.types import Struct
|
from ..data.types import Struct
|
||||||
|
@ -397,6 +401,8 @@ async def open_history_client(
|
||||||
datetime, # start
|
datetime, # start
|
||||||
datetime, # end
|
datetime, # end
|
||||||
]:
|
]:
|
||||||
|
if timeframe != 60:
|
||||||
|
raise DataUnavailable('Only 1m bars are supported')
|
||||||
|
|
||||||
array = await client.bars(
|
array = await client.bars(
|
||||||
symbol,
|
symbol,
|
||||||
|
|
Loading…
Reference in New Issue