Pankou.py 文件源码

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

项目:sogaQuant 作者: idoplay 项目源码 文件源码
def daily_open(self):
        # ????memcache python realtime.py daily_open 2
        today = self.tools.d_date('%Y%m%d')
        mcache = memcache.Client(['127.0.0.1:11211'])
        #today = 20160725
        #_hash2 = "%s==black_list" % today

        ax = self.mysql.getRecord("select * from s_stock_list where dateline=%s " % today)
        black_list = {}
        for i in range(0, len(ax)):
            ms = re.findall(re.compile(r'\*|N|ST|??|??'), ax[i]['name'])
            if ax[i]['run_market'] > 40000000000 or ax[i]['listing_date'] == 0 or ms:
                black_list[ax[i]['s_code']] = 1

            _hash = "%s==%s" % (today, ax[i]['s_code'])
            has = mcache.get(_hash)
            if has:
                continue

            _top = float(ax[i]['last_close']) * 1.1
            _bottom = float(ax[i]['last_close']) * 0.9
            d = {'open': ax[i]['open'], 'last_close': ax[i]['last_close'], 's_code': ax[i]['s_code'], 'top': _top, 'bottom': _bottom}
            mcache.set(_hash, d, 66400)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号