tushare69ds.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:zStock 作者: superxhy 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号