From 2c461ea185468d06c4b5068457a5ed59b2f483c8 Mon Sep 17 00:00:00 2001 From: Elizabeth Date: Mon, 16 Dec 2019 15:27:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80=E5=A4=A7?= =?UTF-8?q?=E6=B3=A2=E6=96=87=E4=BB=B6=EF=BC=8C=E5=8F=91=E5=B8=83=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20web=5Fgui=20=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 3 ++ tqsdk/api.py | 53 +++++++++++-------- tqsdk/backtest.py | 2 +- tqsdk/demo/tutorial/backtest.py | 5 +- tqsdk/demo/tutorial/t10.py | 2 + tqsdk/demo/tutorial/t90.py | 14 ++--- tqsdk/demo/tutorial/t91.py | 26 ++++----- tqsdk/demo/tutorial/t92.py | 20 ++++--- tqsdk/demo/tutorial/t93.py | 24 +++++---- tqsdk/demo/tutorial/t94.py | 17 +++--- tqsdk/demo/tutorial/t95.py | 37 ++++++------- tqsdk/exceptions.py | 17 +++--- tqsdk/sim.py | 86 +++++++++++++++--------------- tqsdk/test/api/helper.py | 2 +- tqsdk/test/demo/test_example.py | 6 +-- tqsdk/tqhelper.py | 9 +--- tqsdk/tqwebhelper.py | 93 +++++++++++++++++---------------- 17 files changed, 212 insertions(+), 204 deletions(-) diff --git a/setup.py b/setup.py index 6a95fee1..65112747 100644 --- a/setup.py +++ b/setup.py @@ -53,4 +53,7 @@ def get_tag(self): "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", ], + package_data={ + "tqsdk": ["web"] + } ) diff --git a/tqsdk/api.py b/tqsdk/api.py index 5c0e6926..b06029c9 100644 --- a/tqsdk/api.py +++ b/tqsdk/api.py @@ -53,8 +53,8 @@ class TqApi(object): DEFAULT_INS_URL = "https://openmd.shinnytech.com/t/md/symbols/latest.json" def __init__(self, account: Union['TqAccount', TqSim, 'TqApi', None] = None, url: Optional[str] = None, - backtest: Optional[TqBacktest] = None, debug: Optional[str] = None, - loop: Optional[asyncio.AbstractEventLoop] = None, _ins_url=None, _md_url=None, _td_url=None, web_gui=False, _http_server_port=None) -> None: + backtest: Optional[TqBacktest] = None, web_gui: bool = False, debug: Optional[str] = None, + loop: Optional[asyncio.AbstractEventLoop] = None, _ins_url=None, _md_url=None, _td_url=None) -> None: """ 创建天勤接口实例 @@ -87,25 +87,33 @@ def __init__(self, account: Union['TqAccount', TqSim, 'TqApi', None] = None, url * 为了图形化界面能够接收到程序传输的数据并且刷新,在程序中,需要循环调用 api.wait_update的形式去更新和获取数据 * 推荐打开图形化界面的浏览器为Google Chrome 或 Firefox - Example:: + Example1:: # 使用实盘帐号直连行情和交易服务器 from tqsdk import TqApi, TqAccount api = TqApi(TqAccount("H海通期货", "022631", "123456")) + Example2:: + # 使用模拟帐号直连行情服务器 from tqsdk import TqApi, TqSim api = TqApi(TqSim()) # 不填写参数则默认为 TqSim() 模拟账号 + Example3:: + # 进行策略回测 from datetime import date from tqsdk import TqApi, TqSim, TqBacktest api = TqApi(TqSim(), backtest=TqBacktest(start_dt=date(2018, 5, 1), end_dt=date(2018, 10, 1))) + Example4:: + # 开启 web_gui 功能 from tqsdk import TqApi api = TqApi(web_gui=True) + """ + # 记录参数 if account is None: account = TqSim() @@ -126,10 +134,8 @@ def __init__(self, account: Union['TqAccount', TqSim, 'TqApi', None] = None, url if _td_url: self._td_url = _td_url self._loop = asyncio.SelectorEventLoop() if loop is None else loop # 创建一个新的 ioloop, 避免和其他框架/环境产生干扰 - self._tq_web_helper = TqWebHelper(_http_server_port=_http_server_port, enabled_web_gui=web_gui) # 初始化 logger - self._logger = logging.getLogger("TqApi") self._logger.setLevel(logging.DEBUG) if not self._logger.handlers: @@ -183,8 +189,10 @@ def __init__(self, account: Union['TqAccount', TqSim, 'TqApi', None] = None, url self._master._slaves.append(self) self._account = self._master._account self._to_tq = self._master._to_tq + self._web_gui = False # 如果是slave, _web_gui 一定是 False return # 注: 如果是slave,则初始化到这里结束并返回,以下代码不执行 + self._web_gui = web_gui # 初始化 if sys.platform.startswith("win"): self.create_task(self._windows_patch()) # Windows系统下asyncio不支持KeyboardInterrupt的临时补丁 @@ -1129,11 +1137,10 @@ def _setup_connection(self): self._account._run(self, self._send_chan, self._recv_chan, ws_md_send_chan, ws_md_recv_chan, ws_td_send_chan, ws_td_recv_chan)) - # 与web配合, 行情和交易都要 对接到 backtest 上 - if self._tq_web_helper: - web_send_chan, web_recv_chan = TqChan(self), TqChan(self) - self.create_task(self._tq_web_helper._run(self, web_send_chan, web_recv_chan, self._send_chan, self._recv_chan)) - self._send_chan, self._recv_chan = web_send_chan, web_recv_chan + # 与 web 配合, 在 tq_web_helper 内部中处理 web_gui 选项 + web_send_chan, web_recv_chan = TqChan(self), TqChan(self) + self.create_task(TqWebHelper()._run(self, web_send_chan, web_recv_chan, self._send_chan, self._recv_chan)) + self._send_chan, self._recv_chan = web_send_chan, web_recv_chan # 抄送部分数据包到天勤 if tq_send_chan and tq_recv_chan: @@ -1451,7 +1458,7 @@ def _process_chart_data_for_web(self, serial, symbol, duration, col, count, righ "color": int(data.get(".color", [0xFFFF0000])[-1]), "width": int(data.get(".width", [1])[-1]), "board": data.get(".board", ["MAIN"])[-1] - }) + }, aid="set_web_chart_data") elif data_type == "KSERIAL": send_data = {} range_left = right - count @@ -1468,11 +1475,11 @@ def _process_chart_data_for_web(self, serial, symbol, duration, col, count, righ "range_left": right - count, "range_right": right - 1, "board": data.get(".board", ["MAIN"])[-1] - }) + }, aid="set_web_chart_data") - def _send_series_data(self, symbol, duration, serial_id, serial_data): + def _send_series_data(self, symbol, duration, serial_id, serial_data, aid="set_chart_data"): pack = { - "aid": "set_chart_data", + "aid": aid, "symbol": symbol, "dur_nano": duration, "datas": { @@ -1551,8 +1558,7 @@ async def _connect(self, url, send_chan, recv_chan): }) as client: # 发送网络连接建立的通知,code = 2019112901 notify_id = uuid.UUID(int=TqApi.RD.getrandbits(128)).hex - notify = {} - notify[notify_id] = { + notify = { "type": "MESSAGE", "level": "INFO", "code": 2019112901, @@ -1561,6 +1567,8 @@ async def _connect(self, url, send_chan, recv_chan): } if not first_connect: # 如果不是第一次连接, 即为重连 + # 发送网络连接重新建立的通知,code = 2019112902 + notify["code"] = 2019112902 notify["level"] = "WARNING" notify["content"] = "与 %s 的网络连接已恢复" % url un_processed = True # 重连后数据未处理完 @@ -1570,10 +1578,10 @@ async def _connect(self, url, send_chan, recv_chan): if url == self._md_url: # 获取重连时需发送的所有 set_chart 指令包 set_chart_packs = {k: v for k, v in resend_request.items() if v.get("aid") == "set_chart"} - # 发送网络连接建立的通知,code = 2019112901,这里区分了第一次连接和重连 + # 发送网络连接建立的通知,code = 2019112901 or 2019112902,这里区分了第一次连接和重连 await recv_chan.send({ "aid": "rtn_data", - "data": [{"notify": notify}] + "data": [{"notify": {notify_id: notify}}] }) send_task = self.create_task( self._send_handler(client, url, resend_request, send_chan, first_connect)) @@ -1682,19 +1690,18 @@ async def _connect(self, url, send_chan, recv_chan): # 希望做到的效果是遇到网络问题可以断线重连, 但是可能抛出的例外太多了(TimeoutError,socket.gaierror等), 又没有文档或工具可以理出 try 代码中所有可能遇到的例外 # 而这里的 except 又需要处理所有子函数及子函数的子函数等等可能抛出的例外, 因此这里只能遇到问题之后再补, 并且无法避免 false positive 和 false negative except (websockets.exceptions.ConnectionClosed, OSError): - # 发送网络连接断开的通知,code = 2019112902 + # 发送网络连接断开的通知,code = 2019112911 notify_id = uuid.UUID(int=TqApi.RD.getrandbits(128)).hex - notify = {} - notify[notify_id] = { + notify = { "type": "MESSAGE", "level": "WARNING", - "code": 2019112902, + "code": 2019112911, "content": "与 %s 的网络连接断开,请检查客户端及网络是否正常" % url, "url": url } await recv_chan.send({ "aid": "rtn_data", - "data": [{"notify": notify}] + "data": [{"notify": {notify_id: notify}}] }) finally: if first_connect: diff --git a/tqsdk/backtest.py b/tqsdk/backtest.py index aa26ded1..9e81c7ed 100644 --- a/tqsdk/backtest.py +++ b/tqsdk/backtest.py @@ -200,7 +200,7 @@ async def _send_diff(self): if not self._serials: # 当无可发送数据时则抛出BacktestFinished例外,包括未订阅任何行情 或 所有已订阅行情的最后一笔行情获取完成 self._logger.warning("回测结束") if self._current_dt < self._end_dt: - self._current_dt = 150000000000000000000 # 一个远大于 end_dt 的日期 + self._current_dt = 2145888000000000000 # 一个远大于 end_dt 的日期 20380101 await self._sim_recv_chan.send({ "aid": "rtn_data", "data": [{ diff --git a/tqsdk/demo/tutorial/backtest.py b/tqsdk/demo/tutorial/backtest.py index fa51dc6f..897aad9a 100644 --- a/tqsdk/demo/tutorial/backtest.py +++ b/tqsdk/demo/tutorial/backtest.py @@ -3,8 +3,7 @@ __author__ = 'chengzhi' from datetime import date -from contextlib import closing -from tqsdk import TqApi, TqSim, TqBacktest, TargetPosTask +from tqsdk import TqApi, TqBacktest, TargetPosTask ''' 如果当前价格大于5分钟K线的MA15则开多仓 @@ -12,7 +11,7 @@ 回测从 2018-05-01 到 2018-10-01 ''' # 在创建 api 实例时传入 TqBacktest 就会进入回测模式 -api = TqApi(TqSim(init_balance=100000), backtest=TqBacktest(start_dt=date(2018, 5, 2), end_dt=date(2018, 5, 5))) +api = TqApi(backtest=TqBacktest(start_dt=date(2018, 5, 1), end_dt=date(2018, 10, 1))) # 获得 m1901 5分钟K线的引用 klines = api.get_kline_serial("DCE.m1901", 5 * 60, data_length=15) # 创建 m1901 的目标持仓 task,该 task 负责调整 m1901 的仓位到指定的目标仓位 diff --git a/tqsdk/demo/tutorial/t10.py b/tqsdk/demo/tutorial/t10.py index 6e2adeff..65427e4d 100644 --- a/tqsdk/demo/tutorial/t10.py +++ b/tqsdk/demo/tutorial/t10.py @@ -1,5 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +__author__ = 'chengzhi' + from tqsdk import TqApi # 创建API实例. diff --git a/tqsdk/demo/tutorial/t90.py b/tqsdk/demo/tutorial/t90.py index 5b23026f..e3780ee8 100644 --- a/tqsdk/demo/tutorial/t90.py +++ b/tqsdk/demo/tutorial/t90.py @@ -7,19 +7,15 @@ ''' 画图示例: 在主图中画指标线 -注意:1 画图功能仅在天勤终端/天勤Vscode插件中生效,请在这两个平台中运行画图相关的代码 - 2 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 +注意: 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 ''' -api = TqApi(web_gui=True) +api = TqApi(web_gui=True) # web_gui=True, 开启使用 web 界面查看绘图结果的功能 klines = api.get_kline_serial("SHFE.au2006", 5) -ma = MA(klines, 30) # 使用tqsdk自带指标函数计算均线 -klines["ma_MAIN"] = ma.ma -# 在主图中画一根默认颜色(红色)的ma指标线 +ma = MA(klines, 30) # 使用 tqsdk 自带指标函数计算均线 +klines["ma_MAIN"] = ma.ma # 在主图中画一根默认颜色(红色)的 ma 指标线 +# 由于需要在浏览器中查看绘图结果,因此程序不能退出 while True: api.wait_update() - if api.is_changing(klines): - ma = MA(klines, 30) # 使用tqsdk自带指标函数计算均线 - klines["ma_MAIN"] = ma.ma diff --git a/tqsdk/demo/tutorial/t91.py b/tqsdk/demo/tutorial/t91.py index bb3b03b1..fd34bdeb 100644 --- a/tqsdk/demo/tutorial/t91.py +++ b/tqsdk/demo/tutorial/t91.py @@ -7,24 +7,24 @@ ''' 画图示例: 在附图中画指标线 -注意:1 画图功能仅在天勤终端/天勤Vscode插件中生效,请在这两个平台中运行画图相关的代码 - 2 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 +注意: 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 ''' -api = TqApi(web_gui=True) +api = TqApi(web_gui=True) # web_gui=True, 开启使用 web 界面查看绘图结果的功能 klines = api.get_kline_serial("SHFE.au1910", 24 * 60 * 60) ma = MA(klines, 30) # 使用tqsdk自带指标函数计算均线 -while True: - # 示例: 在附图中画一根绿色的ma指标线 - klines["ma_B2"] = ma.ma - klines["ma_B2.board"] = "B2" # 设置附图: 可以设置任意字符串,同一字符串表示同一副图 - klines["ma_B2.color"] = 0xFF00FF00 # 设置为绿色 +# 示例: 在附图中画一根绿色的ma指标线 +klines["ma_B2"] = ma.ma +klines["ma_B2.board"] = "B2" # 设置附图: 可以设置任意字符串,同一字符串表示同一副图 +klines["ma_B2.color"] = 0xFF00FF00 # 设置为绿色 - # 示例: 在另一个附图画一根比ma小4的宽度为4的紫色指标线 - klines["ma_4"] = ma.ma - 4 - klines["ma_4.board"] = "MA4" # 设置为另一个附图 - klines["ma_4.color"] = 0xFF9933CC # 设置为紫色 - klines["ma_4.width"] = 4 # 设置宽度为4,默认为1 +# 示例: 在另一个附图画一根比ma小4的宽度为4的紫色指标线 +klines["ma_4"] = ma.ma - 4 +klines["ma_4.board"] = "MA4" # 设置为另一个附图 +klines["ma_4.color"] = 0xFF9933CC # 设置为紫色 +klines["ma_4.width"] = 4 # 设置宽度为4,默认为1 +# 由于需要在浏览器中查看绘图结果,因此程序不能退出 +while True: api.wait_update() diff --git a/tqsdk/demo/tutorial/t92.py b/tqsdk/demo/tutorial/t92.py index 9c4028eb..66afff1a 100644 --- a/tqsdk/demo/tutorial/t92.py +++ b/tqsdk/demo/tutorial/t92.py @@ -6,16 +6,20 @@ ''' 画图示例: 在主图中画信号线及文字标注 -注意:1 画图功能仅在天勤终端/天勤Vscode插件中生效,请在这两个平台中运行画图相关的代码 - 2 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 +注意: 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 ''' -api = TqApi(web_gui=True) -klines = api.get_kline_serial("SHFE.au2002", 60) +api = TqApi(web_gui=True) # web_gui=True, 开启使用 web 界面查看绘图结果的功能 +klines = api.get_kline_serial("SHFE.au2002", 300) +# 在主图中最后一根K线上画射线以标注需要的信号 +api.draw_line(klines, -1, klines.iloc[-1].close, -1, klines.iloc[-1].high, line_type="RAY", color=0xFFFF9900, width=3) +# 绘制字符串 +api.draw_text(klines, "信号1", x=-1, y=klines.iloc[-1].high + 5, color=0xFFFF3333) +# 给主图最后5根K线加一个方框 +api.draw_box(klines, x1=-5, y1=klines.iloc[-5]["high"], x2=-1, y2=klines.iloc[-1]["low"], width=1, color=0xFF0000FF, + bg_color=0x7000FF00) + +# 由于需要在浏览器中查看绘图结果,因此程序不能退出 while True: - # 在主图中最后一根K线上画射线以标注需要的信号 - api.draw_line(klines, -1, klines.iloc[-1].close, -1, klines.iloc[-1].high, id="my_line", line_type="RAY", color=0xFFFF9900, width=3) - # 绘制字符串 - api.draw_text(klines, "信号1", x=-1, y=klines.iloc[-1].high + 5, id="my_text", color=0xFFFF3333) api.wait_update() diff --git a/tqsdk/demo/tutorial/t93.py b/tqsdk/demo/tutorial/t93.py index 6d43a1bc..d72add92 100644 --- a/tqsdk/demo/tutorial/t93.py +++ b/tqsdk/demo/tutorial/t93.py @@ -6,17 +6,21 @@ ''' 画图示例: 在主图中画线和方框 -注意:1 画图功能仅在天勤终端/天勤Vscode插件中生效,请在这两个平台中运行画图相关的代码 - 2 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 +注意: 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 ''' -api = TqApi(web_gui=True) -klines = api.get_kline_serial("SHFE.cu1910", 86400) +api = TqApi(web_gui=True) # web_gui=True, 开启使用 web 界面查看绘图结果的功能 +klines = api.get_kline_serial("SHFE.au2002", 60) +# 由于需要在浏览器中查看绘图结果,因此程序不能退出 while True: - # 在主图中画直线 - api.draw_line(klines, -4, klines.iloc[-4].low, -3, klines.iloc[-3].high, line_type="LINE", color=0xFF0000FF) - # 给主图最后5根K线加一个方框 - api.draw_box(klines, x1=-5, y1=klines.iloc[-5]["high"], x2=-1, y2=klines.iloc[-1]["low"], width=1, color=0xFF0000FF, - bg_color=0x7000FF00) - api.wait_update() + api.wait_update() # 当有业务信息发生变化时执行 + # 当最后 1 根柱子最大最小值价差大于 0.05 时,在主图绘制信号 + high = klines.iloc[-1].high + low = klines.iloc[-1].low + if high - low > 0.05: + # 绘制直线, 每一个 id 对应同一条直线 + api.draw_line(klines, -1, high, -1, low, id="box%.0f" % (klines.iloc[-1].id), color=0xaa662244, width=4) + # 绘制字符串 + api.draw_text(klines, "信号1", x=-1, y=low, id="text%.0f" % (klines.iloc[-1].id), color=0xFFFF3333) + diff --git a/tqsdk/demo/tutorial/t94.py b/tqsdk/demo/tutorial/t94.py index d122dc50..813348e9 100644 --- a/tqsdk/demo/tutorial/t94.py +++ b/tqsdk/demo/tutorial/t94.py @@ -6,8 +6,7 @@ ''' 画图示例: 在附图中画K线 -注意:1 画图功能仅在天勤终端/天勤Vscode插件中生效,请在这两个平台中运行画图相关的代码 - 2 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 +注意: 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 ''' api = TqApi(web_gui=True) @@ -15,11 +14,13 @@ klines = api.get_kline_serial("SHFE.cu1910", 86400) klines2 = api.get_kline_serial("SHFE.cu1911", 86400) +# 在附图画出 cu1911 的K线: 需要将open、high、log、close的数据都设置正确 +klines["cu1911.open"] = klines2["open"] +klines["cu1911.high"] = klines2["high"] +klines["cu1911.low"] = klines2["low"] +klines["cu1911.close"] = klines2["close"] +klines["cu1911.board"] = "B2" + +# 由于需要在浏览器中查看绘图结果,因此程序不能退出 while True: - # 在附图画出 cu1911 的K线: 需要将open、high、log、close的数据都设置正确 - klines["cu1911.open"] = klines2["open"] - klines["cu1911.high"] = klines2["high"] - klines["cu1911.low"] = klines2["low"] - klines["cu1911.close"] = klines2["close"] - klines["cu1911.board"] = "B2" api.wait_update() diff --git a/tqsdk/demo/tutorial/t95.py b/tqsdk/demo/tutorial/t95.py index 881589eb..96d0533a 100644 --- a/tqsdk/demo/tutorial/t95.py +++ b/tqsdk/demo/tutorial/t95.py @@ -7,33 +7,28 @@ ''' 画图示例: 在同一副图中画K线、线段和方框 -注意:1 画图功能仅在天勤终端/天勤Vscode插件中生效,请在这两个平台中运行画图相关的代码 - 2 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 +注意: 画图示例中用到的数据不含有实际意义,请根据自己的实际策略情况进行修改 ''' api = TqApi(web_gui=True) - klines = api.get_kline_serial("CFFEX.T2003", 10) klines2 = api.get_kline_serial("CFFEX.T2006", 10) +# 在附图画出 T2006 的K线: 需要将open、high、log、close的数据都设置正确 +klines["T2006.open"] = klines2["open"] +klines["T2006.high"] = klines2["high"] +klines["T2006.low"] = klines2["low"] +klines["T2006.close"] = klines2["close"] +klines["T2006.board"] = "B2" +ma = MA(klines, 30) +klines["ma_MAIN"] = ma.ma +# 在附图中画线段(默认为红色) +api.draw_line(klines, -10, klines2.iloc[-10].low, -3, klines2.iloc[-3].high, id="my_line", board="B2", line_type="SEG", color=0xFFFF00FF, width=3) +# 在附图K线上画黄色的方框: 需要设置画在附图时, 将board参数选择到对应的图板即可 +api.draw_box(klines, x1=-5, y1=klines2.iloc[-5]["high"], x2=-1, y2=klines2.iloc[-1]["low"], id="my_box", board="B2", width=1, + color=0xFF0000FF, bg_color=0x70FFFF00) + +# 由于需要在浏览器中查看绘图结果,因此程序不能退出 while True: - - # 在附图画出 cu1911 的K线: 需要将open、high、log、close的数据都设置正确 - klines["cu1911.open"] = klines2["open"] - klines["cu1911.high"] = klines2["high"] - klines["cu1911.low"] = klines2["low"] - klines["cu1911.close"] = klines2["close"] - klines["cu1911.board"] = "B2" - ma = MA(klines, 30) - klines["ma_MAIN"] = ma.ma - - # 在附图中画线段(默认为红色) - api.draw_line(klines, -10, klines2.iloc[-10].low, -3, klines2.iloc[-3].high, id="my_line", board="B2", line_type="SEG", color=0xFFFF00FF, width=3) - - # 在附图K线上画黄色的方框: 需要设置画在附图时, 将board参数选择到对应的图板即可 - api.draw_box(klines, x1=-5, y1=klines2.iloc[-5]["high"], x2=-1, y2=klines2.iloc[-1]["low"], id="my_box", board="B2", width=1, - color=0xFF0000FF, bg_color=0x70FFFF00) - api.wait_update() - diff --git a/tqsdk/exceptions.py b/tqsdk/exceptions.py index 70585059..7832dab6 100644 --- a/tqsdk/exceptions.py +++ b/tqsdk/exceptions.py @@ -12,18 +12,23 @@ class BacktestFinished(Exception): def __init__(self, api): message = "回测结束" + self._logger = api._logger.getChild("BacktestFinished") super().__init__(message) if BacktestFinished._orig_excepthook is None: BacktestFinished._orig_excepthook = sys.excepthook def _except_catcher(type, value, traceback): if type is BacktestFinished: - try: - print("----------- Backtest finished, press [Ctrl + C] to exit. -----------") - while True: - api.wait_update() - except KeyboardInterrupt: - pass + if api._web_gui: + try: + self._logger.warning("----------- Backtest finished, press [Ctrl + C] to exit. -----------") + while True: + api.wait_update() + except KeyboardInterrupt: + pass + + if not api._loop.is_closed(): + api.close() sys.exit() BacktestFinished._orig_excepthook(type, value, traceback) diff --git a/tqsdk/sim.py b/tqsdk/sim.py index a4316783..2754ecaa 100644 --- a/tqsdk/sim.py +++ b/tqsdk/sim.py @@ -5,7 +5,6 @@ from datetime import datetime import statistics - class TqSim(object): """ 天勤模拟交易类 @@ -36,8 +35,8 @@ def __init__(self, init_balance: float = 10000000.0, account_id: str = "TQSIM") async def _run(self, api, api_send_chan, api_recv_chan, md_send_chan, md_recv_chan): """模拟交易task""" self._api = api - self._tqsdk_backtest = None # 储存可能的回测信息 - self._tqsdk_stat = None # 回测结束后储存回测报告信息 + self._tqsdk_backtest = {} # 储存可能的回测信息 + self._tqsdk_stat = {} # 回测结束后储存回测报告信息 self._logger = api._logger.getChild("TqSim") # 调试信息输出 self._api_send_chan = api_send_chan self._api_recv_chan = api_recv_chan @@ -98,25 +97,13 @@ async def _run(self, api, api_send_chan, api_recv_chan, md_send_chan, md_recv_ch await self._send_diff() else: await self._md_send_chan.send(pack) - if self._tqsdk_backtest is not None and self._tqsdk_backtest["current_dt"] > self._tqsdk_backtest["end_dt"] \ - and self._tqsdk_stat is None: - self._settle() - self._report() - await self._api_recv_chan.send({ - "aid": "rtn_data", - "data": [{ - "trade": { - self._account_id: { - "accounts": { - "CNY": { - "_tqsdk_stat": self._tqsdk_stat - } - } - } - } - }] - }) + if self._tqsdk_backtest != {} and self._tqsdk_backtest["current_dt"] > self._tqsdk_backtest["end_dt"] \ + and not self._tqsdk_stat: + # 回测情况下,把 _send_stat_report 在循环中回测结束时执行 + await self._send_stat_report() finally: + if not self._tqsdk_stat: + await self._send_stat_report() md_task.cancel() async def _md_handler(self): @@ -144,6 +131,24 @@ async def _subscribe_quote(self): "ins_list": ",".join(self._all_subscribe) }) + async def _send_stat_report(self): + self._settle() + self._report() + await self._api_recv_chan.send({ + "aid": "rtn_data", + "data": [{ + "trade": { + self._account_id: { + "accounts": { + "CNY": { + "_tqsdk_stat": self._tqsdk_stat + } + } + } + } + }] + }) + def _md_recv(self, pack): for d in pack["data"]: d.pop("trade", None) @@ -162,18 +167,13 @@ def _md_recv(self, pack): } }) self._has_send_init_account = True - tqsdk_backtest = d.get("_tqsdk_backtest") - if tqsdk_backtest is not None: - if self._tqsdk_backtest is None: - self._tqsdk_backtest = tqsdk_backtest - else: - self._tqsdk_backtest["current_dt"] = tqsdk_backtest["current_dt"] + self._tqsdk_backtest.update(d.get("_tqsdk_backtest", {})) for symbol, quote_diff in d.get("quotes", {}).items(): if quote_diff is None: continue quote = self._ensure_quote(symbol) quote["datetime"] = quote_diff.get("datetime", quote["datetime"]) - if self._tqsdk_backtest is None: + if self._tqsdk_backtest == {}: self._current_datetime = max(quote["datetime"], self._current_datetime) else: self._current_datetime = datetime.fromtimestamp(self._tqsdk_backtest["current_dt"] / 1e9).strftime("%Y-%m-%d %H:%M:%S.%f") @@ -365,8 +365,10 @@ def _settle(self): def _report(self): if not self._trade_log: return + self._tqsdk_stat["init_balance"] = self._init_balance # 起始资金 + self._tqsdk_stat["balance"] = self._account["balance"] # 结束资金 + self._tqsdk_stat["max_drawdown"] = 0 # 最大回撤 max_balance = 0 - max_drawdown = 0 daily_yield = [] self._logger.warning("模拟交易成交记录") for d in sorted(self._trade_log.keys()): @@ -374,8 +376,8 @@ def _report(self): if balance > max_balance: max_balance = balance drawdown = (max_balance - balance) / max_balance - if drawdown > max_drawdown: - max_drawdown = drawdown + if drawdown > self._tqsdk_stat["max_drawdown"]: + self._tqsdk_stat["max_drawdown"] = drawdown daily_yield.append( self._trade_log[d]["account"]["balance"] / self._trade_log[d]["account"]["pre_balance"] - 1) for t in self._trade_log[d]["trades"]: @@ -383,12 +385,16 @@ def _report(self): datetime.fromtimestamp(t["trade_date_time"] / 1e9).strftime( "%Y-%m-%d %H:%M:%S.%f"), t["symbol"], t["offset"], t["direction"], t["volume"], t["price"], t["commission"]) + mean = statistics.mean(daily_yield) rf = 0.0001 stddev = statistics.pstdev(daily_yield, mu=mean) - sharpe_ratio = 250 ** (1 / 2) * (mean - rf) / stddev if stddev else float("inf") - ror = self._account["balance"] / self._init_balance - annual_yield = ror ** (250 / len(self._trade_log)) + self._tqsdk_stat["sharpe_ratio"] = 250 ** (1 / 2) * (mean - rf) / stddev if stddev else float("inf") # 年化夏普率 + + _ror = self._tqsdk_stat["balance"] / self._tqsdk_stat["init_balance"] + self._tqsdk_stat["ror"] = _ror - 1 # 收益率 + self._tqsdk_stat["annual_yield"] = _ror ** (250 / len(self._trade_log)) - 1 # 年化收益率 + self._logger.warning("模拟交易账户资金") for d in sorted(self._trade_log.keys()): account = self._trade_log[d]["account"] @@ -398,16 +404,8 @@ def _report(self): account["close_profit"], account["margin"], account["commission"], account["risk_ratio"] * 100) self._logger.warning("收益率:%.2f%%,年化收益率:%.2f%%,最大回撤:%.2f%%,年化夏普率:%.4f", - (ror - 1) * 100, (annual_yield - 1) * 100, max_drawdown * 100, sharpe_ratio) - # 记录下来 report - self._tqsdk_stat = { - "init_balance": self._init_balance, # 起始资金 - "balance": self._account["balance"], # 结束资金 - "ror": (ror - 1) * 100, # 收益率 - "annual_yield": (annual_yield - 1) * 100, # 年化收益率 - "max_drawdown": max_drawdown * 100, # 最大回撤 - "sharpe_ratio": sharpe_ratio # 年化夏普率 - } + self._tqsdk_stat["ror"] * 100, self._tqsdk_stat["annual_yield"] * 100, + self._tqsdk_stat["max_drawdown"] * 100, self._tqsdk_stat["sharpe_ratio"]) def _ensure_trade_log(self): return self._trade_log.setdefault(self._trading_day_end[:10], { diff --git a/tqsdk/test/api/helper.py b/tqsdk/test/api/helper.py index 2395446d..ee01e159 100644 --- a/tqsdk/test/api/helper.py +++ b/tqsdk/test/api/helper.py @@ -158,7 +158,7 @@ async def on_connected(self, source, connection): # assert self._expecting["action"] == "connected" async def on_received(self, source, pack): - if not self._expecting : + if not self._expecting: await self._process_script() if pack["aid"] != "peek_message": assert self._expecting["source"] == source diff --git a/tqsdk/test/demo/test_example.py b/tqsdk/test/demo/test_example.py index a09c584b..55ebc143 100644 --- a/tqsdk/test/demo/test_example.py +++ b/tqsdk/test/demo/test_example.py @@ -119,7 +119,7 @@ def dual_thrust(quote, klines): del t["exchange_trade_id"] trad_log = json.dumps(sim._trade_log) # print(trad_log) - excepted_trade_log = '{"2019-05-01": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10000000.0, "static_balance": 10000000.0, "balance": 10000000.0, "available": 10000000.0, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {}}, "2019-05-06": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4286.0, "volume": 3, "trade_date_time": 1557104520000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4341.0, "volume": 3, "trade_date_time": 1557105240000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4341.0, "volume": 3, "trade_date_time": 1557105240000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 10000000.0, "static_balance": 10000000.0, "balance": 9997904.892999997, "available": 9989332.692999998, "float_profit": -390.0, "position_profit": -390.0, "close_profit": -1650.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 55.107, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008573996343975827}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4341.0, "position_price_short": NaN, "position_cost_long": 130230.0, "position_cost_short": 0.0, "float_profit_long": -390.0, "float_profit_short": 0.0, "float_profit": -390.0, "position_profit_long": -390.0, "position_profit_short": 0.0, "position_profit": -390.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4328.0}}}, "2019-05-07": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997904.892999997, "static_balance": 9997904.892999997, "balance": 9998804.892999997, "available": 9990232.692999998, "float_profit": 510.0, "position_profit": 900.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008573224592072258}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4328.0, "position_price_short": 4328.0, "position_cost_long": 129840.0, "position_cost_short": 0.0, "float_profit_long": 510.0, "float_profit_short": 0.0, "float_profit": 510.0, "position_profit_long": 900.0, "position_profit_short": 0.0, "position_profit": 900.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4358.0}}}, "2019-05-08": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4332.0, "volume": 3, "trade_date_time": 1557285360000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4332.0, "volume": 3, "trade_date_time": 1557285360000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9998804.892999997, "static_balance": 9998804.892999997, "balance": 9997448.154999996, "available": 9988875.954999996, "float_profit": -540.0, "position_profit": -540.0, "close_profit": -780.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574388050927586}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4332.0, "open_cost_long": 0.0, "open_cost_short": 129960.0, "position_price_long": NaN, "position_price_short": 4332.0, "position_cost_long": 0.0, "position_cost_short": 129960.0, "float_profit_long": 0.0, "float_profit_short": -540.0, "float_profit": -540.0, "position_profit_long": 0.0, "position_profit_short": -540.0, "position_profit": -540.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4350.0}}}, "2019-05-09": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997448.154999996, "static_balance": 9997448.154999996, "balance": 9997328.154999996, "available": 9988755.954999996, "float_profit": -660.0, "position_profit": -120.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574490971082867}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4332.0, "open_cost_long": 0.0, "open_cost_short": 129960.0, "position_price_long": 4350.0, "position_price_short": 4350.0, "position_cost_long": 0.0, "position_cost_short": 129420.0, "float_profit_long": 0.0, "float_profit_short": -660.0, "float_profit": -660.0, "position_profit_long": 0.0, "position_profit_short": -120.0, "position_profit": -120.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4354.0}}}, "2019-05-10": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997328.154999996, "static_balance": 9997328.154999996, "balance": 9997838.154999996, "available": 9989265.954999996, "float_profit": -150.0, "position_profit": 510.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574053577485626}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4332.0, "open_cost_long": 0.0, "open_cost_short": 129960.0, "position_price_long": 4354.0, "position_price_short": 4354.0, "position_cost_long": 0.0, "position_cost_short": 129300.0, "float_profit_long": 0.0, "float_profit_short": -150.0, "float_profit": -150.0, "position_profit_long": 0.0, "position_profit_short": 510.0, "position_profit": 510.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4337.0}}}, "2019-05-13": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4349.0, "volume": 3, "trade_date_time": 1557709200000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4349.0, "volume": 3, "trade_date_time": 1557709200000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9997838.154999996, "static_balance": 9997838.154999996, "balance": 9997531.416999994, "available": 9988959.216999995, "float_profit": 90.0, "position_profit": 90.0, "close_profit": -360.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574316641229722}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4349.0, "open_price_short": NaN, "open_cost_long": 130470.0, "open_cost_short": 0.0, "position_price_long": 4349.0, "position_price_short": NaN, "position_cost_long": 130470.0, "position_cost_short": 0.0, "float_profit_long": 90.0, "float_profit_short": 0.0, "float_profit": 90.0, "position_profit_long": 90.0, "position_profit_short": 0.0, "position_profit": 90.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4352.0}}}, "2019-05-14": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4329.0, "volume": 3, "trade_date_time": 1557795900000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4329.0, "volume": 3, "trade_date_time": 1557795900000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4358.0, "volume": 3, "trade_date_time": 1557798180000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4358.0, "volume": 3, "trade_date_time": 1557798180000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9997531.416999994, "static_balance": 9997531.416999994, "balance": 9996047.94099999, "available": 9987475.740999991, "float_profit": 150.0, "position_profit": 150.0, "close_profit": -1560.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 73.476, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.000857558912341756}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4358.0, "open_price_short": NaN, "open_cost_long": 130740.0, "open_cost_short": 0.0, "position_price_long": 4358.0, "position_price_short": NaN, "position_cost_long": 130740.0, "position_cost_short": 0.0, "float_profit_long": 150.0, "float_profit_short": 0.0, "float_profit": 150.0, "position_profit_long": 150.0, "position_profit_short": 0.0, "position_profit": 150.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4363.0}}}, "2019-05-15": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4363.0, "volume": 3, "trade_date_time": 1557882180000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4363.0, "volume": 3, "trade_date_time": 1557882180000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9996047.94099999, "static_balance": 9996047.94099999, "balance": 9995681.202999989, "available": 9987109.00299999, "float_profit": -330.0, "position_profit": -330.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008575903758742565}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4363.0, "open_cost_long": 0.0, "open_cost_short": 130890.0, "position_price_long": NaN, "position_price_short": 4363.0, "position_cost_long": 0.0, "position_cost_short": 130890.0, "float_profit_long": 0.0, "float_profit_short": -330.0, "float_profit": -330.0, "position_profit_long": 0.0, "position_profit_short": -330.0, "position_profit": -330.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4374.0}}}, "2019-05-16": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4398.0, "volume": 3, "trade_date_time": 1557970260000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4398.0, "volume": 3, "trade_date_time": 1557970260000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9995681.202999989, "static_balance": 9995681.202999989, "balance": 9994984.464999987, "available": 9986412.264999988, "float_profit": 60.0, "position_profit": 60.0, "close_profit": -720.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008576501574382399}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4398.0, "open_price_short": NaN, "open_cost_long": 131940.0, "open_cost_short": 0.0, "position_price_long": 4398.0, "position_price_short": NaN, "position_cost_long": 131940.0, "position_cost_short": 0.0, "float_profit_long": 60.0, "float_profit_short": 0.0, "float_profit": 60.0, "position_profit_long": 60.0, "position_profit_short": 0.0, "position_profit": 60.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4400.0}}}, "2019-05-17": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4381.0, "volume": 3, "trade_date_time": 1558075020000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4381.0, "volume": 3, "trade_date_time": 1558075020000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9994984.464999987, "static_balance": 9994984.464999987, "balance": 9995307.726999985, "available": 9986735.526999986, "float_profit": 930.0, "position_profit": 930.0, "close_profit": -570.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008576224198524882}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4381.0, "open_cost_long": 0.0, "open_cost_short": 131430.0, "position_price_long": NaN, "position_price_short": 4381.0, "position_cost_long": 0.0, "position_cost_short": 131430.0, "float_profit_long": 0.0, "float_profit_short": 930.0, "float_profit": 930.0, "position_profit_long": 0.0, "position_profit_short": 930.0, "position_profit": 930.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4350.0}}}, "2019-05-20": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9995307.726999985, "static_balance": 9995307.726999985, "balance": 9996717.726999985, "available": 9988145.526999986, "float_profit": 2340.0, "position_profit": 1410.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008575014553874492}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4381.0, "open_cost_long": 0.0, "open_cost_short": 131430.0, "position_price_long": 4350.0, "position_price_short": 4350.0, "position_cost_long": 0.0, "position_cost_short": 132360.0, "float_profit_long": 0.0, "float_profit_short": 2340.0, "float_profit": 2340.0, "position_profit_long": 0.0, "position_profit_short": 1410.0, "position_profit": 1410.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4303.0}}}, "2019-05-21": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4342.0, "volume": 3, "trade_date_time": 1558419000000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4342.0, "volume": 3, "trade_date_time": 1558419000000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9996717.726999985, "static_balance": 9996717.726999985, "balance": 9995690.988999983, "available": 9987118.788999984, "float_profit": 180.0, "position_profit": 180.0, "close_profit": -1170.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008575895362745307}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4342.0, "open_price_short": NaN, "open_cost_long": 130260.0, "open_cost_short": 0.0, "position_price_long": 4342.0, "position_price_short": NaN, "position_cost_long": 130260.0, "position_cost_short": 0.0, "float_profit_long": 180.0, "float_profit_short": 0.0, "float_profit": 180.0, "position_profit_long": 180.0, "position_profit_short": 0.0, "position_profit": 180.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4348.0}}}, "2019-05-22": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4302.0, "volume": 3, "trade_date_time": 1558504380000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4302.0, "volume": 3, "trade_date_time": 1558504380000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9995690.988999983, "static_balance": 9995690.988999983, "balance": 9993734.250999982, "available": 9985162.050999982, "float_profit": -540.0, "position_profit": -540.0, "close_profit": -1380.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008577574492880136}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4302.0, "open_cost_long": 0.0, "open_cost_short": 129060.0, "position_price_long": NaN, "position_price_short": 4302.0, "position_cost_long": 0.0, "position_cost_short": 129060.0, "float_profit_long": 0.0, "float_profit_short": -540.0, "float_profit": -540.0, "position_profit_long": 0.0, "position_profit_short": -540.0, "position_profit": -540.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4320.0}}}, "2019-05-23": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9993734.250999982, "static_balance": 9993734.250999982, "balance": 9994004.250999982, "available": 9985432.050999982, "float_profit": -270.0, "position_profit": 270.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008577342759427265}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4302.0, "open_cost_long": 0.0, "open_cost_short": 129060.0, "position_price_long": 4320.0, "position_price_short": 4320.0, "position_cost_long": 0.0, "position_cost_short": 128520.0, "float_profit_long": 0.0, "float_profit_short": -270.0, "float_profit": -270.0, "position_profit_long": 0.0, "position_profit_short": 270.0, "position_profit": 270.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4311.0}}}, "2019-05-24": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4341.0, "volume": 3, "trade_date_time": 1558663260000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4341.0, "volume": 3, "trade_date_time": 1558663260000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9994004.250999982, "static_balance": 9994004.250999982, "balance": 9994507.51299998, "available": 9985935.31299998, "float_profit": 1440.0, "position_profit": 1440.0, "close_profit": -900.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008576910857138317}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4341.0, "position_price_short": NaN, "position_cost_long": 130230.0, "position_cost_short": 0.0, "float_profit_long": 1440.0, "float_profit_short": 0.0, "float_profit": 1440.0, "position_profit_long": 1440.0, "position_profit_short": 0.0, "position_profit": 1440.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4389.0}}}, "2019-05-27": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9994507.51299998, "static_balance": 9994507.51299998, "balance": 9993997.51299998, "available": 9985425.31299998, "float_profit": 930.0, "position_profit": -510.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008577348542311988}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4389.0, "position_price_short": 4389.0, "position_cost_long": 131670.0, "position_cost_short": 0.0, "float_profit_long": 930.0, "float_profit_short": 0.0, "float_profit": 930.0, "position_profit_long": -510.0, "position_profit_short": 0.0, "position_profit": -510.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4372.0}}}, "2019-05-28": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9993997.51299998, "static_balance": 9993997.51299998, "balance": 9994567.51299998, "available": 9985995.31299998, "float_profit": 1500.0, "position_profit": 570.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008576859367701605}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4372.0, "position_price_short": 4372.0, "position_cost_long": 131160.0, "position_cost_short": 0.0, "float_profit_long": 1500.0, "float_profit_short": 0.0, "float_profit": 1500.0, "position_profit_long": 570.0, "position_profit_short": 0.0, "position_profit": 570.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4391.0}}}, "2019-05-29": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9994567.51299998, "static_balance": 9994567.51299998, "balance": 9996577.51299998, "available": 9988005.31299998, "float_profit": 3510.0, "position_profit": 2010.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008575134828747482}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4391.0, "position_price_short": 4391.0, "position_cost_long": 131730.0, "position_cost_short": 0.0, "float_profit_long": 3510.0, "float_profit_short": 0.0, "float_profit": 3510.0, "position_profit_long": 2010.0, "position_profit_short": 0.0, "position_profit": 2010.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4458.0}}}, "2019-05-30": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9996577.51299998, "static_balance": 9996577.51299998, "balance": 9995887.51299998, "available": 9987315.31299998, "float_profit": 2820.0, "position_profit": -690.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008575726756480176}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4458.0, "position_price_short": 4458.0, "position_cost_long": 133740.0, "position_cost_short": 0.0, "float_profit_long": 2820.0, "float_profit_short": 0.0, "float_profit": 2820.0, "position_profit_long": -690.0, "position_profit_short": 0.0, "position_profit": -690.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4435.0}}}, "2019-05-31": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9995887.51299998, "static_balance": 9995887.51299998, "balance": 9997777.51299998, "available": 9989205.31299998, "float_profit": 4710.0, "position_profit": 1890.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574105583819684}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4435.0, "position_price_short": 4435.0, "position_cost_long": 133050.0, "position_cost_short": 0.0, "float_profit_long": 4710.0, "float_profit_short": 0.0, "float_profit": 4710.0, "position_profit_long": 1890.0, "position_profit_short": 0.0, "position_profit": 1890.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4498.0}}}, "2019-06-03": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997777.51299998, "static_balance": 9997777.51299998, "balance": 9998167.51299998, "available": 9989595.31299998, "float_profit": 5100.0, "position_profit": 390.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008573771132414131}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4498.0, "position_price_short": 4498.0, "position_cost_long": 134940.0, "position_cost_short": 0.0, "float_profit_long": 5100.0, "float_profit_short": 0.0, "float_profit": 5100.0, "position_profit_long": 390.0, "position_profit_short": 0.0, "position_profit": 390.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4511.0}}}, "2019-06-04": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4471.0, "volume": 3, "trade_date_time": 1559614080000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4471.0, "volume": 3, "trade_date_time": 1559614080000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9998167.51299998, "static_balance": 9998167.51299998, "balance": 9997170.774999978, "available": 9988598.574999979, "float_profit": 240.0, "position_profit": 240.0, "close_profit": -1200.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574625954611663}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4471.0, "open_cost_long": 0.0, "open_cost_short": 134130.0, "position_price_long": NaN, "position_price_short": 4471.0, "position_cost_long": 0.0, "position_cost_short": 134130.0, "float_profit_long": 0.0, "float_profit_short": 240.0, "float_profit": 240.0, "position_profit_long": 0.0, "position_profit_short": 240.0, "position_profit": 240.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4463.0}}}, "2019-06-05": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997170.774999978, "static_balance": 9997170.774999978, "balance": 9997230.774999978, "available": 9988658.574999979, "float_profit": 300.0, "position_profit": 60.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574574492604947}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4471.0, "open_cost_long": 0.0, "open_cost_short": 134130.0, "position_price_long": 4463.0, "position_price_short": 4463.0, "position_cost_long": 0.0, "position_cost_short": 134370.0, "float_profit_long": 0.0, "float_profit_short": 300.0, "float_profit": 300.0, "position_profit_long": 0.0, "position_profit_short": 60.0, "position_profit": 60.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4461.0}}}, "2019-06-06": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997230.774999978, "static_balance": 9997230.774999978, "balance": 9997890.774999978, "available": 9989318.574999979, "float_profit": 960.0, "position_profit": 660.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574008451297588}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4471.0, "open_cost_long": 0.0, "open_cost_short": 134130.0, "position_price_long": 4461.0, "position_price_short": 4461.0, "position_cost_long": 0.0, "position_cost_short": 134430.0, "float_profit_long": 0.0, "float_profit_short": 960.0, "float_profit": 960.0, "position_profit_long": 0.0, "position_profit_short": 660.0, "position_profit": 660.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4439.0}}}, "2019-06-10": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4490.0, "volume": 3, "trade_date_time": 1560128400000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4490.0, "volume": 3, "trade_date_time": 1560128400000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4417.0, "volume": 3, "trade_date_time": 1560132120000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4417.0, "volume": 3, "trade_date_time": 1560132120000000000, "commission": 18.369}]}}' + excepted_trade_log = '{"2019-05-01": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10000000.0, "static_balance": 10000000.0, "balance": 10000000.0, "available": 10000000.0, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {}}, "2019-05-06": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4286.0, "volume": 3, "trade_date_time": 1557104520000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4341.0, "volume": 3, "trade_date_time": 1557105240000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4341.0, "volume": 3, "trade_date_time": 1557105240000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 10000000.0, "static_balance": 10000000.0, "balance": 9997904.892999997, "available": 9989332.692999998, "float_profit": -390.0, "position_profit": -390.0, "close_profit": -1650.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 55.107, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008573996343975827}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4341.0, "position_price_short": NaN, "position_cost_long": 130230.0, "position_cost_short": 0.0, "float_profit_long": -390.0, "float_profit_short": 0.0, "float_profit": -390.0, "position_profit_long": -390.0, "position_profit_short": 0.0, "position_profit": -390.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4328.0}}}, "2019-05-07": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997904.892999997, "static_balance": 9997904.892999997, "balance": 9998804.892999997, "available": 9990232.692999998, "float_profit": 510.0, "position_profit": 900.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008573224592072258}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4328.0, "position_price_short": 4328.0, "position_cost_long": 129840.0, "position_cost_short": 0.0, "float_profit_long": 510.0, "float_profit_short": 0.0, "float_profit": 510.0, "position_profit_long": 900.0, "position_profit_short": 0.0, "position_profit": 900.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4358.0}}}, "2019-05-08": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4332.0, "volume": 3, "trade_date_time": 1557285360000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4332.0, "volume": 3, "trade_date_time": 1557285360000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9998804.892999997, "static_balance": 9998804.892999997, "balance": 9997448.154999996, "available": 9988875.954999996, "float_profit": -540.0, "position_profit": -540.0, "close_profit": -780.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574388050927586}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4332.0, "open_cost_long": 0.0, "open_cost_short": 129960.0, "position_price_long": NaN, "position_price_short": 4332.0, "position_cost_long": 0.0, "position_cost_short": 129960.0, "float_profit_long": 0.0, "float_profit_short": -540.0, "float_profit": -540.0, "position_profit_long": 0.0, "position_profit_short": -540.0, "position_profit": -540.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4350.0}}}, "2019-05-09": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997448.154999996, "static_balance": 9997448.154999996, "balance": 9997328.154999996, "available": 9988755.954999996, "float_profit": -660.0, "position_profit": -120.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574490971082867}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4332.0, "open_cost_long": 0.0, "open_cost_short": 129960.0, "position_price_long": 4350.0, "position_price_short": 4350.0, "position_cost_long": 0.0, "position_cost_short": 129420.0, "float_profit_long": 0.0, "float_profit_short": -660.0, "float_profit": -660.0, "position_profit_long": 0.0, "position_profit_short": -120.0, "position_profit": -120.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4354.0}}}, "2019-05-10": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997328.154999996, "static_balance": 9997328.154999996, "balance": 9997838.154999996, "available": 9989265.954999996, "float_profit": -150.0, "position_profit": 510.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574053577485626}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4332.0, "open_cost_long": 0.0, "open_cost_short": 129960.0, "position_price_long": 4354.0, "position_price_short": 4354.0, "position_cost_long": 0.0, "position_cost_short": 129300.0, "float_profit_long": 0.0, "float_profit_short": -150.0, "float_profit": -150.0, "position_profit_long": 0.0, "position_profit_short": 510.0, "position_profit": 510.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4337.0}}}, "2019-05-13": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4349.0, "volume": 3, "trade_date_time": 1557709200000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4349.0, "volume": 3, "trade_date_time": 1557709200000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9997838.154999996, "static_balance": 9997838.154999996, "balance": 9997531.416999994, "available": 9988959.216999995, "float_profit": 90.0, "position_profit": 90.0, "close_profit": -360.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574316641229722}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4349.0, "open_price_short": NaN, "open_cost_long": 130470.0, "open_cost_short": 0.0, "position_price_long": 4349.0, "position_price_short": NaN, "position_cost_long": 130470.0, "position_cost_short": 0.0, "float_profit_long": 90.0, "float_profit_short": 0.0, "float_profit": 90.0, "position_profit_long": 90.0, "position_profit_short": 0.0, "position_profit": 90.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4352.0}}}, "2019-05-14": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4329.0, "volume": 3, "trade_date_time": 1557795900000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4329.0, "volume": 3, "trade_date_time": 1557795900000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4358.0, "volume": 3, "trade_date_time": 1557798180000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4358.0, "volume": 3, "trade_date_time": 1557798180000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9997531.416999994, "static_balance": 9997531.416999994, "balance": 9996047.94099999, "available": 9987475.740999991, "float_profit": 150.0, "position_profit": 150.0, "close_profit": -1560.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 73.476, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.000857558912341756}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4358.0, "open_price_short": NaN, "open_cost_long": 130740.0, "open_cost_short": 0.0, "position_price_long": 4358.0, "position_price_short": NaN, "position_cost_long": 130740.0, "position_cost_short": 0.0, "float_profit_long": 150.0, "float_profit_short": 0.0, "float_profit": 150.0, "position_profit_long": 150.0, "position_profit_short": 0.0, "position_profit": 150.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4363.0}}}, "2019-05-15": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4363.0, "volume": 3, "trade_date_time": 1557882180000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4363.0, "volume": 3, "trade_date_time": 1557882180000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9996047.94099999, "static_balance": 9996047.94099999, "balance": 9995681.202999989, "available": 9987109.00299999, "float_profit": -330.0, "position_profit": -330.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008575903758742565}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4363.0, "open_cost_long": 0.0, "open_cost_short": 130890.0, "position_price_long": NaN, "position_price_short": 4363.0, "position_cost_long": 0.0, "position_cost_short": 130890.0, "float_profit_long": 0.0, "float_profit_short": -330.0, "float_profit": -330.0, "position_profit_long": 0.0, "position_profit_short": -330.0, "position_profit": -330.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4374.0}}}, "2019-05-16": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4398.0, "volume": 3, "trade_date_time": 1557970260000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4398.0, "volume": 3, "trade_date_time": 1557970260000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9995681.202999989, "static_balance": 9995681.202999989, "balance": 9994984.464999987, "available": 9986412.264999988, "float_profit": 60.0, "position_profit": 60.0, "close_profit": -720.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008576501574382399}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4398.0, "open_price_short": NaN, "open_cost_long": 131940.0, "open_cost_short": 0.0, "position_price_long": 4398.0, "position_price_short": NaN, "position_cost_long": 131940.0, "position_cost_short": 0.0, "float_profit_long": 60.0, "float_profit_short": 0.0, "float_profit": 60.0, "position_profit_long": 60.0, "position_profit_short": 0.0, "position_profit": 60.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4400.0}}}, "2019-05-17": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4381.0, "volume": 3, "trade_date_time": 1558075020000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4381.0, "volume": 3, "trade_date_time": 1558075020000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9994984.464999987, "static_balance": 9994984.464999987, "balance": 9995307.726999985, "available": 9986735.526999986, "float_profit": 930.0, "position_profit": 930.0, "close_profit": -570.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008576224198524882}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4381.0, "open_cost_long": 0.0, "open_cost_short": 131430.0, "position_price_long": NaN, "position_price_short": 4381.0, "position_cost_long": 0.0, "position_cost_short": 131430.0, "float_profit_long": 0.0, "float_profit_short": 930.0, "float_profit": 930.0, "position_profit_long": 0.0, "position_profit_short": 930.0, "position_profit": 930.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4350.0}}}, "2019-05-20": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9995307.726999985, "static_balance": 9995307.726999985, "balance": 9996717.726999985, "available": 9988145.526999986, "float_profit": 2340.0, "position_profit": 1410.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008575014553874492}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4381.0, "open_cost_long": 0.0, "open_cost_short": 131430.0, "position_price_long": 4350.0, "position_price_short": 4350.0, "position_cost_long": 0.0, "position_cost_short": 132360.0, "float_profit_long": 0.0, "float_profit_short": 2340.0, "float_profit": 2340.0, "position_profit_long": 0.0, "position_profit_short": 1410.0, "position_profit": 1410.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4303.0}}}, "2019-05-21": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4342.0, "volume": 3, "trade_date_time": 1558419000000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4342.0, "volume": 3, "trade_date_time": 1558419000000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9996717.726999985, "static_balance": 9996717.726999985, "balance": 9995690.988999983, "available": 9987118.788999984, "float_profit": 180.0, "position_profit": 180.0, "close_profit": -1170.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008575895362745307}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4342.0, "open_price_short": NaN, "open_cost_long": 130260.0, "open_cost_short": 0.0, "position_price_long": 4342.0, "position_price_short": NaN, "position_cost_long": 130260.0, "position_cost_short": 0.0, "float_profit_long": 180.0, "float_profit_short": 0.0, "float_profit": 180.0, "position_profit_long": 180.0, "position_profit_short": 0.0, "position_profit": 180.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4348.0}}}, "2019-05-22": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4302.0, "volume": 3, "trade_date_time": 1558504380000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4302.0, "volume": 3, "trade_date_time": 1558504380000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9995690.988999983, "static_balance": 9995690.988999983, "balance": 9993734.250999982, "available": 9985162.050999982, "float_profit": -540.0, "position_profit": -540.0, "close_profit": -1380.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008577574492880136}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4302.0, "open_cost_long": 0.0, "open_cost_short": 129060.0, "position_price_long": NaN, "position_price_short": 4302.0, "position_cost_long": 0.0, "position_cost_short": 129060.0, "float_profit_long": 0.0, "float_profit_short": -540.0, "float_profit": -540.0, "position_profit_long": 0.0, "position_profit_short": -540.0, "position_profit": -540.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4320.0}}}, "2019-05-23": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9993734.250999982, "static_balance": 9993734.250999982, "balance": 9994004.250999982, "available": 9985432.050999982, "float_profit": -270.0, "position_profit": 270.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008577342759427265}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4302.0, "open_cost_long": 0.0, "open_cost_short": 129060.0, "position_price_long": 4320.0, "position_price_short": 4320.0, "position_cost_long": 0.0, "position_cost_short": 128520.0, "float_profit_long": 0.0, "float_profit_short": -270.0, "float_profit": -270.0, "position_profit_long": 0.0, "position_profit_short": 270.0, "position_profit": 270.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4311.0}}}, "2019-05-24": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4341.0, "volume": 3, "trade_date_time": 1558663260000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4341.0, "volume": 3, "trade_date_time": 1558663260000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9994004.250999982, "static_balance": 9994004.250999982, "balance": 9994507.51299998, "available": 9985935.31299998, "float_profit": 1440.0, "position_profit": 1440.0, "close_profit": -900.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008576910857138317}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4341.0, "position_price_short": NaN, "position_cost_long": 130230.0, "position_cost_short": 0.0, "float_profit_long": 1440.0, "float_profit_short": 0.0, "float_profit": 1440.0, "position_profit_long": 1440.0, "position_profit_short": 0.0, "position_profit": 1440.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4389.0}}}, "2019-05-27": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9994507.51299998, "static_balance": 9994507.51299998, "balance": 9993997.51299998, "available": 9985425.31299998, "float_profit": 930.0, "position_profit": -510.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008577348542311988}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4389.0, "position_price_short": 4389.0, "position_cost_long": 131670.0, "position_cost_short": 0.0, "float_profit_long": 930.0, "float_profit_short": 0.0, "float_profit": 930.0, "position_profit_long": -510.0, "position_profit_short": 0.0, "position_profit": -510.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4372.0}}}, "2019-05-28": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9993997.51299998, "static_balance": 9993997.51299998, "balance": 9994567.51299998, "available": 9985995.31299998, "float_profit": 1500.0, "position_profit": 570.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008576859367701605}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4372.0, "position_price_short": 4372.0, "position_cost_long": 131160.0, "position_cost_short": 0.0, "float_profit_long": 1500.0, "float_profit_short": 0.0, "float_profit": 1500.0, "position_profit_long": 570.0, "position_profit_short": 0.0, "position_profit": 570.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4391.0}}}, "2019-05-29": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9994567.51299998, "static_balance": 9994567.51299998, "balance": 9996577.51299998, "available": 9988005.31299998, "float_profit": 3510.0, "position_profit": 2010.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008575134828747482}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4391.0, "position_price_short": 4391.0, "position_cost_long": 131730.0, "position_cost_short": 0.0, "float_profit_long": 3510.0, "float_profit_short": 0.0, "float_profit": 3510.0, "position_profit_long": 2010.0, "position_profit_short": 0.0, "position_profit": 2010.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4458.0}}}, "2019-05-30": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9996577.51299998, "static_balance": 9996577.51299998, "balance": 9995887.51299998, "available": 9987315.31299998, "float_profit": 2820.0, "position_profit": -690.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008575726756480176}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4458.0, "position_price_short": 4458.0, "position_cost_long": 133740.0, "position_cost_short": 0.0, "float_profit_long": 2820.0, "float_profit_short": 0.0, "float_profit": 2820.0, "position_profit_long": -690.0, "position_profit_short": 0.0, "position_profit": -690.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4435.0}}}, "2019-05-31": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9995887.51299998, "static_balance": 9995887.51299998, "balance": 9997777.51299998, "available": 9989205.31299998, "float_profit": 4710.0, "position_profit": 1890.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574105583819684}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4435.0, "position_price_short": 4435.0, "position_cost_long": 133050.0, "position_cost_short": 0.0, "float_profit_long": 4710.0, "float_profit_short": 0.0, "float_profit": 4710.0, "position_profit_long": 1890.0, "position_profit_short": 0.0, "position_profit": 1890.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4498.0}}}, "2019-06-03": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997777.51299998, "static_balance": 9997777.51299998, "balance": 9998167.51299998, "available": 9989595.31299998, "float_profit": 5100.0, "position_profit": 390.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008573771132414131}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 3, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 3, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 4341.0, "open_price_short": NaN, "open_cost_long": 130230.0, "open_cost_short": 0.0, "position_price_long": 4498.0, "position_price_short": 4498.0, "position_cost_long": 134940.0, "position_cost_short": 0.0, "float_profit_long": 5100.0, "float_profit_short": 0.0, "float_profit": 5100.0, "position_profit_long": 390.0, "position_profit_short": 0.0, "position_profit": 390.0, "margin_long": 8572.2, "margin_short": 0.0, "margin": 8572.2, "last_price": 4511.0}}}, "2019-06-04": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4471.0, "volume": 3, "trade_date_time": 1559614080000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4471.0, "volume": 3, "trade_date_time": 1559614080000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9998167.51299998, "static_balance": 9998167.51299998, "balance": 9997170.774999978, "available": 9988598.574999979, "float_profit": 240.0, "position_profit": 240.0, "close_profit": -1200.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 36.738, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574625954611663}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4471.0, "open_cost_long": 0.0, "open_cost_short": 134130.0, "position_price_long": NaN, "position_price_short": 4471.0, "position_cost_long": 0.0, "position_cost_short": 134130.0, "float_profit_long": 0.0, "float_profit_short": 240.0, "float_profit": 240.0, "position_profit_long": 0.0, "position_profit_short": 240.0, "position_profit": 240.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4463.0}}}, "2019-06-05": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997170.774999978, "static_balance": 9997170.774999978, "balance": 9997230.774999978, "available": 9988658.574999979, "float_profit": 300.0, "position_profit": 60.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574574492604947}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4471.0, "open_cost_long": 0.0, "open_cost_short": 134130.0, "position_price_long": 4463.0, "position_price_short": 4463.0, "position_cost_long": 0.0, "position_cost_short": 134370.0, "float_profit_long": 0.0, "float_profit_short": 300.0, "float_profit": 300.0, "position_profit_long": 0.0, "position_profit_short": 60.0, "position_profit": 60.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4461.0}}}, "2019-06-06": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9997230.774999978, "static_balance": 9997230.774999978, "balance": 9997890.774999978, "available": 9989318.574999979, "float_profit": 960.0, "position_profit": 660.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008574008451297588}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 3, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 3, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4471.0, "open_cost_long": 0.0, "open_cost_short": 134130.0, "position_price_long": 4461.0, "position_price_short": 4461.0, "position_cost_long": 0.0, "position_cost_short": 134430.0, "float_profit_long": 0.0, "float_profit_short": 960.0, "float_profit": 960.0, "position_profit_long": 0.0, "position_profit_short": 660.0, "position_profit": 660.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4439.0}}}, "2019-06-10": {"trades": [{"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "CLOSE", "price": 4490.0, "volume": 3, "trade_date_time": 1560128400000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "BUY", "offset": "OPEN", "price": 4490.0, "volume": 3, "trade_date_time": 1560128400000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "CLOSE", "price": 4417.0, "volume": 3, "trade_date_time": 1560132120000000000, "commission": 18.369}, {"symbol": "DCE.jd1909", "user_id": "TQSIM", "exchange_id": "DCE", "instrument_id": "jd1909", "direction": "SELL", "offset": "OPEN", "price": 4417.0, "volume": 3, "trade_date_time": 1560132120000000000, "commission": 18.369}], "account": {"currency": "CNY", "pre_balance": 9997890.774999978, "static_balance": 9997890.774999978, "balance": 9994157.298999975, "available": 9985585.098999975, "float_profit": 60.0, "position_profit": 60.0, "close_profit": -3720.0, "frozen_margin": 0.0, "margin": 8572.2, "frozen_commission": 0.0, "commission": 73.476, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0008577211408167194}, "positions": {"DCE.jd1909": {"symbol": "DCE.jd1909", "exchange_id": "DCE", "instrument_id": "jd1909", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 3, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 3, "volume_short_his": 0, "volume_short": 3, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": 4417.0, "open_cost_long": 0.0, "open_cost_short": 132510.0, "position_price_long": NaN, "position_price_short": 4417.0, "position_cost_long": 0.0, "position_cost_short": 132510.0, "float_profit_long": 0.0, "float_profit_short": 60.0, "float_profit": 60.0, "position_profit_long": 0.0, "position_profit_short": 60.0, "position_profit": 60.0, "margin_long": 0.0, "margin_short": 8572.2, "margin": 8572.2, "last_price": 4415.0}}}}' self.assertEqual(excepted_trade_log, trad_log) # @unittest.skip("无条件跳过: test_rbreaker") @@ -203,7 +203,7 @@ def get_index_line(klines): del t["exchange_trade_id"] trad_log = json.dumps(sim._trade_log) # print(trad_log) - excepted_trade_log = '{"2019-05-01": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10000000.0, "static_balance": 10000000.0, "balance": 10000000.0, "available": 10000000.0, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {}}, "2019-05-06": {"trades": [{"symbol": "SHFE.au1912", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "au1912", "direction": "BUY", "offset": "OPEN", "price": 287.15000000000003, "volume": 1, "trade_date_time": 1557104400000000000, "commission": 10.0}], "account": {"currency": "CNY", "pre_balance": 10000000.0, "static_balance": 10000000.0, "balance": 9999090.0, "available": 9984090.0, "float_profit": -900.0000000000341, "position_profit": -900.0000000000341, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 10.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0015001365124226304}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 0, "pos_long_today": 1, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 1, "volume_long_his": 0, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 287.15000000000003, "position_price_short": NaN, "position_cost_long": 287150.00000000006, "position_cost_short": 0.0, "float_profit_long": -900.0000000000341, "float_profit_short": 0.0, "float_profit": -900.0000000000341, "position_profit_long": -900.0000000000341, "position_profit_short": 0.0, "position_profit": -900.0000000000341, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 286.25}}}, "2019-05-07": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9999090.0, "static_balance": 9999090.0, "balance": 9998540.0, "available": 9983540.0, "float_profit": -1450.0000000000455, "position_profit": -550.0000000000114, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001500219031978669}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 286.25, "position_price_short": 286.25, "position_cost_long": 286250.0, "position_cost_short": 0.0, "float_profit_long": -1450.0000000000455, "float_profit_short": 0.0, "float_profit": -1450.0000000000455, "position_profit_long": -550.0000000000114, "position_profit_short": 0.0, "position_profit": -550.0000000000114, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 285.7}}}, "2019-05-08": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9998540.0, "static_balance": 9998540.0, "balance": 9999990.0, "available": 9984990.0, "float_profit": -5.6843418860808015e-11, "position_profit": 1449.9999999999886, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0015000015000015}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 285.7, "position_price_short": 285.7, "position_cost_long": 285700.0, "position_cost_short": 0.0, "float_profit_long": -5.6843418860808015e-11, "float_profit_short": 0.0, "float_profit": -5.6843418860808015e-11, "position_profit_long": 1449.9999999999886, "position_profit_short": 0.0, "position_profit": 1449.9999999999886, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 287.15}}}, "2019-05-09": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9999990.0, "static_balance": 9999990.0, "balance": 10000040.0, "available": 9985040.0, "float_profit": 49.999999999954525, "position_profit": 50.00000000001137, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014999940000239998}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 287.15, "position_price_short": 287.15, "position_cost_long": 287150.0, "position_cost_short": 0.0, "float_profit_long": 49.999999999954525, "float_profit_short": 0.0, "float_profit": 49.999999999954525, "position_profit_long": 50.00000000001137, "position_profit_short": 0.0, "position_profit": 50.00000000001137, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 287.2}}}, "2019-05-10": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10000040.0, "static_balance": 10000040.0, "balance": 10000090.0, "available": 9985090.0, "float_profit": 99.9999999999659, "position_profit": 50.00000000001137, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001499986500121499}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 287.2, "position_price_short": 287.2, "position_cost_long": 287200.0, "position_cost_short": 0.0, "float_profit_long": 99.9999999999659, "float_profit_short": 0.0, "float_profit": 99.9999999999659, "position_profit_long": 50.00000000001137, "position_profit_short": 0.0, "position_profit": 50.00000000001137, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 287.25}}}, "2019-05-13": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10000090.0, "static_balance": 10000090.0, "balance": 10002040.0, "available": 9987040.0, "float_profit": 2049.9999999999545, "position_profit": 1949.9999999999886, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014996940624112682}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 287.25, "position_price_short": 287.25, "position_cost_long": 287250.0, "position_cost_short": 0.0, "float_profit_long": 2049.9999999999545, "float_profit_short": 0.0, "float_profit": 2049.9999999999545, "position_profit_long": 1949.9999999999886, "position_profit_short": 0.0, "position_profit": 1949.9999999999886, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 289.2}}}, "2019-05-14": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10002040.0, "static_balance": 10002040.0, "balance": 10005590.0, "available": 9990590.0, "float_profit": 5599.999999999965, "position_profit": 3550.000000000008, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001499161968459631}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 289.2, "position_price_short": 289.2, "position_cost_long": 289200.0, "position_cost_short": 0.0, "float_profit_long": 5599.999999999965, "float_profit_short": 0.0, "float_profit": 5599.999999999965, "position_profit_long": 3550.000000000008, "position_profit_short": 0.0, "position_profit": 3550.000000000008, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 292.75}}}, "2019-05-15": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10005590.0, "static_balance": 10005590.0, "balance": 10004090.0, "available": 9989090.0, "float_profit": 4099.999999999967, "position_profit": -1500.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001499386750818915}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 292.75, "position_price_short": 292.75, "position_cost_long": 292750.0, "position_cost_short": 0.0, "float_profit_long": 4099.999999999967, "float_profit_short": 0.0, "float_profit": 4099.999999999967, "position_profit_long": -1500.0, "position_profit_short": 0.0, "position_profit": -1500.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.25}}}, "2019-05-16": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10004090.0, "static_balance": 10004090.0, "balance": 10005190.0, "available": 9990190.0, "float_profit": 5199.999999999989, "position_profit": 1100.0000000000227, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014992219038319112}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.25, "position_price_short": 291.25, "position_cost_long": 291250.0, "position_cost_short": 0.0, "float_profit_long": 5199.999999999989, "float_profit_short": 0.0, "float_profit": 5199.999999999989, "position_profit_long": 1100.0000000000227, "position_profit_short": 0.0, "position_profit": 1100.0000000000227, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 292.35}}}, "2019-05-17": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10005190.0, "static_balance": 10005190.0, "balance": 10004540.0, "available": 9989540.0, "float_profit": 4549.999999999955, "position_profit": -650.0000000000341, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014993193090336986}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 292.35, "position_price_short": 292.35, "position_cost_long": 292350.00000000006, "position_cost_short": 0.0, "float_profit_long": 4549.999999999955, "float_profit_short": 0.0, "float_profit": 4549.999999999955, "position_profit_long": -650.0000000000341, "position_profit_short": 0.0, "position_profit": -650.0000000000341, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.7}}}, "2019-05-20": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10004540.0, "static_balance": 10004540.0, "balance": 10002240.0, "available": 9987240.0, "float_profit": 2249.9999999999445, "position_profit": -2300.0000000000114, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014996640752471446}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.7, "position_price_short": 291.7, "position_cost_long": 291700.0, "position_cost_short": 0.0, "float_profit_long": 2249.9999999999445, "float_profit_short": 0.0, "float_profit": 2249.9999999999445, "position_profit_long": -2300.0000000000114, "position_profit_short": 0.0, "position_profit": -2300.0000000000114, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 289.4}}}, "2019-05-21": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10002240.0, "static_balance": 10002240.0, "balance": 10001990.0, "available": 9986990.0, "float_profit": 1999.9999999999445, "position_profit": -250.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014997015593896815}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 289.4, "position_price_short": 289.4, "position_cost_long": 289400.0, "position_cost_short": 0.0, "float_profit_long": 1999.9999999999445, "float_profit_short": 0.0, "float_profit": 1999.9999999999445, "position_profit_long": -250.0, "position_profit_short": 0.0, "position_profit": -250.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 289.15}}}, "2019-05-22": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10001990.0, "static_balance": 10001990.0, "balance": 10001740.0, "available": 9986740.0, "float_profit": 1749.9999999999445, "position_profit": -250.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014997390454060994}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 289.15, "position_price_short": 289.15, "position_cost_long": 289150.0, "position_cost_short": 0.0, "float_profit_long": 1749.9999999999445, "float_profit_short": 0.0, "float_profit": 1749.9999999999445, "position_profit_long": -250.0, "position_profit_short": 0.0, "position_profit": -250.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 288.9}}}, "2019-05-23": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10001740.0, "static_balance": 10001740.0, "balance": 10002190.0, "available": 9987190.0, "float_profit": 2199.99999999999, "position_profit": 450.0000000000455, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014996715719257482}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 288.9, "position_price_short": 288.9, "position_cost_long": 288900.0, "position_cost_short": 0.0, "float_profit_long": 2199.99999999999, "float_profit_short": 0.0, "float_profit": 2199.99999999999, "position_profit_long": 450.0000000000455, "position_profit_short": 0.0, "position_profit": 450.0000000000455, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 289.35}}}, "2019-05-24": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10002190.0, "static_balance": 10002190.0, "balance": 10003940.0, "available": 9988940.0, "float_profit": 3949.999999999988, "position_profit": 1750.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014994092327622916}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 289.35, "position_price_short": 289.35, "position_cost_long": 289350.00000000006, "position_cost_short": 0.0, "float_profit_long": 3949.999999999988, "float_profit_short": 0.0, "float_profit": 3949.999999999988, "position_profit_long": 1750.0, "position_profit_short": 0.0, "position_profit": 1750.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.1}}}, "2019-05-27": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10003940.0, "static_balance": 10003940.0, "balance": 10004090.0, "available": 9989090.0, "float_profit": 4099.999999999965, "position_profit": 149.99999999997726, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001499386750818915}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.1, "position_price_short": 291.1, "position_cost_long": 291100.00000000006, "position_cost_short": 0.0, "float_profit_long": 4099.999999999965, "float_profit_short": 0.0, "float_profit": 4099.999999999965, "position_profit_long": 149.99999999997726, "position_profit_short": 0.0, "position_profit": 149.99999999997726, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.25}}}, "2019-05-28": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10004090.0, "static_balance": 10004090.0, "balance": 10003840.0, "available": 9988840.0, "float_profit": 3849.9999999999654, "position_profit": -250.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014994242210990979}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.25, "position_price_short": 291.25, "position_cost_long": 291250.0, "position_cost_short": 0.0, "float_profit_long": 3849.9999999999654, "float_profit_short": 0.0, "float_profit": 3849.9999999999654, "position_profit_long": -250.0, "position_profit_short": 0.0, "position_profit": -250.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.0}}}, "2019-05-29": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10003840.0, "static_balance": 10003840.0, "balance": 10004290.0, "available": 9989290.0, "float_profit": 4299.999999999953, "position_profit": 449.99999999998863, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014993567759431204}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.0, "position_price_short": 291.0, "position_cost_long": 291000.0, "position_cost_short": 0.0, "float_profit_long": 4299.999999999953, "float_profit_short": 0.0, "float_profit": 4299.999999999953, "position_profit_long": 449.99999999998863, "position_profit_short": 0.0, "position_profit": 449.99999999998863, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.45}}}, "2019-05-30": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10004290.0, "static_balance": 10004290.0, "balance": 10002940.0, "available": 9987940.0, "float_profit": 2949.9999999999864, "position_profit": -1349.999999999966, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001499559129615893}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.45, "position_price_short": 291.45, "position_cost_long": 291450.0, "position_cost_short": 0.0, "float_profit_long": 2949.9999999999864, "float_profit_short": 0.0, "float_profit": 2949.9999999999864, "position_profit_long": -1349.999999999966, "position_profit_short": 0.0, "position_profit": -1349.999999999966, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 290.1}}}, "2019-05-31": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10002940.0, "static_balance": 10002940.0, "balance": 10006290.0, "available": 9991290.0, "float_profit": 6299.999999999949, "position_profit": 3349.999999999966, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014990570930884474}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 290.1, "position_price_short": 290.1, "position_cost_long": 290100.00000000006, "position_cost_short": 0.0, "float_profit_long": 6299.999999999949, "float_profit_short": 0.0, "float_profit": 6299.999999999949, "position_profit_long": 3349.999999999966, "position_profit_short": 0.0, "position_profit": 3349.999999999966, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 293.45}}}, "2019-06-03": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10006290.0, "static_balance": 10006290.0, "balance": 10009540.0, "available": 9994540.0, "float_profit": 9549.999999999942, "position_profit": 3250.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014985703638728653}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 293.45, "position_price_short": 293.45, "position_cost_long": 293450.0, "position_cost_short": 0.0, "float_profit_long": 9549.999999999942, "float_profit_short": 0.0, "float_profit": 9549.999999999942, "position_profit_long": 3250.0, "position_profit_short": 0.0, "position_profit": 3250.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 296.7}}}, "2019-06-04": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10009540.0, "static_balance": 10009540.0, "balance": 10012590.0, "available": 9997590.0, "float_profit": 12599.999999999949, "position_profit": 3050.0000000000114, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014981138746318384}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 296.7, "position_price_short": 296.7, "position_cost_long": 296700.0, "position_cost_short": 0.0, "float_profit_long": 12599.999999999949, "float_profit_short": 0.0, "float_profit": 12599.999999999949, "position_profit_long": 3050.0000000000114, "position_profit_short": 0.0, "position_profit": 3050.0000000000114, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 299.75}}}, "2019-06-05": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10012590.0, "static_balance": 10012590.0, "balance": 10014540.0, "available": 9999540.0, "float_profit": 14549.999999999935, "position_profit": 1949.9999999999886, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014978221665698074}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 299.75, "position_price_short": 299.75, "position_cost_long": 299750.0, "position_cost_short": 0.0, "float_profit_long": 14549.999999999935, "float_profit_short": 0.0, "float_profit": 14549.999999999935, "position_profit_long": 1949.9999999999886, "position_profit_short": 0.0, "position_profit": 1949.9999999999886, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 301.7}}}, "2019-06-06": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10014540.0, "static_balance": 10014540.0, "balance": 10014540.0, "available": 9999540.0, "float_profit": 14549.999999999933, "position_profit": 0.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014978221665698074}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 301.7, "position_price_short": 301.7, "position_cost_long": 301700.0, "position_cost_short": 0.0, "float_profit_long": 14549.999999999933, "float_profit_short": 0.0, "float_profit": 14549.999999999933, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 301.7}}}, "2019-06-10": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10014540.0, "static_balance": 10014540.0, "balance": 10013690.0, "available": 9998690.0, "float_profit": 13699.999999999956, "position_profit": -849.9999999999659, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001497949307398172}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 301.7, "position_price_short": 301.7, "position_cost_long": 301700.0, "position_cost_short": 0.0, "float_profit_long": 13699.999999999956, "float_profit_short": 0.0, "float_profit": 13699.999999999956, "position_profit_long": -849.9999999999659, "position_profit_short": 0.0, "position_profit": -849.9999999999659, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 300.85}}}, "2019-06-11": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10013690.0, "static_balance": 10013690.0, "balance": 10012390.0, "available": 9997390.0, "float_profit": 12399.999999999949, "position_profit": -1300.0000000000114, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001498143799832008}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 300.85, "position_price_short": 300.85, "position_cost_long": 300850.0, "position_cost_short": 0.0, "float_profit_long": 12399.999999999949, "float_profit_short": 0.0, "float_profit": 12399.999999999949, "position_profit_long": -1300.0000000000114, "position_profit_short": 0.0, "position_profit": -1300.0000000000114, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 299.55}}}, "2019-06-12": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10012390.0, "static_balance": 10012390.0, "balance": 10015440.0, "available": 10000440.0, "float_profit": 15449.99999999995, "position_profit": 3050.0000000000114, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014976875703913157}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 299.55, "position_price_short": 299.55, "position_cost_long": 299550.0, "position_cost_short": 0.0, "float_profit_long": 15449.99999999995, "float_profit_short": 0.0, "float_profit": 15449.99999999995, "position_profit_long": 3050.0000000000114, "position_profit_short": 0.0, "position_profit": 3050.0000000000114, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 302.6}}}, "2019-06-13": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10015440.0, "static_balance": 10015440.0, "balance": 10016040.0, "available": 10001040.0, "float_profit": 16049.999999999924, "position_profit": 599.9999999999659, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001497597853043718}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 302.6, "position_price_short": 302.6, "position_cost_long": 302600.0, "position_cost_short": 0.0, "float_profit_long": 16049.999999999924, "float_profit_short": 0.0, "float_profit": 16049.999999999924, "position_profit_long": 599.9999999999659, "position_profit_short": 0.0, "position_profit": 599.9999999999659, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 303.2}}}, "2019-06-14": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10016040.0, "static_balance": 10016040.0, "balance": 10020590.0, "available": 10005590.0, "float_profit": 20599.999999999935, "position_profit": 4550.000000000014, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014969178461547673}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 303.2, "position_price_short": 303.2, "position_cost_long": 303200.0, "position_cost_short": 0.0, "float_profit_long": 20599.999999999935, "float_profit_short": 0.0, "float_profit": 20599.999999999935, "position_profit_long": 4550.000000000014, "position_profit_short": 0.0, "position_profit": 4550.000000000014, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 307.75}}}, "2019-06-17": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10020590.0, "static_balance": 10020590.0, "balance": 10016940.0, "available": 10001940.0, "float_profit": 16949.999999999956, "position_profit": -3649.9999999999777, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014974632971745862}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 307.75, "position_price_short": 307.75, "position_cost_long": 307750.0, "position_cost_short": 0.0, "float_profit_long": 16949.999999999956, "float_profit_short": 0.0, "float_profit": 16949.999999999956, "position_profit_long": -3649.9999999999777, "position_profit_short": 0.0, "position_profit": -3649.9999999999777, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 304.1}}}, "2019-06-18": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10016940.0, "static_balance": 10016940.0, "balance": 10018990.0, "available": 10003990.0, "float_profit": 18999.999999999913, "position_profit": 2049.9999999999545, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014971568990487065}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 304.1, "position_price_short": 304.1, "position_cost_long": 304100.0, "position_cost_short": 0.0, "float_profit_long": 18999.999999999913, "float_profit_short": 0.0, "float_profit": 18999.999999999913, "position_profit_long": 2049.9999999999545, "position_profit_short": 0.0, "position_profit": 2049.9999999999545, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 306.15}}}, "2019-06-19": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10018990.0, "static_balance": 10018990.0, "balance": 10017140.0, "available": 10002140.0, "float_profit": 17149.999999999938, "position_profit": -1849.999999999966, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014974333991538502}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 306.15, "position_price_short": 306.15, "position_cost_long": 306150.0, "position_cost_short": 0.0, "float_profit_long": 17149.999999999938, "float_profit_short": 0.0, "float_profit": 17149.999999999938, "position_profit_long": -1849.999999999966, "position_profit_short": 0.0, "position_profit": -1849.999999999966, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 304.3}}}}' + excepted_trade_log = '{"2019-05-01": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10000000.0, "static_balance": 10000000.0, "balance": 10000000.0, "available": 10000000.0, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {}}, "2019-05-06": {"trades": [{"symbol": "SHFE.au1912", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "au1912", "direction": "BUY", "offset": "OPEN", "price": 287.15000000000003, "volume": 1, "trade_date_time": 1557104400000000000, "commission": 10.0}], "account": {"currency": "CNY", "pre_balance": 10000000.0, "static_balance": 10000000.0, "balance": 9999090.0, "available": 9984090.0, "float_profit": -900.0000000000341, "position_profit": -900.0000000000341, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 10.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0015001365124226304}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 0, "pos_long_today": 1, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 1, "volume_long_his": 0, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 287.15000000000003, "position_price_short": NaN, "position_cost_long": 287150.00000000006, "position_cost_short": 0.0, "float_profit_long": -900.0000000000341, "float_profit_short": 0.0, "float_profit": -900.0000000000341, "position_profit_long": -900.0000000000341, "position_profit_short": 0.0, "position_profit": -900.0000000000341, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 286.25}}}, "2019-05-07": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9999090.0, "static_balance": 9999090.0, "balance": 9998540.0, "available": 9983540.0, "float_profit": -1450.0000000000455, "position_profit": -550.0000000000114, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001500219031978669}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 286.25, "position_price_short": 286.25, "position_cost_long": 286250.0, "position_cost_short": 0.0, "float_profit_long": -1450.0000000000455, "float_profit_short": 0.0, "float_profit": -1450.0000000000455, "position_profit_long": -550.0000000000114, "position_profit_short": 0.0, "position_profit": -550.0000000000114, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 285.7}}}, "2019-05-08": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9998540.0, "static_balance": 9998540.0, "balance": 9999990.0, "available": 9984990.0, "float_profit": -5.6843418860808015e-11, "position_profit": 1449.9999999999886, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0015000015000015}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 285.7, "position_price_short": 285.7, "position_cost_long": 285700.0, "position_cost_short": 0.0, "float_profit_long": -5.6843418860808015e-11, "float_profit_short": 0.0, "float_profit": -5.6843418860808015e-11, "position_profit_long": 1449.9999999999886, "position_profit_short": 0.0, "position_profit": 1449.9999999999886, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 287.15}}}, "2019-05-09": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9999990.0, "static_balance": 9999990.0, "balance": 10000040.0, "available": 9985040.0, "float_profit": 49.999999999954525, "position_profit": 50.00000000001137, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014999940000239998}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 287.15, "position_price_short": 287.15, "position_cost_long": 287150.0, "position_cost_short": 0.0, "float_profit_long": 49.999999999954525, "float_profit_short": 0.0, "float_profit": 49.999999999954525, "position_profit_long": 50.00000000001137, "position_profit_short": 0.0, "position_profit": 50.00000000001137, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 287.2}}}, "2019-05-10": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10000040.0, "static_balance": 10000040.0, "balance": 10000090.0, "available": 9985090.0, "float_profit": 99.9999999999659, "position_profit": 50.00000000001137, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001499986500121499}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 287.2, "position_price_short": 287.2, "position_cost_long": 287200.0, "position_cost_short": 0.0, "float_profit_long": 99.9999999999659, "float_profit_short": 0.0, "float_profit": 99.9999999999659, "position_profit_long": 50.00000000001137, "position_profit_short": 0.0, "position_profit": 50.00000000001137, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 287.25}}}, "2019-05-13": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10000090.0, "static_balance": 10000090.0, "balance": 10002040.0, "available": 9987040.0, "float_profit": 2049.9999999999545, "position_profit": 1949.9999999999886, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014996940624112682}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 287.25, "position_price_short": 287.25, "position_cost_long": 287250.0, "position_cost_short": 0.0, "float_profit_long": 2049.9999999999545, "float_profit_short": 0.0, "float_profit": 2049.9999999999545, "position_profit_long": 1949.9999999999886, "position_profit_short": 0.0, "position_profit": 1949.9999999999886, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 289.2}}}, "2019-05-14": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10002040.0, "static_balance": 10002040.0, "balance": 10005590.0, "available": 9990590.0, "float_profit": 5599.999999999965, "position_profit": 3550.000000000008, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001499161968459631}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 289.2, "position_price_short": 289.2, "position_cost_long": 289200.0, "position_cost_short": 0.0, "float_profit_long": 5599.999999999965, "float_profit_short": 0.0, "float_profit": 5599.999999999965, "position_profit_long": 3550.000000000008, "position_profit_short": 0.0, "position_profit": 3550.000000000008, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 292.75}}}, "2019-05-15": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10005590.0, "static_balance": 10005590.0, "balance": 10004090.0, "available": 9989090.0, "float_profit": 4099.999999999967, "position_profit": -1500.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001499386750818915}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 292.75, "position_price_short": 292.75, "position_cost_long": 292750.0, "position_cost_short": 0.0, "float_profit_long": 4099.999999999967, "float_profit_short": 0.0, "float_profit": 4099.999999999967, "position_profit_long": -1500.0, "position_profit_short": 0.0, "position_profit": -1500.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.25}}}, "2019-05-16": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10004090.0, "static_balance": 10004090.0, "balance": 10005190.0, "available": 9990190.0, "float_profit": 5199.999999999989, "position_profit": 1100.0000000000227, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014992219038319112}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.25, "position_price_short": 291.25, "position_cost_long": 291250.0, "position_cost_short": 0.0, "float_profit_long": 5199.999999999989, "float_profit_short": 0.0, "float_profit": 5199.999999999989, "position_profit_long": 1100.0000000000227, "position_profit_short": 0.0, "position_profit": 1100.0000000000227, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 292.35}}}, "2019-05-17": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10005190.0, "static_balance": 10005190.0, "balance": 10004540.0, "available": 9989540.0, "float_profit": 4549.999999999955, "position_profit": -650.0000000000341, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014993193090336986}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 292.35, "position_price_short": 292.35, "position_cost_long": 292350.00000000006, "position_cost_short": 0.0, "float_profit_long": 4549.999999999955, "float_profit_short": 0.0, "float_profit": 4549.999999999955, "position_profit_long": -650.0000000000341, "position_profit_short": 0.0, "position_profit": -650.0000000000341, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.7}}}, "2019-05-20": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10004540.0, "static_balance": 10004540.0, "balance": 10002240.0, "available": 9987240.0, "float_profit": 2249.9999999999445, "position_profit": -2300.0000000000114, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014996640752471446}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.7, "position_price_short": 291.7, "position_cost_long": 291700.0, "position_cost_short": 0.0, "float_profit_long": 2249.9999999999445, "float_profit_short": 0.0, "float_profit": 2249.9999999999445, "position_profit_long": -2300.0000000000114, "position_profit_short": 0.0, "position_profit": -2300.0000000000114, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 289.4}}}, "2019-05-21": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10002240.0, "static_balance": 10002240.0, "balance": 10001990.0, "available": 9986990.0, "float_profit": 1999.9999999999445, "position_profit": -250.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014997015593896815}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 289.4, "position_price_short": 289.4, "position_cost_long": 289400.0, "position_cost_short": 0.0, "float_profit_long": 1999.9999999999445, "float_profit_short": 0.0, "float_profit": 1999.9999999999445, "position_profit_long": -250.0, "position_profit_short": 0.0, "position_profit": -250.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 289.15}}}, "2019-05-22": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10001990.0, "static_balance": 10001990.0, "balance": 10001740.0, "available": 9986740.0, "float_profit": 1749.9999999999445, "position_profit": -250.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014997390454060994}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 289.15, "position_price_short": 289.15, "position_cost_long": 289150.0, "position_cost_short": 0.0, "float_profit_long": 1749.9999999999445, "float_profit_short": 0.0, "float_profit": 1749.9999999999445, "position_profit_long": -250.0, "position_profit_short": 0.0, "position_profit": -250.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 288.9}}}, "2019-05-23": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10001740.0, "static_balance": 10001740.0, "balance": 10002190.0, "available": 9987190.0, "float_profit": 2199.99999999999, "position_profit": 450.0000000000455, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014996715719257482}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 288.9, "position_price_short": 288.9, "position_cost_long": 288900.0, "position_cost_short": 0.0, "float_profit_long": 2199.99999999999, "float_profit_short": 0.0, "float_profit": 2199.99999999999, "position_profit_long": 450.0000000000455, "position_profit_short": 0.0, "position_profit": 450.0000000000455, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 289.35}}}, "2019-05-24": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10002190.0, "static_balance": 10002190.0, "balance": 10003940.0, "available": 9988940.0, "float_profit": 3949.999999999988, "position_profit": 1750.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014994092327622916}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 289.35, "position_price_short": 289.35, "position_cost_long": 289350.00000000006, "position_cost_short": 0.0, "float_profit_long": 3949.999999999988, "float_profit_short": 0.0, "float_profit": 3949.999999999988, "position_profit_long": 1750.0, "position_profit_short": 0.0, "position_profit": 1750.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.1}}}, "2019-05-27": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10003940.0, "static_balance": 10003940.0, "balance": 10004090.0, "available": 9989090.0, "float_profit": 4099.999999999965, "position_profit": 149.99999999997726, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001499386750818915}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.1, "position_price_short": 291.1, "position_cost_long": 291100.00000000006, "position_cost_short": 0.0, "float_profit_long": 4099.999999999965, "float_profit_short": 0.0, "float_profit": 4099.999999999965, "position_profit_long": 149.99999999997726, "position_profit_short": 0.0, "position_profit": 149.99999999997726, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.25}}}, "2019-05-28": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10004090.0, "static_balance": 10004090.0, "balance": 10003840.0, "available": 9988840.0, "float_profit": 3849.9999999999654, "position_profit": -250.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014994242210990979}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.25, "position_price_short": 291.25, "position_cost_long": 291250.0, "position_cost_short": 0.0, "float_profit_long": 3849.9999999999654, "float_profit_short": 0.0, "float_profit": 3849.9999999999654, "position_profit_long": -250.0, "position_profit_short": 0.0, "position_profit": -250.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.0}}}, "2019-05-29": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10003840.0, "static_balance": 10003840.0, "balance": 10004290.0, "available": 9989290.0, "float_profit": 4299.999999999953, "position_profit": 449.99999999998863, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014993567759431204}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.0, "position_price_short": 291.0, "position_cost_long": 291000.0, "position_cost_short": 0.0, "float_profit_long": 4299.999999999953, "float_profit_short": 0.0, "float_profit": 4299.999999999953, "position_profit_long": 449.99999999998863, "position_profit_short": 0.0, "position_profit": 449.99999999998863, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 291.45}}}, "2019-05-30": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10004290.0, "static_balance": 10004290.0, "balance": 10002940.0, "available": 9987940.0, "float_profit": 2949.9999999999864, "position_profit": -1349.999999999966, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001499559129615893}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 291.45, "position_price_short": 291.45, "position_cost_long": 291450.0, "position_cost_short": 0.0, "float_profit_long": 2949.9999999999864, "float_profit_short": 0.0, "float_profit": 2949.9999999999864, "position_profit_long": -1349.999999999966, "position_profit_short": 0.0, "position_profit": -1349.999999999966, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 290.1}}}, "2019-05-31": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10002940.0, "static_balance": 10002940.0, "balance": 10006290.0, "available": 9991290.0, "float_profit": 6299.999999999949, "position_profit": 3349.999999999966, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014990570930884474}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 290.1, "position_price_short": 290.1, "position_cost_long": 290100.00000000006, "position_cost_short": 0.0, "float_profit_long": 6299.999999999949, "float_profit_short": 0.0, "float_profit": 6299.999999999949, "position_profit_long": 3349.999999999966, "position_profit_short": 0.0, "position_profit": 3349.999999999966, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 293.45}}}, "2019-06-03": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10006290.0, "static_balance": 10006290.0, "balance": 10009540.0, "available": 9994540.0, "float_profit": 9549.999999999942, "position_profit": 3250.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014985703638728653}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 293.45, "position_price_short": 293.45, "position_cost_long": 293450.0, "position_cost_short": 0.0, "float_profit_long": 9549.999999999942, "float_profit_short": 0.0, "float_profit": 9549.999999999942, "position_profit_long": 3250.0, "position_profit_short": 0.0, "position_profit": 3250.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 296.7}}}, "2019-06-04": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10009540.0, "static_balance": 10009540.0, "balance": 10012590.0, "available": 9997590.0, "float_profit": 12599.999999999949, "position_profit": 3050.0000000000114, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014981138746318384}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 296.7, "position_price_short": 296.7, "position_cost_long": 296700.0, "position_cost_short": 0.0, "float_profit_long": 12599.999999999949, "float_profit_short": 0.0, "float_profit": 12599.999999999949, "position_profit_long": 3050.0000000000114, "position_profit_short": 0.0, "position_profit": 3050.0000000000114, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 299.75}}}, "2019-06-05": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10012590.0, "static_balance": 10012590.0, "balance": 10014540.0, "available": 9999540.0, "float_profit": 14549.999999999935, "position_profit": 1949.9999999999886, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014978221665698074}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 299.75, "position_price_short": 299.75, "position_cost_long": 299750.0, "position_cost_short": 0.0, "float_profit_long": 14549.999999999935, "float_profit_short": 0.0, "float_profit": 14549.999999999935, "position_profit_long": 1949.9999999999886, "position_profit_short": 0.0, "position_profit": 1949.9999999999886, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 301.7}}}, "2019-06-06": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10014540.0, "static_balance": 10014540.0, "balance": 10014540.0, "available": 9999540.0, "float_profit": 14549.999999999933, "position_profit": 0.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014978221665698074}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 301.7, "position_price_short": 301.7, "position_cost_long": 301700.0, "position_cost_short": 0.0, "float_profit_long": 14549.999999999933, "float_profit_short": 0.0, "float_profit": 14549.999999999933, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 301.7}}}, "2019-06-10": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10014540.0, "static_balance": 10014540.0, "balance": 10013690.0, "available": 9998690.0, "float_profit": 13699.999999999956, "position_profit": -849.9999999999659, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001497949307398172}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 301.7, "position_price_short": 301.7, "position_cost_long": 301700.0, "position_cost_short": 0.0, "float_profit_long": 13699.999999999956, "float_profit_short": 0.0, "float_profit": 13699.999999999956, "position_profit_long": -849.9999999999659, "position_profit_short": 0.0, "position_profit": -849.9999999999659, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 300.85}}}, "2019-06-11": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10013690.0, "static_balance": 10013690.0, "balance": 10012390.0, "available": 9997390.0, "float_profit": 12399.999999999949, "position_profit": -1300.0000000000114, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001498143799832008}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 300.85, "position_price_short": 300.85, "position_cost_long": 300850.0, "position_cost_short": 0.0, "float_profit_long": 12399.999999999949, "float_profit_short": 0.0, "float_profit": 12399.999999999949, "position_profit_long": -1300.0000000000114, "position_profit_short": 0.0, "position_profit": -1300.0000000000114, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 299.55}}}, "2019-06-12": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10012390.0, "static_balance": 10012390.0, "balance": 10015440.0, "available": 10000440.0, "float_profit": 15449.99999999995, "position_profit": 3050.0000000000114, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014976875703913157}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 299.55, "position_price_short": 299.55, "position_cost_long": 299550.0, "position_cost_short": 0.0, "float_profit_long": 15449.99999999995, "float_profit_short": 0.0, "float_profit": 15449.99999999995, "position_profit_long": 3050.0000000000114, "position_profit_short": 0.0, "position_profit": 3050.0000000000114, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 302.6}}}, "2019-06-13": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10015440.0, "static_balance": 10015440.0, "balance": 10016040.0, "available": 10001040.0, "float_profit": 16049.999999999924, "position_profit": 599.9999999999659, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.001497597853043718}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 302.6, "position_price_short": 302.6, "position_cost_long": 302600.0, "position_cost_short": 0.0, "float_profit_long": 16049.999999999924, "float_profit_short": 0.0, "float_profit": 16049.999999999924, "position_profit_long": 599.9999999999659, "position_profit_short": 0.0, "position_profit": 599.9999999999659, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 303.2}}}, "2019-06-14": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10016040.0, "static_balance": 10016040.0, "balance": 10020590.0, "available": 10005590.0, "float_profit": 20599.999999999935, "position_profit": 4550.000000000014, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014969178461547673}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 303.2, "position_price_short": 303.2, "position_cost_long": 303200.0, "position_cost_short": 0.0, "float_profit_long": 20599.999999999935, "float_profit_short": 0.0, "float_profit": 20599.999999999935, "position_profit_long": 4550.000000000014, "position_profit_short": 0.0, "position_profit": 4550.000000000014, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 307.75}}}, "2019-06-17": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10020590.0, "static_balance": 10020590.0, "balance": 10016940.0, "available": 10001940.0, "float_profit": 16949.999999999956, "position_profit": -3649.9999999999777, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014974632971745862}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 307.75, "position_price_short": 307.75, "position_cost_long": 307750.0, "position_cost_short": 0.0, "float_profit_long": 16949.999999999956, "float_profit_short": 0.0, "float_profit": 16949.999999999956, "position_profit_long": -3649.9999999999777, "position_profit_short": 0.0, "position_profit": -3649.9999999999777, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 304.1}}}, "2019-06-18": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10016940.0, "static_balance": 10016940.0, "balance": 10018990.0, "available": 10003990.0, "float_profit": 18999.999999999913, "position_profit": 2049.9999999999545, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014971568990487065}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 304.1, "position_price_short": 304.1, "position_cost_long": 304100.0, "position_cost_short": 0.0, "float_profit_long": 18999.999999999913, "float_profit_short": 0.0, "float_profit": 18999.999999999913, "position_profit_long": 2049.9999999999545, "position_profit_short": 0.0, "position_profit": 2049.9999999999545, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 306.15}}}, "2019-06-19": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10018990.0, "static_balance": 10018990.0, "balance": 10017140.0, "available": 10002140.0, "float_profit": 17149.999999999938, "position_profit": -1849.999999999966, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014974333991538502}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 306.15, "position_price_short": 306.15, "position_cost_long": 306150.0, "position_cost_short": 0.0, "float_profit_long": 17149.999999999938, "float_profit_short": 0.0, "float_profit": 17149.999999999938, "position_profit_long": -1849.999999999966, "position_profit_short": 0.0, "position_profit": -1849.999999999966, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 304.3}}}, "2019-06-20": {"trades": [], "account": {"currency": "CNY", "pre_balance": 10017140.0, "static_balance": 10017140.0, "balance": 10024090.0, "available": 10009090.0, "float_profit": 24099.999999999927, "position_profit": 6949.999999999992, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 15000.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0014963951840017398}, "positions": {"SHFE.au1912": {"symbol": "SHFE.au1912", "exchange_id": "SHFE", "instrument_id": "au1912", "pos_long_his": 1, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 1, "volume_long": 1, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 287.15000000000003, "open_price_short": NaN, "open_cost_long": 287150.00000000006, "open_cost_short": 0.0, "position_price_long": 304.3, "position_price_short": 304.3, "position_cost_long": 304300.0, "position_cost_short": 0.0, "float_profit_long": 24099.999999999927, "float_profit_short": 0.0, "float_profit": 24099.999999999927, "position_profit_long": 6949.999999999992, "position_profit_short": 0.0, "position_profit": 6949.999999999992, "margin_long": 15000.0, "margin_short": 0.0, "margin": 15000.0, "last_price": 311.25}}}}' self.assertEqual(excepted_trade_log, trad_log) # @unittest.skip("无条件跳过: test_fairy_four_price") @@ -263,5 +263,5 @@ def test_fairy_four_price(self): del t["exchange_trade_id"] trad_log = json.dumps(sim._trade_log) # print(trad_log) - excepted_trade_log = '{"2019-04-01": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49350.0, "volume": 3, "trade_date_time": 1554080400000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49420.0, "volume": 3, "trade_date_time": 1554101400000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 10000000.0, "static_balance": 10000000.0, "balance": 10000980.489999998, "available": 10000980.489999998, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 1050.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49460.0}}}, "2019-04-02": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49080.0, "volume": 3, "trade_date_time": 1554136080000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49260.0, "volume": 3, "trade_date_time": 1554187800000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 10000980.489999998, "static_balance": 10000980.489999998, "balance": 9998210.979999997, "available": 9998210.979999997, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -2700.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49460.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49270.0}}}, "2019-04-03": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49000.0, "volume": 3, "trade_date_time": 1554217440000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49480.0, "volume": 3, "trade_date_time": 1554273000000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49480.0, "volume": 3, "trade_date_time": 1554273000000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49450.0, "volume": 3, "trade_date_time": 1554274200000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9998210.979999997, "static_balance": 9998210.979999997, "balance": 9990421.959999993, "available": 9990421.959999993, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -7650.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 139.02, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49510.0}}}, "2019-04-04": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49570.0, "volume": 3, "trade_date_time": 1554303900000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49480.0, "volume": 3, "trade_date_time": 1554360600000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9990421.959999993, "static_balance": 9990421.959999993, "balance": 9989002.449999992, "available": 9989002.449999992, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -1350.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": 49510.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49520.0}}}, "2019-04-08": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49130.0, "volume": 3, "trade_date_time": 1554685200000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49290.0, "volume": 3, "trade_date_time": 1554706200000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9989002.449999992, "static_balance": 9989002.449999992, "balance": 9986532.93999999, "available": 9986532.93999999, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -2400.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49520.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49260.0}}}, "2019-04-09": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49400.0, "volume": 3, "trade_date_time": 1554729240000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49720.0, "volume": 3, "trade_date_time": 1554792600000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9986532.93999999, "static_balance": 9986532.93999999, "balance": 9991263.429999989, "available": 9991263.429999989, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 4800.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": 49260.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49790.0}}}, "2019-04-10": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9991263.429999989, "static_balance": 9991263.429999989, "balance": 9991263.429999989, "available": 9991263.429999989, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49790.0, "position_price_short": 49790.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49490.0}}}, "2019-04-11": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49300.0, "volume": 3, "trade_date_time": 1554901200000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49220.0, "volume": 3, "trade_date_time": 1554965400000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9991263.429999989, "static_balance": 9991263.429999989, "balance": 9992393.919999987, "available": 9992393.919999987, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 1200.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49490.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49170.0}}}, "2019-04-12": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49110.0, "volume": 3, "trade_date_time": 1554992400000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49210.0, "volume": 3, "trade_date_time": 1555051800000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9992393.919999987, "static_balance": 9992393.919999987, "balance": 9990824.409999985, "available": 9990824.409999985, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -1500.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49170.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49200.0}}}, "2019-04-15": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49580.0, "volume": 3, "trade_date_time": 1555074000000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49370.0, "volume": 3, "trade_date_time": 1555311000000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9990824.409999985, "static_balance": 9990824.409999985, "balance": 9987604.899999984, "available": 9987604.899999984, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -3150.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": 49200.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49320.0}}}, "2019-04-16": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49300.0, "volume": 3, "trade_date_time": 1555333860000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49480.0, "volume": 3, "trade_date_time": 1555397400000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9987604.899999984, "static_balance": 9987604.899999984, "balance": 9984835.389999982, "available": 9984835.389999982, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -2700.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49320.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49450.0}}}, "2019-04-17": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49610.0, "volume": 3, "trade_date_time": 1555482840000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49530.0, "volume": 3, "trade_date_time": 1555483800000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9984835.389999982, "static_balance": 9984835.389999982, "balance": 9983565.87999998, "available": 9983565.87999998, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -1200.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": 49450.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49470.0}}}, "2019-04-18": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49780.0, "volume": 3, "trade_date_time": 1555506000000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49460.0, "volume": 3, "trade_date_time": 1555570200000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9983565.87999998, "static_balance": 9983565.87999998, "balance": 9978696.369999979, "available": 9978696.369999979, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -4800.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": 49470.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49460.0}}}, "2019-04-19": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49280.0, "volume": 3, "trade_date_time": 1555592400000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49490.0, "volume": 3, "trade_date_time": 1555656600000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9978696.369999979, "static_balance": 9978696.369999979, "balance": 9975476.859999977, "available": 9975476.859999977, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -3150.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49460.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49500.0}}}, "2019-04-22": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49540.0, "volume": 3, "trade_date_time": 1555679520000000000, "commission": 34.755}]}}' + excepted_trade_log = '{"2019-04-01": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49350.0, "volume": 3, "trade_date_time": 1554080400000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49420.0, "volume": 3, "trade_date_time": 1554101400000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 10000000.0, "static_balance": 10000000.0, "balance": 10000980.489999998, "available": 10000980.489999998, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 1050.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49460.0}}}, "2019-04-02": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49080.0, "volume": 3, "trade_date_time": 1554136080000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49260.0, "volume": 3, "trade_date_time": 1554187800000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 10000980.489999998, "static_balance": 10000980.489999998, "balance": 9998210.979999997, "available": 9998210.979999997, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -2700.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49460.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49270.0}}}, "2019-04-03": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49000.0, "volume": 3, "trade_date_time": 1554217440000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49480.0, "volume": 3, "trade_date_time": 1554273000000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49480.0, "volume": 3, "trade_date_time": 1554273000000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49450.0, "volume": 3, "trade_date_time": 1554274200000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9998210.979999997, "static_balance": 9998210.979999997, "balance": 9990421.959999993, "available": 9990421.959999993, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -7650.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 139.02, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49510.0}}}, "2019-04-04": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49570.0, "volume": 3, "trade_date_time": 1554303900000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49480.0, "volume": 3, "trade_date_time": 1554360600000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9990421.959999993, "static_balance": 9990421.959999993, "balance": 9989002.449999992, "available": 9989002.449999992, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -1350.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": 49510.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49520.0}}}, "2019-04-08": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49130.0, "volume": 3, "trade_date_time": 1554685200000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49290.0, "volume": 3, "trade_date_time": 1554706200000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9989002.449999992, "static_balance": 9989002.449999992, "balance": 9986532.93999999, "available": 9986532.93999999, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -2400.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49520.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49260.0}}}, "2019-04-09": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49400.0, "volume": 3, "trade_date_time": 1554729240000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49720.0, "volume": 3, "trade_date_time": 1554792600000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9986532.93999999, "static_balance": 9986532.93999999, "balance": 9991263.429999989, "available": 9991263.429999989, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 4800.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": 49260.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49790.0}}}, "2019-04-10": {"trades": [], "account": {"currency": "CNY", "pre_balance": 9991263.429999989, "static_balance": 9991263.429999989, "balance": 9991263.429999989, "available": 9991263.429999989, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 0.0, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49790.0, "position_price_short": 49790.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49490.0}}}, "2019-04-11": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49300.0, "volume": 3, "trade_date_time": 1554901200000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49220.0, "volume": 3, "trade_date_time": 1554965400000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9991263.429999989, "static_balance": 9991263.429999989, "balance": 9992393.919999987, "available": 9992393.919999987, "float_profit": 0.0, "position_profit": 0.0, "close_profit": 1200.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49490.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49170.0}}}, "2019-04-12": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49110.0, "volume": 3, "trade_date_time": 1554992400000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49210.0, "volume": 3, "trade_date_time": 1555051800000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9992393.919999987, "static_balance": 9992393.919999987, "balance": 9990824.409999985, "available": 9990824.409999985, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -1500.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49170.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49200.0}}}, "2019-04-15": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49580.0, "volume": 3, "trade_date_time": 1555074000000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49370.0, "volume": 3, "trade_date_time": 1555311000000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9990824.409999985, "static_balance": 9990824.409999985, "balance": 9987604.899999984, "available": 9987604.899999984, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -3150.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": 49200.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49320.0}}}, "2019-04-16": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49300.0, "volume": 3, "trade_date_time": 1555333860000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49480.0, "volume": 3, "trade_date_time": 1555397400000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9987604.899999984, "static_balance": 9987604.899999984, "balance": 9984835.389999982, "available": 9984835.389999982, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -2700.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49320.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49450.0}}}, "2019-04-17": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49610.0, "volume": 3, "trade_date_time": 1555482840000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49530.0, "volume": 3, "trade_date_time": 1555483800000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9984835.389999982, "static_balance": 9984835.389999982, "balance": 9983565.87999998, "available": 9983565.87999998, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -1200.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": 49450.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49470.0}}}, "2019-04-18": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49780.0, "volume": 3, "trade_date_time": 1555506000000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "CLOSETODAY", "price": 49460.0, "volume": 3, "trade_date_time": 1555570200000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9983565.87999998, "static_balance": 9983565.87999998, "balance": 9978696.369999979, "available": 9978696.369999979, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -4800.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": NaN, "position_price_short": 49470.0, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49460.0}}}, "2019-04-19": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "SELL", "offset": "OPEN", "price": 49280.0, "volume": 3, "trade_date_time": 1555592400000000000, "commission": 34.755}, {"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "CLOSETODAY", "price": 49490.0, "volume": 3, "trade_date_time": 1555656600000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9978696.369999979, "static_balance": 9978696.369999979, "balance": 9975476.859999977, "available": 9975476.859999977, "float_profit": 0.0, "position_profit": 0.0, "close_profit": -3150.0, "frozen_margin": 0.0, "margin": 0.0, "frozen_commission": 0.0, "commission": 69.51, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 0, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 0, "volume_long_his": 0, "volume_long": 0, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": NaN, "open_price_short": NaN, "open_cost_long": 0.0, "open_cost_short": 0.0, "position_price_long": 49460.0, "position_price_short": NaN, "position_cost_long": 0.0, "position_cost_short": 0.0, "float_profit_long": 0.0, "float_profit_short": 0.0, "float_profit": 0.0, "position_profit_long": 0.0, "position_profit_short": 0.0, "position_profit": 0.0, "margin_long": 0.0, "margin_short": 0.0, "margin": 0.0, "last_price": 49500.0}}}, "2019-04-22": {"trades": [{"symbol": "SHFE.cu1905", "user_id": "TQSIM", "exchange_id": "SHFE", "instrument_id": "cu1905", "direction": "BUY", "offset": "OPEN", "price": 49540.0, "volume": 3, "trade_date_time": 1555679520000000000, "commission": 34.755}], "account": {"currency": "CNY", "pre_balance": 9975476.859999977, "static_balance": 9975476.859999977, "balance": 9974842.104999976, "available": 9926185.104999976, "float_profit": -600.0, "position_profit": -600.0, "close_profit": 0.0, "frozen_margin": 0.0, "margin": 48657.0, "frozen_commission": 0.0, "commission": 34.755, "frozen_premium": 0.0, "premium": 0.0, "deposit": 0.0, "withdraw": 0.0, "risk_ratio": 0.0048779719506146626}, "positions": {"SHFE.cu1905": {"symbol": "SHFE.cu1905", "exchange_id": "SHFE", "instrument_id": "cu1905", "pos_long_his": 0, "pos_long_today": 3, "pos_short_his": 0, "pos_short_today": 0, "volume_long_today": 3, "volume_long_his": 0, "volume_long": 3, "volume_long_frozen_today": 0, "volume_long_frozen_his": 0, "volume_long_frozen": 0, "volume_short_today": 0, "volume_short_his": 0, "volume_short": 0, "volume_short_frozen_today": 0, "volume_short_frozen_his": 0, "volume_short_frozen": 0, "open_price_long": 49540.0, "open_price_short": NaN, "open_cost_long": 743100.0, "open_cost_short": 0.0, "position_price_long": 49540.0, "position_price_short": 49500.0, "position_cost_long": 743100.0, "position_cost_short": 0.0, "float_profit_long": -600.0, "float_profit_short": 0.0, "float_profit": -600.0, "position_profit_long": -600.0, "position_profit_short": 0.0, "position_profit": -600.0, "margin_long": 48657.0, "margin_short": 0.0, "margin": 48657.0, "last_price": 49500.0}}}}' self.assertEqual(excepted_trade_log, trad_log) diff --git a/tqsdk/tqhelper.py b/tqsdk/tqhelper.py index 153c109f..b31a06aa 100644 --- a/tqsdk/tqhelper.py +++ b/tqsdk/tqhelper.py @@ -226,9 +226,7 @@ async def _forward_to_upstream(self, api_send_chan, upstream_send_chan, tq_send_ """转发给上游""" async for pack in api_send_chan: if pack["aid"] == "set_chart_data": - if (pack["type"] != "KSERIAL" and pack["type"] != "SERIAL") or (isinstance(pack["data"], list)): - # 过滤出新版 tqwebhelper 中符合 diff 协议的数据,为了不影响旧版 tqhelper 的使用,这里其他不做修改 - await tq_send_chan.send(pack) + await tq_send_chan.send(pack) elif pack["aid"] == "insert_order": self.order_symbols.add(pack["exchange_id"] + "." + pack["instrument_id"]) await self._send_subscribed_to_tq() @@ -292,7 +290,6 @@ def link_tq(api): parser.add_argument('--_action', type=str, required=False) parser.add_argument('--_tq_pid', type=int, required=False) parser.add_argument('--_tq_url', type=str, required=False) - parser.add_argument('--_http_server_port', type=int, required=False) # action==run时需要这几个 parser.add_argument('--_broker_id', type=str, required=False) parser.add_argument('--_account_id', type=str, required=False) @@ -320,10 +317,6 @@ def link_tq(api): if args._action == "mdreplay" and (not args._ins_url or not args._md_url): raise Exception("mdreplay 必要参数缺失") - # 可选参数,tqwebhelper 中 http server 的 port - if args._http_server_port is not None: - api._http_server_port = args._http_server_port - # 监控天勤进程存活情况 TqMonitorThread(args._tq_pid).start() diff --git a/tqsdk/tqwebhelper.py b/tqsdk/tqwebhelper.py index 9356d329..9dd1cfe3 100644 --- a/tqsdk/tqwebhelper.py +++ b/tqsdk/tqwebhelper.py @@ -8,27 +8,53 @@ """ import os import sys +import argparse import simplejson import asyncio -from datetime import date, datetime +from datetime import datetime from aiohttp import web import socket import websockets import tqsdk class TqWebHelper(object): - def __init__(self, _http_server_port = None, enabled_web_gui = False): - self._enabled_web_gui = bool(enabled_web_gui) # enabled_web_gui 转成 bool 类型 - if self._enabled_web_gui is True: + async def _run(self, api, api_send_chan, api_recv_chan, web_send_chan, web_recv_chan): + self._api = api + self._logger = self._api._logger.getChild("TqWebHelper") # 调试信息输出 + if not self._api._web_gui: + # 没有开启 web_gui 功能 + _data_handler_without_web_task = self._api.create_task( + self._data_handler_without_web(api_recv_chan, web_recv_chan)) + try: + async for pack in api_send_chan: + # api 发送的包,过滤出 set_chart_data, set_web_chart_data, 其余的原样转发 + if pack['aid'] != 'set_chart_data' and pack['aid'] != 'set_web_chart_data': + await web_send_chan.send(pack) + finally: + _data_handler_without_web_task.cancel() + else: + # 解析命令行参数 + parser = argparse.ArgumentParser() + # 天勤连接基本参数 + parser.add_argument('--_http_server_port', type=int, required=False) + args, unknown = parser.parse_known_args() + # 可选参数,tqwebhelper 中 http server 的 port + if args._http_server_port is not None: + self._http_server_port = args._http_server_port + else: + self._http_server_port = 0 + self._web_dir = os.path.join(os.path.dirname(__file__), 'web') - self._http_server_port = 0 if _http_server_port is None else _http_server_port file_path = os.path.abspath(sys.argv[0]) file_name = os.path.basename(file_path) + # 初始化数据截面 self._data = { "action": { "mode": "run", "md_url_status": '-', - "td_url_status": '-', + "td_url_status": True if isinstance(self._api._account, tqsdk.api.TqSim) else '-', + "account_id": self._api._account._account_id, + "broker_id": self._api._account._broker_id if isinstance(self._api._account, tqsdk.api.TqAccount) else 'TQSIM', "file_path": file_path[0].upper() + file_path[1:], "file_name": file_name }, @@ -40,27 +66,6 @@ def __init__(self, _http_server_port = None, enabled_web_gui = False): self._order_symbols = set() self._diffs = [] self._conn_diff_chans = set() - - async def _run(self, api, api_send_chan, api_recv_chan, web_send_chan, web_recv_chan): - self._api = api - if self._enabled_web_gui is False: - # 没有开启 web_gui 功能 - _data_handler_without_web_task = self._api.create_task( - self._data_handler_without_web(api_recv_chan, web_recv_chan)) - try: - async for pack in api_send_chan: - # api 发送的包,过滤出 set_chart_data , 其余的原样转发 - if pack['aid'] != 'set_chart_data': - await web_send_chan.send(pack) - finally: - _data_handler_without_web_task.cancel() - else: - self._logger = api._logger.getChild("TqWebHelper") # 调试信息输出 - # 发送给 web 账户信息,用作显示 - self._data["action"]["account_id"] = self._api._account._account_id - self._data["action"]["broker_id"] = self._api._account._broker_id if isinstance(self._api._account, - tqsdk.api.TqAccount) else 'TQSIM' - self.web_port_chan = tqsdk.api.TqChan(self._api) # 记录到 ws port 的channel _data_task = self._api.create_task(self._data_handler(api_recv_chan, web_recv_chan)) _wsserver_task = self._api.create_task(self.link_wsserver()) @@ -69,12 +74,14 @@ async def _run(self, api, api_send_chan, api_recv_chan, web_send_chan, web_recv_ try: # api 发送的包,过滤出需要的包记录在 self._data async for pack in api_send_chan: - if pack['aid'] == 'set_chart_data': + if pack['aid'] == 'set_chart_data' or pack['aid'] == 'set_web_chart_data': + # 发送的是绘图数据 + # 旧版 tqhelper aid=set_chart_data,发送除 KSERIAL/SERIAL 之外的序列,因为其 KSERIAL/SERIAL 序列不符合 diff 协议 + # 新版 tqwebhelper aid=set_web_chart_data 中发送的 KSERIAL/SERIAL 数据 diff_data = {} # 存储 pack 中的 diff 数据的对象 for series_id, series in pack['datas'].items(): - if (series["type"] != "KSERIAL" and series["type"] != "SERIAL") \ - or ("data" in series and isinstance(series["data"], dict)): - # 过滤出不符合 diff 协议的数据,旧版 tqhelper 中 KSERIAL/SERIAL 中的 data 对象是 list,不符合 diff 协议 + if (pack['aid'] == 'set_chart_data' and series["type"] != "KSERIAL" and series["type"] != "SERIAL") or\ + pack['aid'] == 'set_web_chart_data' : diff_data[series_id] = series if diff_data != {}: web_diff = {'draw_chart_datas': {}} @@ -140,12 +147,10 @@ async def _data_handler(self, api_recv_chan, web_recv_chan): TqWebHelper.merge_diff(self._data, {"action": {"mode": "backtest"}}) web_diffs.append({"action": {"mode": "backtest"}}) # 处理通知,行情和交易连接的状态 - notifies = d.get("notify") - if notifies is not None: - notify_diffs = self._notify_handler(notifies) - if len(notify_diffs) > 0: - TqWebHelper.merge_diff(self._data, notify_diffs[0]) - web_diffs.extend(notify_diffs) + notify_diffs = self._notify_handler(d.get("notify", {})) + for diff in notify_diffs: + TqWebHelper.merge_diff(self._data, diff) + web_diffs.extend(notify_diffs) if account_changed: dt, snapshot = self.get_snapshot() _snapshots = {"snapshots": {}} @@ -161,14 +166,12 @@ def _notify_handler(self, notifies): """将连接状态的通知转成 diff 协议""" diffs = [] for _, notify in notifies.items(): - if notify["code"] == 2019112901: - # 连接建立的通知 + if notify["code"] == 2019112901 or notify["code"] == 2019112902: + # 连接建立的通知 第一次建立 或者 重连建立 if notify["url"] == self._api._md_url: diffs.append({ "action": { - "md_url_status": True, - "td_url_status": True if isinstance(self._api._account, tqsdk.sim.TqSim) \ - else self._data["action"]["td_url_status"] + "md_url_status": True } }) elif notify["url"] == self._api._td_url: @@ -177,14 +180,12 @@ def _notify_handler(self, notifies): "td_url_status": True } }) - elif notify["code"] == 2019112902: + elif notify["code"] == 2019112911: # 连接断开的通知 if notify["url"] == self._api._md_url: diffs.append({ "action": { - "md_url_status": False, - "td_url_status": True if isinstance(self._api._account, tqsdk.sim.TqSim) \ - else self._data["action"]["td_url_status"] + "md_url_status": False } }) elif notify["url"] == self._api._td_url: