Git Product home page Git Product logo

Comments (21)

zcy421593 avatar zcy421593 commented on June 25, 2024 4

@rainx 谢谢,我现在每隔15秒扫描一次所有股票的最新一条分笔,每次耗时大约4秒,已经解决了实时行情获取的需求了

from pytdx.

zfsamzfsam avatar zfsamzfsam commented on June 25, 2024 1

pytdx是最好能够支持推送方式(Pub/Sub)!!!

[推送方式(Pub/Sub)]提供 多进程/多线程 同步大批量获取<Custom股票列表>实时行情的API,将行情分发到MessageQueue(ZeroMQ/nanomsg/nats.io)

参数/配置包括:
	WorkerNum(进程数量)
	ip与port列表(按速度排序)
	板块代码 or Custom股票列表
		<全市场股票>
		<全市场板块指数>
		<全市场期货>
		<...>
		
实时行情数据分发(Pub/Sub)到MessageQueue(ZeroMQ/nanomsg/nats.io)
	一方面用于存储,一方面用做LiveFeed供各种交易平台使用!!!

	最好是先将行情数据按股票设立Topic,分发到各Topic中

from pytdx.

rainx avatar rainx commented on June 25, 2024 1

@rwayan tdx 还有一系列接口,是一次请求返回多次应达的,估计是使用的那个接口.. 和订阅有点类似,不过应答过几次之后需要再次订阅...

from pytdx.

rainx avatar rainx commented on June 25, 2024 1

如果有需要的话,n个连接到不同的服务器肯定是可以做到的..

from pytdx.

yutiansut avatar yutiansut commented on June 25, 2024 1

@doskoi en 这个函数 https://github.com/yutiansut/QUANTAXIS/blob/master/QUANTAXIS/QAFetch/QATdx.py#L291

from pytdx.

rainx avatar rainx commented on June 25, 2024

嗯,目前还没有看到通达信支持推送功能的接口

from pytdx.

yutiansut avatar yutiansut commented on June 25, 2024

这个完全可以自己写 mq的方法各种各样 难道还要作者都给你写一遍?

from pytdx.

zcy421593 avatar zcy421593 commented on June 25, 2024

了解了,非常感谢~如果服务器没有推送功能,就只能自己轮询实现了

from pytdx.

zcy421593 avatar zcy421593 commented on June 25, 2024

@yutiansut 我并不是不会写,只是想知道服务器协议本身是否支持订阅功能罢了。

from pytdx.

rainx avatar rainx commented on June 25, 2024

@zcy421593 好像服务器有一个类似订阅的接口,不过这个订阅好像不能维持太久的时间,而且支持之后,对目前其它的接口的形式会有比较大的影响,所以就不在这里提供了..

from pytdx.

niucool avatar niucool commented on June 25, 2024

@zcy421593 请问有没有出现过数据更新过于频繁导致无法更新或者IP被BLOCK的问题?

from pytdx.

rainx avatar rainx commented on June 25, 2024

@niucool 每隔15秒一次应该问题不大,我现在每隔250毫秒全量获取实时行情也是可以的,不过最好写一下自己的断线重连策略。

from pytdx.

rwayan avatar rwayan commented on June 25, 2024

请问看期货行情的时候,那些价格跳的很快的,这种也不是服务器推送的,也是程序自己请求的吗?

from pytdx.

yutiansut avatar yutiansut commented on June 25, 2024

@rainx 难道是在握手

from pytdx.

rwayan avatar rwayan commented on June 25, 2024

可以通过API monitor之类的程序看到调用过程的吗?

from pytdx.

doskoi avatar doskoi commented on June 25, 2024

我现在每隔250毫秒全量获取实时行情也是可以的,不过最好写一下自己的断线重连策略。

@rainx 请教一下是同时使用n个连接到不同的服务器做到的吗?记得另外的issue提到每次80的限制,如果避免被返回None,每个服务器的频率要比较低才行。

from pytdx.

JaysonAlbert avatar JaysonAlbert commented on June 25, 2024

@doskoi 我试过n个链接到同一个服务器,可以快两倍多的样子,用concurrent.futures.ThreadPoolExecutor实现的,这个是python3.5才有的库。可以参考一下https://github.com/JaysonAlbert/tdx/blob/master/tdx/engine.py。

from pytdx.

yutiansut avatar yutiansut commented on June 25, 2024

concurrent 这么搞这个接口迟早要被封

from pytdx.

JaysonAlbert avatar JaysonAlbert commented on June 25, 2024

没办法,如果不并行的话,最快的ip要3s左右才能拿到全部a股行情。

from pytdx.

yutiansut avatar yutiansut commented on June 25, 2024

我不知道为啥要三秒 我不并行就700ms 并行是180ms

from pytdx.

doskoi avatar doskoi commented on June 25, 2024

@yutiansut 是一个连接然后分批获取所有股票700ms?

from pytdx.

Related Issues (20)

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.