Exemplo n.º 1
0
def get_dominant_future(jqSecurityName=None, jqSecurityXChg=None, jqDataAccount='13268108673', jqDataPassword='******'):
    jqdatasdk.auth(jqDataAccount, jqDataPassword)
    str = jqSecurityName + '8888.' + jqSecurityXChg
    ret = jqdatasdk.get_dominant_future(str, getYMD())
    if ret == '':
        ret = jqdatasdk.get_dominant_future('RB9999.XSGE', getYMD())
    return ret
Exemplo n.º 2
0
def downloadDonmainMinuteBar():
    jqdatasdk.auth(JQDATA_USER, JQDATA_PASSWORD)
    """下载所有配置中的合约的分钟线数据"""
    print('-' * 50)
    print(u'开始下载合约分钟线数据')
    print('-' * 50)

    today = datetime.today().date()

    trade_date_list = jqdatasdk.get_trade_days(end_date=today, count=3)

    #symbols_df = jqdatasdk.get_all_securities(types=['futures'], date=today)
    symbols_df = jqdatasdk.get_dominant_future('AG', '2018-09-30')  #jinsong
    downMinuteBarBySymbol("RB9999.XSGE", {'name': 'RB9999.XSGE'.split('.')[0]},
                          str(today), str(trade_date_list[-2]))

    print('-' * 50)
    print(u'合约分钟线数据下载完成')
    print('-' * 50)
    return
Exemplo n.º 3
0
    def get_all_domain():
        """ stk_code, display_name """

        futures_all = jq.get_all_securities(types=['futures'])
        stk_all_mf = futures_all.loc[futures_all.apply(
            lambda x: NlReFilter.filter_num_from_str(x['name']) in ['9999'],
            axis=1), :]

        # 将主力转为实际
        for idx in stk_all_mf.index:

            name_str = stk_all_mf.loc[idx, 'name']

            if NlReFilter.filter_num_from_str(name_str) == '9999':
                dmt = jq.get_dominant_future(
                    NlReFilter.filter_letter_from_str(name_str))
                stk_all_mf.loc[
                    idx,
                    'display_name'] = stk_all_mf.loc[idx, 'display_name'] + dmt
                stk_all_mf.loc[idx, 'dominant'] = dmt

        stk_all_mf.loc[:, 'stk_code'] = stk_all_mf.index
        return stk_all_mf
Exemplo n.º 4
0
def get_dominant_future(jqSecurity=None,
                        jqDataAccount='13268108673',
                        jqDataPassword='******'):
    jqdatasdk.auth(jqDataAccount, jqDataPassword)
    return jqdatasdk.get_dominant_future(jqSecurity[0:2], getYMD())
Exemplo n.º 5
0
def get_dominant_future(*args, **kwargs):
    return jqdatasdk.get_dominant_future(*args, **kwargs)
Exemplo n.º 6
0
 def getDominantFuture(self, p, tday):
     return jq.get_dominant_future(p, tday)