?
?來(lái)源: CXH99.COM
?#篩選非停牌且eps大于0的票
??????? for i in context.code:
??????????? close = history_bars(i, 1, '1d','close')
??????????? temp = fin_indicator(i,'EPS',1,0,0)
??????????? if len(close)>0 and temp[-1]>0:
??????????????? code.append(i)
??????? #轉(zhuǎn)換成市盈率
??????? for j in code:
??????????? close = history_bars(j, 1, '1d','close')
??????????? temp = fin_indicator(j,'EPS',1,0,0)
??????????? pe.append(close[-1]/temp[-1])
??????? pe_ra = np.array(pe)
??????? #對(duì)pe進(jìn)行排序,buy_list是排名前幾的股票列表
??????? sort = np.argsort(pe_ra)
??????? code = np.array(code)
??????? buy_list = code[[sort[:context.num]]]
??????? sell_num = 0
?
?
歷史數(shù)據(jù)和深度財(cái)務(wù)數(shù)據(jù)是否有補(bǔ)充,如果沒(méi)有數(shù)據(jù)那么是測(cè)不到的。另外代碼里你可以加入一些print看下篩選非停牌且eps大于0的票這個(gè)動(dòng)作后的code列表是有哪些品種
?