正在学习使用天勤量化工具,试着按照指南操作。但图形化界面打不开,不知什么原因?谢谢!
<span class="c1"># 引入TqSdk模块</span> <span class="kn">from</span> <span class="nn">tqsdk</span> <span class="kn">import</span> <span class="n">TqApi</span><span class="p">,</span> <span class="n">TqAuth</span> <span class="c1"># 创建api实例,设置web_gui=True生成图形化界面</span> <span class="n">api</span> <span class="o">=</span> <span class="n">TqApi</span><span class="p">(</span><span class="n">web_gui</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">auth</span><span class="o">=</span><span class="n">TqAuth</span><span class="p">(</span><span class="s2">"快期账户"</span><span class="p">,</span> <span class="s2">"账户密码"</span><span class="p">))</span> <span class="c1"># 订阅 ni2010 合约的10秒线</span> <span class="n">klines</span> <span class="o">=</span> <span class="n">api</span><span class="o">.</span><span class="n">get_kline_serial</span><span class="p">(</span><span class="s2">"SHFE.ni2010"</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span> <span class="k">while</span> <span class="kc">True</span><span class="p">:</span> <span class="c1"># 通过wait_update刷新数据</span> <span class="n">api</span><span class="o">.</span><span class="n">wait_update</span><span class="p">() </span>run的结果: "C:\Users\Hu Feng\anaconda3\python.exe" D:\我的投资\04量化投资\07天勤量化\获取实时行情数据.py 在使用天勤量化之前,默认您已经知晓并同意以下免责条款,如果不同意请立即停止使用:https://www.shinnytech.com/blog/disclaimer/ 2023-12-20 22:16:51 - INFO - 通知 : 与 wss://free-api.shinnytech.com/t/nfmd/front/mobile 的网络连接已建立 2023-12-20 22:16:50.500000 21140.0 补充:观看了学习视频,运行没有给出本地网址。
李思恒 已回答的问题 2023年12月21日