代码拉取完成,页面将自动刷新
同步操作将从 macroan/traderStock-gui 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#coding=utf-8
import os
import getGlobalVar
import config
g_order_id = 0
def get_orderid():
global g_order_id
g_order_id += 1
return g_order_id
def set_orderid():
global g_order_id
if os.path.exists('./output/maxorderid.txt') and os.path.getsize('./output/maxorderid.txt') > 0:
f = open('./output/maxorderid.txt', 'w')
try:
g_order_id = f.read()
finally:
f.close()
def save_orderid():
global g_order_id
f = open('./output/maxorderid.txt', 'w')
f.write(g_order_id)
f.flush()
f.close()
def setprogressbar(ret):
window = getGlobalVar.getWindow()
if window:
cur = window.progressBar.value()
if ret > cur:
window.progressBar.setValue(ret)
if ret < window.progressBar.maximum():
window.labelret.setText('计算中。。。')
else:
window.labelret.setText('计算完毕!!!')
def cls_progressbar():
window = getGlobalVar.getWindow()
if window:
window.progressBar.setValue(0)
window.labelret.setText('')
def init_succ_var():
meettotalCount = 0
meettotal = {day:{'totalrate':0, 'successcount':0} for day in config.ZF_DAY}
return meettotalCount, meettotal
def compute_succ_zf(df, target, meettotalCount, meettotal):
meettotalCount += 1
taggetclose = df.iloc[target]['close']
for day in config.ZF_DAY:
if (target - day) > -1:
meettotal[day]['totalrate'] += (df.iloc[target-day]['close']-taggetclose)/taggetclose*100
if df.iloc[target-day]['close'] > taggetclose:
meettotal[day]['successcount'] += 1
return meettotalCount
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。