Giter Club home page Giter Club logo

Comments (3)

scanfyu avatar scanfyu commented on May 14, 2024

A new plugin for zvt, see https://github.com/scanfyu/zvt-tushare.

from zvt.

foolcage avatar foolcage commented on May 14, 2024

@scanfyu
建议实现步骤
1)复用Stock entity,只是添加tushare provider
加上这句:

register_schema(providers=['joinquant', 'eastmoney', 'exchange', 'sina','tushare'], db_name='stock_meta',
                schema_base=StockMetaBase)

这样其他人安装zvt-tushare,获得tushare数据的能力,其他模块直接复用
2)其他数据属于entity event
参考
https://zvtvz.github.io/zvt/#/data_extending
https://github.com/zvtvz/zvt-ccxt

然后就是重复以下步骤

  • 定义domain

  • 根据provider提供的api,决定如何使用evaluate_start_end_size_timestamps

from zvt.

foolcage avatar foolcage commented on May 14, 2024

@scanfyu

这里我是在domain下边新建一个meta并继承stock_meta还是说直接在domain下建立stock_meta并继承啊?

两种方案
1)
请使用zvt0.8.5以上版本,参考代码
https://github.com/zvtvz/zvt/blob/master/tests/contract/test_add_provider_plugin.py

可以不重新建meta,只是在domain的__init__里面执行如下语句:

    from zvt.contract.register import register_schema
    from zvt.domain.meta.stock_meta import StockMetaBase

    register_schema(providers=['tushare'], db_name='stock_meta',
                    schema_base=StockMetaBase)

这样便注册了tushare provider,并创建了相应的数据库

2)自己新定义一种entity,比如TushareStock

这样Factor,StockTrader,get_kdata等如果要使用Tushare的entity数据,entity schema需要重新指定,问题不大。

推荐使用方法一,尽可能复用现在的代码。
Entity只是提供标的的列表功能和一些组合,主要还是其他数据。

from zvt.

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.