3.09K 浏览
0

PY中根据示例的DICT结构.这个成交是累加的成交量.没有单独当刻的成交量

而在DDE到EXCEL中的一个字段delta_volume.可以显示此刻的成交量多少.这里却没有.还有什么办法能够得到这个此刻类似delta_volume的成交量.谢谢.

返回值为一个dict, 结构如下:

<span class="p">{</span>
    <span class="s2">"datetime"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>  <span class="c1"># "2017-07-26 23:04:21.000001" (行情从交易所发出的时间(北京时间))</span>
    <span class="s2">"ask_price5"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6122.0 (卖五价)</span>
    <span class="s2">"ask_volume5"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 3 (卖五量)</span>
    <span class="s2">"ask_price4"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6122.0 (卖四价)</span>
    <span class="s2">"ask_volume4"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 3 (卖四量)</span>
    <span class="s2">"ask_price3"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6122.0 (卖三价)</span>
    <span class="s2">"ask_volume3"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 3 (卖三量)</span>
    <span class="s2">"ask_price2"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6122.0 (卖二价)</span>
    <span class="s2">"ask_volume2"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 3 (卖二量)</span>
    <span class="s2">"ask_price1"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6122.0 (卖一价)</span>
    <span class="s2">"ask_volume1"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 3 (卖一量)</span>
    <span class="s2">"bid_price1"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6121.0 (买一价)</span>
    <span class="s2">"bid_volume1"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 7 (买一量)</span>
    <span class="s2">"bid_price2"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6121.0 (买二价)</span>
    <span class="s2">"bid_volume2"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 7 (买二量)</span>
    <span class="s2">"bid_price3"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6121.0 (买三价)</span>
    <span class="s2">"bid_volume3"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 7 (买三量)</span>
    <span class="s2">"bid_price4"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6121.0 (买四价)</span>
    <span class="s2">"bid_volume4"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 7 (买四量)</span>
    <span class="s2">"bid_price5"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6121.0 (买五价)</span>
    <span class="s2">"bid_volume5"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 7 (买五量)</span>
    <span class="s2">"last_price"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6122.0 (最新价)</span>
    <span class="s2">"highest"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6129.0 (当日最高价)</span>
    <span class="s2">"lowest"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6101.0 (当日最低价)</span>
    <span class="s2">"open"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6102.0 (开盘价)</span>
    <span class="s2">"close"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># nan (收盘价)</span>
    <span class="s2">"average"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6119.0 (当日均价)</span>
    <span class="s2">"volume"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 89252 (成交量)</span>
    <span class="s2">"amount"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 5461329880.0 (成交额)</span>
    <span class="s2">"open_interest"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 616424 (持仓量)</span>
    <span class="s2">"settlement"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># nan (结算价)</span>
    <span class="s2">"upper_limit"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6388.0 (涨停价)</span>
    <span class="s2">"lower_limit"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 5896.0 (跌停价)</span>
    <span class="s2">"pre_open_interest"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 616620 (昨持仓量)</span>
    <span class="s2">"pre_settlement"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6142.0 (昨结算价)</span>
    <span class="s2">"pre_close"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 6106.0 (昨收盘价)</span>
    <span class="s2">"price_tick"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># 10.0 (合约价格单位)</span>
    <span class="s2">"price_decs"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 0 (合约价格小数位数)</span>
    <span class="s2">"volume_multiple"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 10 (合约乘数)</span>
    <span class="s2">"max_limit_order_volume"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 500 (最大限价单手数)</span>
    <span class="s2">"max_market_order_volume"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 0 (最大市价单手数)</span>
    <span class="s2">"min_limit_order_volume"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 1 (最小限价单手数)</span>
    <span class="s2">"min_market_order_volume"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>  <span class="c1"># 0 (最小市价单手数)</span>
    <span class="s2">"underlying_symbol"</span><span class="p">:</span> <span class="s2">""</span><span class="p">,</span>  <span class="c1"># SHFE.rb1901 (标的合约)</span>
    <span class="s2">"strike_price"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># nan (行权价)</span>
    <span class="s2">"change"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># −20.0 (涨跌)</span>
    <span class="s2">"change_percent"</span><span class="p">:</span> <span class="nb">float</span><span class="p">(</span><span class="s2">"nan"</span><span class="p">),</span>  <span class="c1"># −0.00325 (涨跌幅)</span>
    <span class="s2">"expired"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>  <span class="c1"># False (合约是否已下市)</span>
<span class="p">}</span>
west 已回答的问题 2020年3月6日

“datetime”: “”, # “2017-07-26 23:04:21.000001” (行情从交易所发出的时间(北京时间))
“ask_price5”: float(“nan”), # 6122.0 (卖五价)
“ask_volume5”: 0, # 3 (卖五量)
“ask_price4”: float(“nan”), # 6122.0 (卖四价)
“ask_volume4”: 0, # 3 (卖四量)
“ask_price3”: float(“nan”), # 6122.0 (卖三价)
“ask_volume3”: 0, # 3 (卖三量)
“ask_price2”: float(“nan”), # 6122.0 (卖二价)
“ask_volume2”: 0, # 3 (卖二量)
“ask_price1”: float(“nan”), # 6122.0 (卖一价)
“ask_volume1”: 0, # 3 (卖一量)
“bid_price1”: float(“nan”), # 6121.0 (买一价)
“bid_volume1”: 0, # 7 (买一量)
“bid_price2”: float(“nan”), # 6121.0 (买二价)
“bid_volume2”: 0, # 7 (买二量)
“bid_price3”: float(“nan”), # 6121.0 (买三价)
“bid_volume3”: 0, # 7 (买三量)
“bid_price4”: float(“nan”), # 6121.0 (买四价)
“bid_volume4”: 0, # 7 (买四量)
“bid_price5”: float(“nan”), # 6121.0 (买五价)
“bid_volume5”: 0, # 7 (买五量)
“last_price”: float(“nan”), # 6122.0 (最新价)
“highest”: float(“nan”), # 6129.0 (当日最高价)
“lowest”: float(“nan”), # 6101.0 (当日最低价)
“open”: float(“nan”), # 6102.0 (开盘价)
“close”: float(“nan”), # nan (收盘价)
“average”: float(“nan”), # 6119.0 (当日均价)
“volume”: 0, # 89252 (成交量)
“amount”: float(“nan”), # 5461329880.0 (成交额)
“open_interest”: 0, # 616424 (持仓量)
“settlement”: float(“nan”), # nan (结算价)
“upper_limit”: float(“nan”), # 6388.0 (涨停价)
“lower_limit”: float(“nan”), # 5896.0 (跌停价)
“pre_open_interest”: 0, # 616620 (昨持仓量)
“pre_settlement”: float(“nan”), # 6142.0 (昨结算价)
“pre_close”: float(“nan”), # 6106.0 (昨收盘价)
“price_tick”: float(“nan”), # 10.0 (合约价格单位)
“price_decs”: 0, # 0 (合约价格小数位数)
“volume_multiple”: 0, # 10 (合约乘数)
“max_limit_order_volume”: 0, # 500 (最大限价单手数)
“max_market_order_volume”: 0, # 0 (最大市价单手数)
“min_limit_order_volume”: 0, # 1 (最小限价单手数)
“min_market_order_volume”: 0, # 0 (最小市价单手数)
“underlying_symbol”: “”, # SHFE.rb1901 (标的合约)
“strike_price”: float(“nan”), # nan (行权价)
“change”: float(“nan”), # −20.0 (涨跌)
“change_percent”: float(“nan”), # −0.00325 (涨跌幅)
“expired”: False, # False (合约是否已下市)

0

可以将当前tick的成交量减去上一个tick的成交量

west 已回答的问题 2020年3月6日