Shioaji Quote Api with bqplot¶
In [1]:
import json
import datetime as dt
import numpy as np
import pandas as pd
import bqplot as bq
import shioaji as sj
from ipywidgets import HBox, VBox
Init shioaji api and login¶
In [2]:
api = sj.Shioaji(simulation=False)
In [3]:
with open('login.json', 'r') as f:
kw_login = json.loads(f.read())
api.login(**kw_login)
Init Charts dataset¶
In [4]:
today = dt.date.today()
df_min = pd.DataFrame(index=pd.date_range(start=dt.datetime(*(today.year, today.month, today.day, 8, 45)),
end=dt.datetime(*(today.year, today.month, today.day, 13, 45)),
freq='1T'),
columns=['open', 'high', 'low', 'close'], dtype=float,
)
In [9]:
data_in = np.random.rand(2)
data_inner = np.random.rand(2)
data_outer = np.random.rand(4)
define init charts function¶
In [10]:
def init_ohlc_chart():
global ohlc_chart
sc = bq.LinearScale()
dt_scale = bq.DateScale()
ax_x = bq.Axis(label='datetime', scale=dt_scale)
ax_y = bq.Axis(label='price', scale=sc, orientation='vertical', tick_format='0.0f')
# Construct the marks
ohlc_chart = bq.OHLC(x=df_min.index, y=df_min.dropna().values,#df_tick_nosim_min.values[:10],
marker='candle', scales={'x': dt_scale, 'y': sc}, format='ohlc',
colors=['red', 'limegreen'], stroke='gray',
opacities=[0.85 for _ in df_min.index],
display_legend=True, labels=['TXFD9'])
fig = bq.Figure(axes=[ax_x, ax_y], marks=[ohlc_chart])
return fig
define processing data function¶
In [14]:
def proc_ohlc_data(quote_msg, new_deal_price):
global df_min
ts = pd.Timestamp("{Date} {Time}" .format(**quote_msg)).replace(second=0, microsecond=0)
df_min.loc[ts, 'open'] = new_deal_price if np.isnan(df_min.loc[ts, 'open']) else df_min.loc[ts, 'open']
df_min.loc[ts, 'high'] = new_deal_price if np.isnan(df_min.loc[ts, 'high']) or new_deal_price > df_min.loc[ts, 'high'] else df_min.loc[ts, 'high']
df_min.loc[ts, 'low'] = new_deal_price if np.isnan(df_min.loc[ts, 'low']) or new_deal_price < df_min.loc[ts, 'low'] else df_min.loc[ts, 'low']
df_min.loc[ts, 'close'] = new_deal_price
define update chart function¶
In [18]:
def update_ohlc_chart():
global ohlc_chart
with ohlc_chart.hold_sync():
ohlc_chart.x = df_min.dropna().index
ohlc_chart.y = df_min.dropna().values
define on quote callback¶
In [21]:
@sj.on_quote
def quote_callback(topic, quote_msg):
global tick_plot_length
global line_chart, scatter_chart
global pie_outer, pie_inner, pie_in
global x_tick_index, y_price, y_vol, updown_color, askbid_color_data
global new_index, new_deal_price, new_vol, new_updown_color, new_askbid_color_data
global ask_price, bid_price
global large_ask_deal_volsum, small_ask_deal_volsum, large_bid_deal_volsum
global small_bid_deal_volsum, ask_deal_count, bid_deal_count
global ask_bid_static
global bar_bidask, bar_bidask_diff
global x_bar_data, y_bar_data, color_bar_data, y_data_diff
global ohlc_chart, df_min
vol_threshold = 10
print(topic, quote_msg)
if topic.startswith('Q') and 'TXFD9' in topic:
proc_ask_bid_bardata(topic, quote_msg)
update_barchart(x_bar_data, y_bar_data,
color_bar_data, y_bar_data_diff)
elif topic.startswith('L') and 'TXFD9' in topic:
proc_tick_chartdata(topic, quote_msg)
proc_ask_bid_staticdata(topic, quote_msg, vol_threshold)
proc_ohlc_data(quote_msg, new_deal_price)
update_ohlc_chart()
update_tickandpie_chart(update_freq=1)
define event callback¶
In [22]:
@sj.on_event
def event_callback(resp_code, event_code, event):
print("Respone Code: {} | Event Code: {} | Event: {}".format(resp_code, event_code, event))
set callback function¶
In [23]:
api.quote.set_callback(quote_callback)
api.quote.set_event_callback(event_callback)
Chart¶
In [24]:
VBox([HBox([init_ohlc_chart(), init_tickchart(),]),
HBox([pies_chart(), bidask_bar_chart(), ])
])
VBox(children=(HBox(children=(Figure(axes=[Axis(label='datetime', scale=DateScale()), Axis(label='price', orie…
Subscribe Quote¶
In [25]:
TXFR1 = api.Contracts.Futures.TXF.TXF201904
TSE2330 = api.Contracts.Stocks.TSE.TSE2330
In [26]:
api.quote.subscribe(TXFR1)
api.quote.subscribe(TXFR1, quote_type='bidask')
api.quote.subscribe(TSE2330)
api.quote.subscribe(TSE2330, quote_type='bidask')
Respone Code: 200 | Event Code: 16 | Event: Subscribe or Unsubscribe ok Respone Code: 200 | Event Code: 16 | Event: Subscribe or Unsubscribe ok Respone Code: 200 | Event Code: 16 | Event: Subscribe or Unsubscribe ok Respone Code: 200 | Event Code: 16 | Event: Subscribe or Unsubscribe ok Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 356, 'AskVolume': [25, 44, 64, 75, 148], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 240, 'BidVolume': [12, 42, 59, 66, 61], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, -1, 0], 'DiffAskVolSum': -1, 'DiffBidVol': [0, 0, 0, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:35.328000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 356, 'AskVolume': [25, 44, 64, 75, 148], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 239, 'BidVolume': [11, 42, 59, 66, 61], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [-1, 0, 0, 0, 0], 'DiffBidVolSum': -1, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:35.453000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 341, 'AskVolume': [25, 44, 64, 65, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 239, 'BidVolume': [11, 42, 59, 66, 61], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, -10, -5], 'DiffAskVolSum': -15, 'DiffBidVol': [0, 0, 0, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:35.703000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 341, 'AskVolume': [25, 44, 64, 65, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 239, 'BidVolume': [11, 42, 59, 66, 61], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [0, 0, 0, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:35.828000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 341, 'AskVolume': [25, 44, 64, 65, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 241, 'BidVolume': [12, 42, 59, 66, 62], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [1, 0, 0, 0, 1], 'DiffBidVolSum': 2, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:36.203000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 341, 'AskVolume': [25, 44, 64, 65, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 244, 'BidVolume': [15, 42, 59, 66, 62], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [3, 0, 0, 0, 0], 'DiffBidVolSum': 3, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:36.328000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 342, 'AskVolume': [25, 45, 64, 65, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 244, 'BidVolume': [14, 44, 58, 65, 63], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 1, 0, 0, 0], 'DiffAskVolSum': 1, 'DiffBidVol': [-1, 2, -1, -1, 1], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:36.453000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 342, 'AskVolume': [25, 45, 64, 65, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 247, 'BidVolume': [16, 43, 58, 66, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [2, -1, 0, 1, 1], 'DiffBidVolSum': 3, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:36.578000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 342, 'AskVolume': [25, 45, 64, 65, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 248, 'BidVolume': [17, 44, 58, 65, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [1, 1, 0, -1, 0], 'DiffBidVolSum': 1, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:36.703000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 342, 'AskVolume': [25, 45, 64, 65, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 247, 'BidVolume': [16, 44, 58, 65, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [-1, 0, 0, 0, 0], 'DiffBidVolSum': -1, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:36.828000'} MKT/idcdmzpcr01/TSE/2330 {'Close': [244.5], 'Time': '13:12:37.754742', 'VolSum': [15915], 'Volume': [1]} QUT/idcdmzpcr01/TSE/2330 {'AskPrice': [245.0, 245.5, 246.0, 246.5, 247.0], 'AskVolume': [1148, 377, 501, 182, 218], 'BidPrice': [244.5, 244.0, 243.5, 243.0, 242.5], 'BidVolume': [456, 373, 1529, 1670, 280], 'Date': '2019/03/29', 'Time': '13:12:37.754742'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 342, 'AskVolume': [25, 45, 64, 65, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 247, 'BidVolume': [16, 44, 58, 65, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [0, 0, 0, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:37.953000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 339, 'AskVolume': [25, 45, 64, 62, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 247, 'BidVolume': [16, 44, 58, 65, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, -3, 0], 'DiffAskVolSum': -3, 'DiffBidVol': [0, 0, 0, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:38.078000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 339, 'AskVolume': [25, 45, 64, 62, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 248, 'BidVolume': [16, 44, 59, 65, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [0, 0, 1, 0, 0], 'DiffBidVolSum': 1, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:38.203000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 340, 'AskVolume': [26, 45, 64, 62, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 247, 'BidVolume': [16, 44, 59, 64, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [1, 0, 0, 0, 0], 'DiffAskVolSum': 1, 'DiffBidVol': [0, 0, 0, -1, 0], 'DiffBidVolSum': -1, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:38.703000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 340, 'AskVolume': [26, 45, 64, 62, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 247, 'BidVolume': [16, 43, 60, 64, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [0, -1, 1, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:38.828000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 341, 'AskVolume': [26, 46, 64, 62, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 247, 'BidVolume': [16, 43, 60, 64, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 1, 0, 0, 0], 'DiffAskVolSum': 1, 'DiffBidVol': [0, 0, 0, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:39.078000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 341, 'AskVolume': [26, 46, 64, 62, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 247, 'BidVolume': [16, 43, 60, 64, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [0, 0, 0, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:39.328000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 341, 'AskVolume': [26, 46, 64, 62, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 245, 'BidVolume': [14, 43, 60, 64, 64], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [-2, 0, 0, 0, 0], 'DiffBidVolSum': -2, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:39.453000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 341, 'AskVolume': [26, 46, 64, 62, 143], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 242, 'BidVolume': [12, 42, 60, 65, 63], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [-2, -1, 0, 1, -1], 'DiffBidVolSum': -3, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:39.578000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 311, 'AskVolume': [26, 46, 64, 62, 113], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 242, 'BidVolume': [12, 42, 60, 65, 63], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, -30], 'DiffAskVolSum': -30, 'DiffBidVol': [0, 0, 0, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:39.828000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 311, 'AskVolume': [26, 46, 64, 62, 113], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 248, 'BidVolume': [18, 42, 60, 65, 63], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 0, 0, 0, 0], 'DiffAskVolSum': 0, 'DiffBidVol': [6, 0, 0, 0, 0], 'DiffBidVolSum': 6, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10620.7, 'Time': '13:12:40.078000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 308, 'AskVolume': [23, 46, 64, 62, 113], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 249, 'BidVolume': [19, 44, 59, 64, 63], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [-3, 0, 0, 0, 0], 'DiffAskVolSum': -3, 'DiffBidVol': [1, 2, -1, -1, 0], 'DiffBidVolSum': 1, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10615.63, 'Time': '13:12:40.203000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 309, 'AskVolume': [23, 47, 64, 62, 113], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 249, 'BidVolume': [19, 44, 59, 64, 63], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [0, 1, 0, 0, 0], 'DiffAskVolSum': 1, 'DiffBidVol': [0, 0, 0, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10615.63, 'Time': '13:12:40.953000'} Q/TFE/TXFD9 {'AskPrice': [10580.0, 10581.0, 10582.0, 10583.0, 10584.0], 'AskVolSum': 310, 'AskVolume': [24, 47, 64, 62, 113], 'BidPrice': [10579.0, 10578.0, 10577.0, 10576.0, 10575.0], 'BidVolSum': 249, 'BidVolume': [19, 44, 59, 64, 63], 'Code': 'TXFD9', 'Date': '2019/03/29', 'DiffAskVol': [1, 0, 0, 0, 0], 'DiffAskVolSum': 1, 'DiffBidVol': [0, 0, 0, 0, 0], 'DiffBidVolSum': 0, 'FirstDerivedAskPrice': 10581.0, 'FirstDerivedAskVolume': 6, 'FirstDerivedBidPrice': 10577.0, 'FirstDerivedBidVolume': 1, 'TargetKindPrice': 10615.63, 'Time': '13:12:41.078000'}
In [ ]: