Пример #1
0
def gen_kdata_schemas():
    # 股票行情
    gen_kdata_schema(pkg='zvt',
                     providers=['joinquant'],
                     entity_type='stock',
                     levels=[
                         level for level in IntervalLevel
                         if level != IntervalLevel.LEVEL_TICK
                     ],
                     adjust_types=[None, AdjustType.hfq],
                     entity_in_submodule=True)

    # 板块行情
    gen_kdata_schema(pkg='zvt',
                     providers=['eastmoney'],
                     entity_type='block',
                     levels=[
                         IntervalLevel.LEVEL_1DAY, IntervalLevel.LEVEL_1WEEK,
                         IntervalLevel.LEVEL_1MON
                     ],
                     entity_in_submodule=True)

    # etf行情
    gen_kdata_schema(pkg='zvt',
                     providers=['sina'],
                     entity_type='etf',
                     levels=[IntervalLevel.LEVEL_1DAY],
                     entity_in_submodule=True)
    # 指数行情
    gen_kdata_schema(pkg='zvt',
                     providers=['sina'],
                     entity_type='index',
                     levels=[IntervalLevel.LEVEL_1DAY],
                     entity_in_submodule=True)
Пример #2
0
def gen_kdata_schemas():
    # 股票行情
    gen_kdata_schema(pkg='zvt',
                     providers=[Provider.JoinQuant],
                     entity_type=EntityType.Stock,
                     levels=[
                         level for level in IntervalLevel
                         if level != IntervalLevel.LEVEL_TICK
                     ],
                     adjust_types=[None, AdjustType.hfq],
                     entity_in_submodule=True)

    # 板块行情
    gen_kdata_schema(pkg='zvt',
                     providers=[Provider.EastMoney],
                     entity_type=EntityType.Block,
                     levels=[
                         IntervalLevel.LEVEL_1DAY, IntervalLevel.LEVEL_1WEEK,
                         IntervalLevel.LEVEL_1MON
                     ],
                     entity_in_submodule=True)

    # etf行情
    gen_kdata_schema(pkg='zvt',
                     providers=[Provider.Sina],
                     entity_type=EntityType.ETF,
                     levels=[IntervalLevel.LEVEL_1DAY],
                     entity_in_submodule=True)

    # 指数行情
    gen_kdata_schema(
        pkg='zvt',
        providers=[Provider.JoinQuant, Provider.Sina],
        entity_type=EntityType.Index,
        levels=[IntervalLevel.LEVEL_1DAY, IntervalLevel.LEVEL_1WEEK],
        entity_in_submodule=True)
Пример #3
0
# script to auto generate some files

from zvt.contract import IntervalLevel
from zvt.autocode.generator import gen_exports, gen_kdata_schema

if __name__ == '__main__':
    gen_kdata_schema(pkg='zvt_coin',
                     providers=['ccxt'],
                     entity_type='coin',
                     levels=[IntervalLevel.LEVEL_1DAY],
                     adjust_types=[None])
    gen_exports()
Пример #4
0
def gen_kdata_schemas():
    """
    generate kdata(OHLC) schemas for tradable entity

    """
    # A股行情
    gen_kdata_schema(
        pkg="zvt",
        providers=["joinquant", "em"],
        entity_type="stock",
        levels=[level for level in IntervalLevel if level != IntervalLevel.LEVEL_TICK],
        adjust_types=[None, AdjustType.hfq],
        entity_in_submodule=True,
    )
    # 中国期货
    gen_kdata_schema(
        pkg="zvt",
        providers=["em"],
        entity_type="future",
        levels=[IntervalLevel.LEVEL_1DAY],
        entity_in_submodule=True,
    )

    # 美股
    gen_kdata_schema(
        pkg="zvt",
        providers=["em"],
        entity_type="stockus",
        levels=[IntervalLevel.LEVEL_1DAY],
        adjust_types=[None, AdjustType.hfq],
        entity_in_submodule=True,
    )
    # 美指
    gen_kdata_schema(
        pkg="zvt",
        providers=["em"],
        entity_type="indexus",
        levels=[IntervalLevel.LEVEL_1DAY],
        entity_in_submodule=True,
    )

    # 港股
    gen_kdata_schema(
        pkg="zvt",
        providers=["em"],
        entity_type="stockhk",
        levels=[IntervalLevel.LEVEL_1DAY],
        adjust_types=[None, AdjustType.hfq],
        entity_in_submodule=True,
    )

    # 板块行情
    gen_kdata_schema(
        pkg="zvt",
        providers=["em"],
        entity_type="block",
        levels=[IntervalLevel.LEVEL_1DAY, IntervalLevel.LEVEL_1WEEK, IntervalLevel.LEVEL_1MON],
        entity_in_submodule=True,
    )

    # A股指数行情
    gen_kdata_schema(
        pkg="zvt",
        providers=["em", "sina"],
        entity_type="index",
        levels=[IntervalLevel.LEVEL_1DAY, IntervalLevel.LEVEL_1WEEK],
        entity_in_submodule=True,
    )

    # etf行情
    gen_kdata_schema(
        pkg="zvt", providers=["sina"], entity_type="etf", levels=[IntervalLevel.LEVEL_1DAY], entity_in_submodule=True
    )

    # etf行情
    gen_kdata_schema(
        pkg="zvt", providers=["em"], entity_type="currency", levels=[IntervalLevel.LEVEL_1DAY], entity_in_submodule=True
    )
Пример #5
0
def gen_kdata_schemas():
    # A股行情
    gen_kdata_schema(
        pkg="zvt",
        providers=["joinquant", "em"],
        entity_type="stock",
        levels=[
            level for level in IntervalLevel
            if level != IntervalLevel.LEVEL_TICK
        ],
        adjust_types=[None, AdjustType.hfq],
        entity_in_submodule=True,
    )

    # 美股
    gen_kdata_schema(
        pkg="zvt",
        providers=["em"],
        entity_type="stockus",
        levels=[IntervalLevel.LEVEL_1DAY],
        adjust_types=[None, AdjustType.hfq],
        entity_in_submodule=True,
    )

    # 港股
    gen_kdata_schema(
        pkg="zvt",
        providers=["em"],
        entity_type="stockhk",
        levels=[IntervalLevel.LEVEL_1DAY],
        adjust_types=[None, AdjustType.hfq],
        entity_in_submodule=True,
    )

    # 板块行情
    gen_kdata_schema(
        pkg="zvt",
        providers=["em"],
        entity_type="block",
        levels=[
            IntervalLevel.LEVEL_1DAY, IntervalLevel.LEVEL_1WEEK,
            IntervalLevel.LEVEL_1MON
        ],
        entity_in_submodule=True,
    )

    # 指数行情
    gen_kdata_schema(
        pkg="zvt",
        providers=["em", "sina"],
        entity_type="index",
        levels=[IntervalLevel.LEVEL_1DAY, IntervalLevel.LEVEL_1WEEK],
        entity_in_submodule=True,
    )

    # etf行情
    gen_kdata_schema(pkg="zvt",
                     providers=["sina"],
                     entity_type="etf",
                     levels=[IntervalLevel.LEVEL_1DAY],
                     entity_in_submodule=True)
Пример #6
0
# script to auto generate some files

from zvt.contract import IntervalLevel
from zvt.autocode.generator import gen_exports, gen_kdata_schema

if __name__ == '__main__':
    gen_kdata_schema(pkg='zvt_future',
                     providers=['joinquant'],
                     entity_type='future',
                     levels=[IntervalLevel.LEVEL_1DAY],
                     adjust_types=[None])
    gen_exports(dir_path='.')
# the __all__ is generated
__all__ = []