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)
评论列表
文章目录