def GET_ALL_SECURITIES(self,filtPaused=True, filtSt=True, filtMarketcap=0):
l_stocks = self.__df_allsecurities__.index.get_values().tolist()
print "l_stocks %s in all", len(l_stocks)
if filtPaused or filtSt or filtMarketcap > 0:
filtresult = []
for s in l_stocks:
isfilted = False
try:
dfreal = ts.get_realtime_quotes(s)
except Exception,e:
print Exception,":",e
dfreal = None
if not dfreal is None and filtPaused:
if float(str(dfreal['volume'][0])) == 0 and float(str(dfreal['bid'][0])) == 0 and float(str(dfreal['ask'][0])) == 0:
isfilted = True
if not dfreal is None and filtSt:
if str(dfreal['name'][0]).find('ST') > -1:
isfilted = True
if filtMarketcap > 0:
outstanding = self.GET_SECURITY_INFO(s)['outstanding']
price = self.GET_CLOSE_DAY(None, s)
markCap = outstanding * price
if markCap > filtMarketcap:
print "security %s isfilted,markCap:%s" % (str(s),str(markCap))
isfilted = True
if isfilted:
print "security %s isfilted" % str(s)
pass
else:
filtresult.append(s)
l_stocks = filtresult
print "l_stocks %s after filter", len(l_stocks)
return l_stocks
# ??????
#security
评论列表
文章目录