Compare commits
1 Commits
00406028ea
...
53148b453d
Author | SHA1 | Date |
---|---|---|
|
53148b453d |
|
@ -170,7 +170,6 @@ def piker_sym_to_cb_sym(name: str) -> Symbol:
|
|||
option_type = CALL
|
||||
else:
|
||||
raise Exception("Couldn\'t parse option type")
|
||||
|
||||
return Symbol(
|
||||
base=base,
|
||||
quote=quote,
|
||||
|
@ -237,10 +236,16 @@ class Client:
|
|||
def __init__(self, json_rpc: Callable) -> None:
|
||||
self._pairs: dict[str, Any] = None
|
||||
|
||||
config = get_config().get('deribit', {})
|
||||
config = get_config()
|
||||
if ('deribit' in config):
|
||||
config = config['deribit']
|
||||
if ('key_id' in config) and ('key_secret' in config):
|
||||
self._key_id = config['key_id']
|
||||
self._key_secret = config['key_secret']
|
||||
|
||||
self._key_id = config.get('key_id')
|
||||
self._key_secret = config.get('key_secret')
|
||||
else:
|
||||
self._key_id = None
|
||||
self._key_secret = None
|
||||
|
||||
self.json_rpc = json_rpc
|
||||
|
||||
|
@ -413,13 +418,20 @@ class Client:
|
|||
new_bars: list[tuple] = []
|
||||
for i in range(len(result.close)):
|
||||
|
||||
timestamp = (start_time + (i * (60 * 1000))) / 1000.0
|
||||
_open = result.open[i]
|
||||
high = result.high[i]
|
||||
low = result.low[i]
|
||||
close = result.close[i]
|
||||
volume = result.volume[i]
|
||||
|
||||
row = [
|
||||
(start_time + (i * (60 * 1000))) / 1000.0, # time
|
||||
result.open[i],
|
||||
result.high[i],
|
||||
result.low[i],
|
||||
result.close[i],
|
||||
result.volume[i]
|
||||
timestamp, # time
|
||||
_open,
|
||||
high,
|
||||
low,
|
||||
close,
|
||||
volume
|
||||
]
|
||||
|
||||
new_bars.append((i,) + tuple(row))
|
||||
|
|
|
@ -34,10 +34,7 @@ import numpy as np
|
|||
import tractor
|
||||
|
||||
from piker.accounting import MktPair
|
||||
from piker.brokers import (
|
||||
open_cached_client,
|
||||
NoData,
|
||||
)
|
||||
from piker.brokers import open_cached_client
|
||||
from piker.log import get_logger, get_console_log
|
||||
from piker.data import ShmArray
|
||||
from piker.brokers._util import (
|
||||
|
@ -84,8 +81,6 @@ async def open_history_client(
|
|||
datetime, # start
|
||||
datetime, # end
|
||||
]:
|
||||
if timeframe != 60:
|
||||
raise DataUnavailable('Only 1m bars are supported')
|
||||
|
||||
array: np.ndarray = await client.bars(
|
||||
mkt,
|
||||
|
|
Loading…
Reference in New Issue