Git Product home page Git Product logo

Comments (7)

rainx avatar rainx commented on July 4, 2024 2

@yutiansut 嗯,一般8点多到

from pytdx.

rainx avatar rainx commented on July 4, 2024 1

@Solensolen 基本上理解的正确把,但是start=0代表从当前时间点能获取的最近的一个bar开始计算的,至于对于日k线来说是不是昨天,根据交易日休市等的情况还有所不同...

from pytdx.

yutiansut avatar yutiansut commented on July 4, 2024

咦 我之前写过 不过实时的用quotes就可以了 不用bar

from pytdx.

yutiansut avatar yutiansut commented on July 4, 2024

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.

solenbanson avatar solenbanson commented on July 4, 2024

THX.
正在看这个。主要是关心交易时间内获取BAR数据,要等明天交易时间测试下。

from pytdx.

solenbanson avatar solenbanson commented on July 4, 2024

如果理解没问题,这个可以关闭了。

from pytdx.

yutiansut avatar yutiansut commented on July 4, 2024

@rainx 大大到公司拉

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.