Exemplo n.º 1
0
def get_financial_index(symbol, t_begin, t_end):
    if len(t_begin) < 10:
        t_begin = t_begin + ' 00:00:00'
    if len(t_end) < 10:
        t_end = t_end + ' 15:00:00'
    var = md.get_financial_index(symbol, t_begin, t_end)
    var = to_pd(var, 'pub_date')
    return var
Exemplo n.º 2
0
def get_financial_index(symbol, t_begin, t_end):
    if len(t_begin) < 10 :
        t_begin = t_begin + ' 00:00:00'
    if len(t_end) < 10 :
        t_end = t_end + ' 15:00:00'
    var =md.get_financial_index(symbol, t_begin, t_end)
    var =to_pd(var,'pub_date')
    return var
Exemplo n.º 3
0
print('get_last_n_dailybars(10): ', len(r))

#提取交易代码
r = md.get_instruments('SHSE', 1, 1)
print('get_instruments: ', len(r))

#根据期货品种提取交易代码
r = md.get_instruments_by_name('ag')
print('get_instruments_by_name', len(r))

#提取指数的成分股代码
r = md.get_constituents('SHSE.000001')
print('get_constituents', len(r))

#按时间周期提取FinancialIndex
r = md.get_financial_index('SHSE.600000', '2010-12-01 09:30:00', '2016-01-08 12:00:00')
print('get_financial_index', len(r))

#提取快照, 即最新的FinancialIndex
r = md.get_last_financial_index('SHSE.600000,SZSE.000001')
print('get_last_financial_index', len(r))

#提取最近n条FinancialIndex
r = md.get_last_n_financial_index('SHSE.600000', 5)
print('get_last_n_financial_index', len(r))

#按时间周期提取ShareIndex
r = md.get_share_index('SHSE.600000', '2015-12-01 09:30:00', '2016-01-08 12:00:00')
print('get_share_index', len(r))

#提取快照, 即最新的ShareIndex
Exemplo n.º 4
0
def get_financial_index(symbol, begin_datetime,end_datetime): # 基本财务指标
    t_begin = begin_datetime.strftime('%Y-%m-%d') +' 00:00:00'
    t_end   = end_datetime.strftime('%Y-%m-%d') + ' 15:00:00'
    var =md.get_financial_index(symbol, t_begin,t_end)
    var =to_pd(var,'pub_date')
    return var