Port kraken to declare "wap" field

vwap_backup
Tyler Goodlet 2020-12-12 17:14:47 -05:00
parent 098db15b2d
commit 18d41d0d24
1 changed files with 5 additions and 3 deletions

View File

@ -57,13 +57,15 @@ _ohlc_dtype = [
('close', float), ('close', float),
('volume', float), ('volume', float),
('count', int), ('count', int),
('vwap', float), ('bar_wap', float),
] ]
# UI components allow this to be declared such that additional # UI components allow this to be declared such that additional
# (historical) fields can be exposed. # (historical) fields can be exposed.
ohlc_dtype = np.dtype(_ohlc_dtype) ohlc_dtype = np.dtype(_ohlc_dtype)
_show_wap_in_history = True
class Client: class Client:
@ -341,7 +343,7 @@ async def stream_quotes(
while True: while True:
try: try:
async with trio_websocket.open_websocket_url( async with trio_websocket.open_websocket_url(
'wss://ws.kraken.com', 'wss://ws.kraken.com/',
) as ws: ) as ws:
# XXX: setup subs # XXX: setup subs
@ -433,7 +435,7 @@ async def stream_quotes(
'high', 'high',
'low', 'low',
'close', 'close',
'vwap', 'bar_wap', # in this case vwap of bar
'volume'] 'volume']
][-1] = ( ][-1] = (
o, o,