3.20K 浏览
0
<span class="n">1、在SDK文档中说明:limit_price (float): [可选]下单价格, 默认市价单 (上期所、原油和中金所不支持市价单, 需填写此参数值)
那么如果这样下单会什么结果?报错?
api</span> <span class="o">=</span> <span class="n">TqApi</span><span class="p">()</span>
<span class="n">order</span> <span class="o">=</span> <span class="n">api</span><span class="o">.</span><span class="n"><span class="highlighted">insert_order</span></span><span class="p">(</span><span class="n">symbol</span><span class="o">=</span><span class="s2">"SHFE.ni2005"</span><span class="p">,</span> <span class="n">direction</span><span class="o">=</span><span class="s2">"BUY"</span><span class="p">,</span> <span class="n">offset</span><span class="o">=</span><span class="s2">"OPEN"</span><span class="p">,</span> <span class="n">volume</span><span class="o">=</span><span class="mi">3</span><span class="p">)
只有下这样的单子才行吗?
<span class="n">order</span> <span class="o">=</span> api.insert_order(symbol=SYMBOL1, direction="<span class="s2">BUY</span>", offset="OPEN",limit_price=102230, volume=3)

2、如果<span class="n">上期所要市价成交,如何写代码?</span>

</span>
west 已回答的问题 2020年2月25日
0

是交易所的规定,必须下限价单,否则无法成交

west 已回答的问题 2020年2月25日