print(stock_path)
    frequence = '60min'

    blockname = [
        'MSCI中国', 'MSCI成份', 'MSCI概念', '三网融合', '上证180', '上证380', '沪深300',
        '上证380', '深证300', '上证50', '上证电信', '电信等权', '上证100', '上证150', '沪深300',
        '中证100', '中证500', '全指消费', '中小板指', '创业板指', '综企指数', '1000可选', '国证食品',
        '深证可选', '深证消费', '深成消费', '中证酒', '中证白酒', '行业龙头', '白酒', '证券', '消费100',
        '消费电子', '消费金融', '富时A50', '银行', '中小银行', '证券', '军工', '白酒', '啤酒', '医疗器械',
        '医疗器械服务', '医疗改革', '医药商业', '医药电商', '中药', '消费100', '消费电子', '消费金融', '黄金',
        '黄金概念', '4G5G', '5G概念', '生态农业', '生物医药', '生物疫苗', '机场航运', '数字货币', '文化传媒'
    ]
    blockname = list(set(blockname))
    stocklists = QA.QA_fetch_stock_block_adv().get_block(blockname).code
    print('批量评估板块成分股:{} Total:{}'.format(blockname, len(stocklists)))
    stocklists = jqapi.normalize_code(stocklists)

    for year in range(2017, 2005, -1):
        last_query_count = get_query_count()
        print(u'剩余可查询条数', last_query_count)

        start_date = '{}-01-01'.format(year)
        end_date = '{}-01-02'.format(year + 1)
        for asset in stocklists:
            if (last_query_count['spare'] < 1280):
                print(u'剩余查询条数已经不足,退出行情查询抓取...')
                break

            print(
                asset,
                start_date,
        '515000',
        '510900',
        '512910',
        '513050',
        '510300',
        '399384',
        '510810',
        '399987',
        '159905',
        '399396',
        '399997',
        '159919',
        '159941',
        '159920',
    ]
    indexlist = jqapi.normalize_code(indexlist)
    code = indexlist[0]

    # 创建数据下载目录
    frequence = '60min'
    index_path = mkdirs(
        os.path.join(mkdirs('datastore'), 'kline', 'index', frequence))
    print(index_path)

    for year in range(2017, 2005, -1):
        start_date = '{}-01-01'.format(year)
        end_date = '{}-01-02'.format(year + 1)
        for asset in indexlist:
            print(
                asset,
                start_date,
Ejemplo n.º 3
0
 def normalize_code(self, code: str):
     return jq_api.normalize_code(code)