Giter VIP home page Giter VIP logo

py-futu-api's Introduction

富途 OpenAPI

简介

Futu API开源项目可以满足使用Futu OpenAPI进行量化投资的需求, 并提供包括Python、Json/Protobuf协议的行情及交易接口。


安装

pip install futu-api
注: 本API支持Python2.7/Python3.x, 推荐安装anaconda2或anaconda3环境,方便快捷。

快速上手


# 导入futu-api
import futu as ft

# 实例化行情上下文对象
quote_ctx = ft.OpenQuoteContext(host="127.0.0.1", port=11111)

# 上下文控制
quote_ctx.start()              # 开启异步数据接收
quote_ctx.set_handler(ft.TickerHandlerBase())  # 设置用于异步处理数据的回调对象(可派生支持自定义)

# 低频数据接口
market = ft.Market.HK
code = 'HK.00123'
code_list = [code]
plate = 'HK.BK1107'
print(quote_ctx.get_trading_days(market, start=None, end=None))   # 获取交易日
print(quote_ctx.get_stock_basicinfo(market, stock_type=ft.SecurityType.STOCK))   # 获取股票信息
print(quote_ctx.get_autype_list(code_list))                                  # 获取复权因子
print(quote_ctx.get_market_snapshot(code_list))                              # 获取市场快照
print(quote_ctx.get_plate_list(market, ft.Plate.ALL))                         # 获取板块集合下的子板块列表
print(quote_ctx.get_plate_stock(plate))                         # 获取板块下的股票列表

# 高频数据接口
quote_ctx.subscribe(code, [ft.SubType.QUOTE, ft.SubType.TICKER, ft.SubType.K_DAY, ft.SubType.ORDER_BOOK, ft.SubType.RT_DATA, ft.SubType.BROKER])
print(quote_ctx.get_stock_quote(code))  # 获取报价
print(quote_ctx.get_rt_ticker(code))   # 获取逐笔
print(quote_ctx.get_cur_kline(code, num=100, ktype=ft.KLType.K_DAY))   #获取当前K线
print(quote_ctx.get_order_book(code))       # 获取摆盘
print(quote_ctx.get_rt_data(code))          # 获取分时数据
print(quote_ctx.get_broker_queue(code))     # 获取经纪队列

# 停止异步数据接收
quote_ctx.stop()

# 关闭对象
quote_ctx.close()

# 实例化港股交易上下文对象
trade_hk_ctx = ft.OpenHKTradeContext(host="127.0.0.1", port=11111)

# 交易接口列表
print(trade_hk_ctx.unlock_trade(password='123456'))                # 解锁接口
print(trade_hk_ctx.accinfo_query(trd_env=ft.TrdEnv.SIMULATE))      # 查询账户信息
print(trade_hk_ctx.place_order(price=1.1, qty=2000, code=code, trd_side=ft.TrdSide.BUY, order_type=ft.OrderType.NORMAL, trd_env=ft.TrdEnv.SIMULATE))  # 下单接口
print(trade_hk_ctx.order_list_query(trd_env=ft.TrdEnv.SIMULATE))      # 查询订单列表
print(trade_hk_ctx.position_list_query(trd_env=ft.TrdEnv.SIMULATE))    # 查询持仓列表

trade_hk_ctx.close()


示例策略

  • 示例策略文件位于目录: (futu-api包安装目录)/py-futu-api/examples 下,用户可参考实例策略来学习API的使用。

调试开关和推送记录

  • set_futu_debug_model函数可以打开或关闭调试级别的log记录。
  • 如果打开记录,则会记录info级别的log并且记录所有逐笔、摆盘、券商经纪的推送记录,以便于后面排查,文件记录在%appdata%(%HOME%)\com.futunn.FutuOpenD\Log下面
  • examples\analysis下面会有对逐笔、摆盘、券商经纪的推送记录的分析脚本,与我们联系,拿到原始交易所数据后,可以载入比对(beta功能)

组织结构

.
├── futu
│   ├── common #主要框架代码
│   │   ├── callback_executor.py
│   │   ├── comm_add_path.py
│   │   ├── conn_key.txt
│   │   ├── conn_mng.py
│   │   ├── constant.py
│   │   ├── err.py
│   │   ├── ft_logger.py
│   │   ├── handler_context.py
│   │   ├── __init__.py
│   │   ├── network_manager.py
│   │   ├── open_context_base.py
│   │   ├── pb
│   │   │   └── __init__.py
│   │   ├── pbjson.py
│   │   ├── sys_config.py
│   │   └── utils.py
│   ├── examples #一些简单的演示demo
│   │   ├── analysis
│   │   │   ├── broker_analysis.py
│   │   │   ├── orderbook_analysis.py
│   │   │   └── ticker_analysis.py
│   │   ├── check_all_get_push.py
│   │   ├── __init__.py
│   │   ├── loop_get_mkt_snapshot.py
│   │   ├── macd.py
│   │   ├── simple.py
│   │   ├── stocksell.py
│   │   └── tiny_quant #这里是一个历史遗留的复杂回测框架,暂时继续保留两个demo,这里建议开发者自己找好用的回测框架,不要再依赖这个破碎框架(裁剪自vnpy)
│   │       ├── demo
│   │       │   ├── __init__.py
│   │       │   ├── tq_macd
│   │       │   │   ├── __init__.py
│   │       │   │   ├── setting.json
│   │       │   │   └── TinyStrateMACD.py
│   │       │   └── tq_sample
│   │       │       ├── __init__.py
│   │       │       ├── setting.json
│   │       │       └── TinyStrateSample.py
│   │       ├── __init__.py
│   │       └── tiny_quant_frame #裁剪自vnpy
│   │           ├── event
│   │           │   ├── eventEngine.py
│   │           │   ├── eventType.py
│   │           │   └── __init__.py
│   │           ├── FutuDataEvent.py
│   │           ├── FutuMarketEvent.py
│   │           ├── __init__.py
│   │           ├── setting.json
│   │           ├── TinyDefine.py
│   │           ├── TinyQuantBase.py
│   │           ├── TinyQuantFrame.py
│   │           ├── TinyStrateBase.py
│   │           └── TinyStrateSample.py
│   ├── __init__.py
│   ├── quote #行情相关接口代码
│   │   ├── __init__.py
│   │   ├── open_quote_context.py
│   │   ├── quote_query.py
│   │   └── quote_response_handler.py
│   ├── trade #交易相关接口代码
│   │   ├── __init__.py
│   │   ├── open_trade_context.py
│   │   ├── trade_query.py
│   │   └── trade_response_handler.py
│   └── VERSION.txt
├── setup
│   ├── PyCrypto-Wheels.url
│   └── .url
└── setup.py

使用须知

  • python脚本运行前,需先启动FutuOpenD网关客户端

API与FutuOpenD网关客户端的架构

image


API及FutuOpenD客户端交流方式

  • 富途开放API群(229850364, 108534288)
  • 有一定交易额或特殊需求的用户请在入群后联系群主

使用说明

  • 有任何问题可以到 issues 处提出,我们会及时进行解答。
  • 使用新版本时请先仔细阅读接口文档,大部分问题都可以在接口文档中找到你想要的答案。
  • 欢迎大家提出建议、也可以提出各种需求,我们一定会尽量满足大家的需求。

py-futu-api's People

Contributors

byblehua avatar futunnopen avatar haoqipaopao avatar johncolezhang avatar loadatom avatar peiyao456 avatar ysq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

py-futu-api's Issues

接口获取不了小米的MACD月K线

参考这个 demo:

def handle_data(self):
    """
    handle stock data for trading signal, and make order
    """
    # 读取历史数据,使用sma方式计算均线准确度和数据长度无关,但是在使用ema方式计算均线时建议将历史数据窗口适当放大,结果会更加准确
    today = datetime.datetime.today()
    pre_day = (today - datetime.timedelta(days=self.observation)
               ).strftime('%Y-%m-%d')
    end_dt = today.strftime('%Y-%m-%d')
    ret_code, prices, page_req_key = self.quote_ctx.request_history_kline(self.stock, start=pre_day, end=end_dt, ktype=ft.KLType.K_MON)
    if ret_code != ft.RET_OK:
        print("request_history_kline fail: {}".format(prices))
        return
    else:
        print("====== prices =====")
        print(prices)

    # 用talib计算MACD取值,得到三个时间序列数组,分别为 macd, signal 和 hist
    # macd 是长短均线的差值,signal 是 macd 的均线
    # 使用 macd 策略有几种不同的方法,我们这里采用 macd 线突破 signal 线的判断方法
    macd, signal, hist = talib.MACD(prices['close'].values,
                                    self.short_period, self.long_period,
                                    self.smooth_period)
    print("====== macd =====")
    print(macd)

直接把 handle_data() 结果打印出来而已,其中在 request_history_kline 额外加了 ft.KLType.K_MON ,运行结果全身 nan

Screen Shot 2020-01-29 at 12 34 47 PM

于此同时,futu 主 app 是可以看到 MACD 的月K线图的:

Screen Shot 2020-01-29 at 12 29 15 PM

请问有API获取 MACD 月线数据么?

如何配置文件证书登录

ssh免密码登录
1、客户端即A端生成RSA公钥和私钥
2、我们自己(A端)保留自己的私钥,然后把公钥id_rsa.pub存放到B端

富途的openapiD的登录配置方式有6种(富途intro文档 https://futunnopen.github.io/futu-api-doc/intro/FutuOpenDGuide.html#id7)

1.命令行证书登录
2.命令行帐号密码密文登录
3.命令行帐号密码明文登录
4.配置文件证书登录
5.配置文件帐号密码密文登录
6.配置文件帐号密码明文登录

第4中就是类同于ssh免密码登录吧,请问,公钥id_rsa.pub需要上传到富途的服务器上吗?如何传?

行情权限不足 -1

-1 行情权限不足

这个怎么开通权限? 刚接触,想尝试量化 。获取行情就这个提示。 改怎么提高权限?

美股 get_cur_kline 拿不到數據

你好, 我用get_cur_kline()拿不到美股數據,只回傳了一個空的dataframe 也沒有error message
image

我查詢港股的話就沒問題
image

Is the API compatible with MultiCharts?

Hello there, I am new to programming as well as the API. I was wondering how I could make use of the data existing on FUTU and import the data into Multicharts. In short, I am trying to use Multicharts for my decision making tools and help me do the trades automatically, with my FUTU account linked with it.

美股期权交易返回(-1, '不是可交易的证券类型')

trade_us_ctx.place_order(price=1.1, qty=1, code='US.AAPL190215P140000', trd_side=ft.TrdSide.BUY, order_type=ft.OrderType.NORMAL, trd_env=ft.TrdEnv.SIMULATE)
return (-1, '不是可交易的证券类型')

美股期权的code是US.AAPL190215P140000这样填写吗

FutuOpenD version 1.08
python futu api version 3.6.3

name 'json2pb' is not defined

请问一下, 我运行涉及到高频行情的demo就报这个错,怎么解决?

代码如下:

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
quote_ctx.subscribe('SZ.002170', [ft.SubType.QUOTE, ft.SubType.TICKER, ft.SubType.K_DAY, ft.SubType.ORDER_BOOK, ft.SubType.RT_DATA, ft.SubType.BROKER])
print(quote_ctx.get_rt_ticker('SZ.002170'))

报错如下:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/chenkai/Desktop/TestProject/futu-test/futu/common/network_manager.py", line 247, in _thread_func
    self.poll()
  File "/Users/chenkai/Desktop/TestProject/futu-test/futu/common/network_manager.py", line 197, in poll
    self._on_read(conn)
  File "/Users/chenkai/Desktop/TestProject/futu-test/futu/common/network_manager.py", line 487, in _on_read
    self._on_packet(conn, head_dict, Err.Ok.code, '', rsp_body)
  File "/Users/chenkai/Desktop/TestProject/futu-test/futu/common/network_manager.py", line 550, in _on_packet
    rsp_pb = binary2pb(rsp_body, head_dict['proto_id'], head_dict['proto_fmt_type'])
  File "/Users/chenkai/Desktop/TestProject/futu-test/futu/common/utils.py", line 485, in binary2pb
    return json2pb(type(rsp), b.decode('utf-8'))
NameError: name 'json2pb' is not defined

在线获取复权因子(get_rehab)表中per_share_trans_ratio字段精度不足

get_rehab在线获取复权因子表,表中如下字段精度不足:

  • split_ratio
  • per_share_div_ratio
  • per_share_trans_ratio
  • allotment_ratio
  • stk_spo_ratio

虽然数据类型是float,但是小数部分都是0,看起来像是float(int(ratio)),而且document中对此字段的解释是错误的,例如per_share_trans_ratio并不是每股转增股比例,并不是一个百分比,比如说SH.600489在2009-06-05每10股转增12股,这个ratio是用10.0 / 12.0 = 0.8333,如果是10股配3股,这个ratio是10.0 / 3.0 = 3.3333,通常这种类型的数据要保留四位小数,精度不够则无法使用。在futuquant版本中,get_autype_list得到的数据还是有很多位小数的。
烦请尽快检查下

Python 3.6.7 Demo无法运行

Traceback (most recent call last):
File "./hk_ipo_history_price.py", line 1, in
import futu as ft
File "/usr/local/lib/python3.6/dist-packages/futu/init.py", line 22, in
from futu.quote.open_quote_context import OpenQuoteContext
File "/usr/local/lib/python3.6/dist-packages/futu/quote/open_quote_context.py", line 11, in
from futu.common.open_context_base import OpenContextBase, ContextStatus
File "/usr/local/lib/python3.6/dist-packages/futu/common/open_context_base.py", line 11, in
from futu.common.utils import *
File "/usr/local/lib/python3.6/dist-packages/futu/common/utils.py", line 8, in
from futu.common.conn_mng import *
File "/usr/local/lib/python3.6/dist-packages/futu/common/conn_mng.py", line 5, in
from futu.common.constant import *
File "/usr/local/lib/python3.6/dist-packages/futu/common/constant.py", line 140, in
from futu.common.pb import Trd_Common_pb2
File "/usr/local/lib/python3.6/dist-packages/futu/common/pb/Trd_Common_pb2.py", line 17, in
import Common_pb2 as Common__pb2
File "/usr/local/lib/python3.6/dist-packages/futu/common/pb/Common_pb2.py", line 107, in
options=None, file=DESCRIPTOR),
TypeError: new() got an unexpected keyword argument 'file'

示例代码

import futu as ft

quote_ctx = ft.OpenQuoteContext(host='127.0.0.1', port=11111)
print(quote_ctx.get_market_snapshot('HK.00700'))
quote_ctx.close()

module 'futu' has no attribute 'OpenQuoteContext'

如果我用回以前futuqant 的module 的話則沒有問題
但用futu這個module 的話 他會顯示沒有OpenQuoteContext
import futu as ft
quote_ctx = ft.OpenQuoteContext(host='127.0.0.1', port=11111)
print(quote_ctx.get_market_snapshot('HK.00700'))
quote_ctx.close()

RSA加密是不是有问题?

按照说明操作,但是配上rsa_private_key连接就会异常。提示

[network_manager.py] _on_packet:532: Recv: conn_id=1; proto_id=1001; serial_no=9429; data_len=128; msg=proto id:1001 conn_id:0 check sha error!;

即使用示例的RSA文件也不行,怀疑哪里有问题。

自选股接口上限限制问题

2.2.400的新增的自选股接口在新增自选分组股票后也会在默认的"全部"分组增加,删除对应分组股票时不会在"全部"里删除,系统也没有提供"全部"这个默认分组,导致很快达到自选股上限,无法再新增股票。

vnstation 2.1.1 接入富途后,无法订阅行情

在vntrader gateway连接好之后,输入代码,回车

可以查询到 代码对应的名称

fb

futu log :
03-19 18:27:39(1584613659.580950) | 10420 | F3C | Info | Quote | SendSubReq By LasSubFailed
03-19 18:27:39(1584613659.580950) | 10420 | F3C | Info | Quote | SubQot 6211 Ret=1 UID=636726 AID=0 RK=3967188186676871702 SNO=16918 , enMktType = 2
03-19 18:27:39(1584613659.581963) | 10420 | F3C | Info | Quote | SubQot 6211 Ret=1 UID=636726 AID=0 RK=3967188186676871703 SNO=16919 , enMktType = 11
BlockingStatusThread 0 1584613662 class OMTcpServerImpl 9812
BlockingStatusThread 0 1584613662 class GTWWebSocket 10268
03-19 18:27:46(1584613666.629723) | 10420 | F3C | Info | Quote | OnReply_SubOrUnSub 6211 nReqKey=3967188186676871701 nSenderID=923682979 nSerialNo=16917 enProtoRet=-10000 nSvrRet=0
......\Src\NNProtoCenter\Quote\NNBiz_Qot_PushQot.cpp 488
03-19 18:27:46(1584613666.678607) | 10420 | F3C | Info | Quote | SendSubReq By LasSubFailed
03-19 18:27:46(1584613666.679602) | 10420 | F3C | Info | Quote | SubQot 6211 Ret=1 UID=636726 AID=0 RK=3967188186676871704 SNO=16920 , enMktType = 2

get_market_snapshot无法获取美股数据

获取市场快照,股票代码设置成港股时可以正常返回,设置成美股时就无法正常返回。

代码如下:
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
print(quote_ctx.get_market_snapshot('US.AAPL'))
quote_ctx.close()

报错:
(-1, 'NN_ProtoRet_TimeOut')

Incorrect Time format - mili-second missing leading zeros

In the returning data of OrderBookHandlerBase.on_recv_rsp, for example

{'code': 'HK.MHI2005', 'svr_recv_time_bid': '2020-05-07 15:07:42.8', 'svr_recv_time_ask': '2020-05-07 15:07:42.8', 'Bid': [...], 'Ask': [...]}

I receive time string of svr_recv_time_bid and svr_recv_time_ask like the following
2020-05-07 15:07:42
2020-05-07 15:07:42.8
2020-05-07 15:07:42.88
2020-05-07 15:07:42.888

Originally, I thought that 2020-05-07 15:07:42.8 means 2020-05-07 15:07:42.800. However, when I collected data later. I found statistically there are no timestamp that mili-second is starting with 0, i.e. format like yyyy-MM-dd hh:mm:ss.0zz or yyyy-MM-dd hh:mm:ss.00z.

So I infer that 2020-05-07 15:07:42.8 actually means 2020-05-07 15:07:42.008. This is not a conventional format of time! And should be considered as a bug.

转了新版后,debug信息怎样停止显示?

转了新版后,debug信息怎样停止显示?

为什么以下的信息不停的显示?可否禁止?
[network_manager.py] do_send:283: Send: conn_id=1; proto_id=3001; serial_no=2583; total_len=66;
[network_manager.py] _on_packet:563: Recv: conn_id=1; proto_id=3011; serial_no=0; data_len=84; msg=;
[network_manager.py] _on_packet:563: Recv: conn_id=1; proto_id=3001; serial_no=2583; data_len=6; msg=;
[network_manager.py] _on_read:496: conn_id=1; elapsed=0.002033233642578125; recv_len=178; buf_len=178;

运行一段时间挂死问题

运行一段时间挂死了,通过python trace功能看到是在调用这个函数时挂死的(没有返回),没有继续往下追踪,希望能及时解决。
unsubscribe(self, code_list, subtype_list)

咨询行情协议 3001 与 3002 的区别和设计

Qot_Sub.proto - 3001订阅或者反订阅
Qot_RegQotPush.proto - 3002注册行情推送

这两个协议看起来十分相似,似乎订阅后的 security 还需要再注册推送后才可以获得推送。
请问将 3001 3002 区分设计的考量是什么?可否合并成一个?

美股 request_history_kline 返回 (-1, 'NN_ProtoRet_TimeOut')

python == 3.6.5
futu-api == 3.6.3
FutuOpenD == 1.08_Mac

美股 request_history_kline 返回 (-1, 'NN_ProtoRet_TimeOut').

code = 'US.AAPL'
# code = 'HK.00700'
start_date = '2018-12-01'
end_date = '2018-12-28'
ret, data, page_req_key = quote_ctx.request_history_kline(
        code,
        start=start_date,
        end=end_date,
        ktype=KLType.K_1M,
        max_count=50,
    )  # 请求开头50个数据

但是港股就没问题。

snapshot 只显示省略号,没有显示全部信息

print(quote_ctx.get_market_snapshot(['SH.600031']))

Connected to pydev debugger (build 193.6494.30)
2020-04-25 17:52:02,844 [open_context_base.py] _socket_reconnect_and_wait_ready:256: Start connecting: host=127.0.0.1; port=11111;
2020-04-25 17:52:02,845 [open_context_base.py] on_connected:344: Connected : conn_id=1;
2020-04-25 17:52:02,848 [open_context_base.py] _handle_init_connect:445: InitConnect ok: conn_id=1; info={'server_version': 209, 'login_user_id': 14701153, 'conn_id': 6659931993677367405, 'conn_key': '98F7980C6A904006', 'conn_iv': 'FAF155F15A241BAC', 'keep_alive_interval': 10, 'is_encrypt': False};
(0, code update_time ... after_change_rate after_amplitude
0 SH.600031 2020-04-24 15:00:00 ... N/A N/A

[1 rows x 123 columns])

1) 显示有123 列,但是都是省略号,看不见股票信息,如何才能显示全部信息呢,打印到csv 也是省略号,没有实际信息;
2) 存到CSV 文件中的时候,所有内容都在一行一列里面,怎么能让123 columns 分别显示在123 列里面呢?

[JAVA] dylib file 在 macosx 會出現 code signature invalid

Suppressed: java.lang.UnsatisfiedLinkError: dlopen(/Users/.../GIT/futu-open-api/libFTAPIChannel.dylib, 9): no suitable image found.  Did find:
	/Users/.../GIT/futu-open-api/libFTAPIChannel.dylib: code signature invalid for '/Users/.../GIT/futu-open-api/libFTAPIChannel.dylib'

		at com.sun.jna.Native.open(Native Method)
		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191)
		... 57 more
	Suppressed: java.lang.UnsatisfiedLinkError: dlopen(/Users/.../GIT/futu-open-api/libFTAPIChannel.dylib, 9): no suitable image found.  Did find:
	/Users/.../GIT/futu-open-api/libFTAPIChannel.dylib: code signature invalid for '/Users/.../GIT/futu-open-api/libFTAPIChannel.dylib'

	/Users/.../GIT/futu-open-api/libFTAPIChannel.dylib: stat() failed with errno=1

用Pyinstaller 打包后出现问题

您好:
我在pycharm 载入了 futu library 后再打包成.exe
.exe 开启后未能如常运作,打开任务管理器后发现.exe 程序在不停自我复制。
即使仅仅加载library 而不使用亦出现此问题。
我的测试python code 如下:

from futu import *

if name == "main":
print('Hello')
input()

但是用pycharm 运作完全正常。

network_manager.py debug messages

你好,如不需要显示debug信息,可以在FutuOpenD.xml文件中修改log_level为info或者更高的日志等级 即可停止debug信息的显示。
如仍有问题,可通过用户反馈群(号码:229850364)找管理员解决,谢谢。

之前问的问题,试过行不通,在群已反馈,还没有答复。

get_market_snapshot() 获取美股数据时超时!

get_market_snapshot()接口获取美股数据时95%概率失败,少数股票才成功。
例如:quote_ctx.get_market_snapshot(['US.TSLA'])
得到返回:(-1, 'NN_ProtoRet_TimeOut')

获取A股和港股正常。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.