数据采集20200618(可转债折溢价)

#可转债折溢价

BDate=’20200601′

EDate=’20200630′

calendar=DataAPI.TradeCalGet(exchangeCD=u”XSHG”,beginDate=BDate,endDate=EDate,field=u””,pandas=”1″)

calendar=calendar[calendar.isOpen==1][calendar.isWeekEnd==1]#只取周末日期

factor_list=[]

for tdate in calendar.calendarDate.values:#拿到因子数据,遍历每一天

kzzyj=DataAPI.MktConsBondPremiumGet(SecID=u””,tickerBond=u””,beginDate=tdate,endDate=tdate,

field=u”tickerBond,tradeDate,bondPremDisc”,pandas=”1″)

table={‘tradeDate’:([tdate]),’MBPD’:([np.median(kzzyj.bondPremDisc)])}

DF=pd.DataFrame(table)

factor_list.append(DF)

MBPD=pd.concat(factor_list)

MBPD.head(70)

MBPD tradeDate
0 20.35490 2020-06-05
0 19.69165 2020-06-12
0 1.00000 2020-06-19
0 1.00000 2020-06-24

Leave a Reply

邮箱地址不会被公开。 必填项已用*标注