Comments (7)
@yutiansut 嗯,一般8点多到
from pytdx.
@Solensolen 基本上理解的正确把,但是start=0代表从当前时间点能获取的最近的一个bar开始计算的,至于对于日k线来说是不是昨天,根据交易日休市等的情况还有所不同...
from pytdx.
咦 我之前写过 不过实时的用quotes就可以了 不用bar
from pytdx.
https://github.com/yutiansut/QUANTAXIS/blob/master/QUANTAXIS/QAFetch/QATdx.py#L221 @Solensolen 你可以参考下这个
def QA_fetch_get_stock_realtime(code=['000001', '000002'], ip=best_ip, port=7709):
api = TdxHq_API()
__data = pd.DataFrame()
with api.connect(ip, port):
code = [code] if type(code) is str else code
for id_ in range(int(len(code) / 80) + 1):
__data = __data.append(api.to_df(api.get_security_quotes(
[(__select_market_code(x), x) for x in code[80 * id_:80 * (id_ + 1)]])))
__data['datetime'] = datetime.datetime.now()
data = __data[['datetime', 'code', 'open', 'high', 'low', 'price']]
return data.set_index('code', drop=False, inplace=False)
from pytdx.
THX.
正在看这个。主要是关心交易时间内获取BAR数据,要等明天交易时间测试下。
from pytdx.
如果理解没问题,这个可以关闭了。
from pytdx.
@rainx 大大到公司拉
from pytdx.
Related Issues (20)
- 扩展行情的IP都没有可以连接的。 HOT 1
- 扩展行情里面有没有可以获取多个行情quotes的接口?
- get_security_list 请问一下这个是用来获取股票列表的吗? HOT 2
- 请教一下下载的财务数据的 315个列字段的意义问题. HOT 1
- get_security_list这个函数的pre_close有误 HOT 10
- get_security_bars取出来的vol值差了1个 HOT 4
- 跳过的4个字节估计是上一日收盘价
- get_security_list获取的数据中的pre_close有解析正确有些解析不正确 HOT 1
- 不支持美股了?
- AttributeError: __enter__
- 怎么获取行情服务器的IP HOT 1
- 官方文档代码某行缺失 HOT 1
- 请问有办法获取涨停价和跌停价吗 HOT 1
- 可以获取level2的逐笔成交明细吗? HOT 1
- 心跳包还有多线程有没有详细的文档解释? HOT 1
- TdxDailyBarReader() 读取 上海 688 的时候,异常 Unknown security type ! HOT 1
- 盘口价格是不是颠倒了 HOT 1
- exhq.py文件 运行报错 AttributeError: __enter__
- debian python 3.7 get_security_quotes 解析 servertime 报错 HOT 2
- 如何判断股票代码是否指数
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytdx.