Example #1
0
def ai_varWr(qx, fmx0):
    fvar = fmx0 + 'tqvar.pkl'
    mx9 = qx.aiModel
    qx.aiMKeys = list(mx9.keys())
    qx.aiModel = {}
    zt.f_varWr(fvar, qx)
    print('fvar,', fvar)
    #
    for xkey in mx9:
        fss = fmx0 + xkey + '.mx'
        mx9[xkey].save(fss)
        print('fmx,', fss)
    #
    qx.aiModel = mx9
Example #2
0
#
#4 set.bT.var
print('\n#4,set.BT.var')
qx.preFun = zsta.avg01_dpre
qx.preVars = [10]
qx.staFun = zsta.avg01
qx.staVars = [1.1, 1.1]
#
#5 set.bT.var
print('\n#5,call::qx.preFun')
ztq.tq_pools_call(qx, qx.preFun)

#6 save.var
print('\n#6,save.var')
fss = ftg0 + 'x1.pkl'
zt.f_varWr(fss, qx)
qx = zt.f_varRd(fss)
#ztq.tq_prVar(qx)

#-----------step #2,BT-main

# 7
print('\n#7 bt-main')
qx = zbt.bt_main(qx)
#
ztq.tq_prWrk(qx)
zt.prx('\nusrPools', qx.usrPools)

#--------------
#8
print('\n#8 qx.rw')
qx.trd_mode=1
#
qx.usrLevel,qx.trd_nilFlag=5,False
qx.usrMoney0nil=qx.usrMoney0*qx.usrLevel

# 4       
print('\n#4 bt-main')
qx=zbt.bt_main(qx)
#
ztq.tq_prWrk(qx)
zt.prx('\nusrPools',qx.usrPools)  

#--------------
#5
print('\n#5 qx.rw')
fss='tmp/bt-T1x2.pkl';zt.f_varWr(fss,qx)
#qx=zt.f_varRd(fss);#ztq.tq_prVar(qx)

#
#------------ret
#6
print('\n#6 ret')
#
print('\n#6.1 tq_prTrdlib')      
ztq.tq_prTrdlib(qx)
zt.prx('userPools',qx.usrPools)

print('\n#6.2 tq_usrStkMerge')      
df_usr=ztq.tq_usrStkMerge(qx)
zt.prDF('df_usr',df_usr)
Example #4
0
#
#4 set.bT.var
print('\n#4,set.BT.var')
qx.preFun=zsta.avg01_dpre
qx.preVars=[10]
qx.staFun=zsta.avg01
qx.staVars=[1.1,1.1]
#
#5 set.bT.var
print('\n#5,call::qx.preFun')
ztq.tq_pools_call(qx,qx.preFun)

#6 save.var
print('\n#6,save.var')
fss=ftg0+'x1.pkl';zt.f_varWr(fss,qx)
qx=zt.f_varRd(fss);
ztq.tq_prVar(qx)

#------------
#7 chk.dat
print('\n7.1 tq_pools_chk')
ztq.tq_pools_call(qx,ztq.tq_pools_chk)

print('\n#7.2,plot inx -->tmp/tmp_.html')
xinx,df=qx.wrkInxCod,qx.wrkInxDat
hdr,fss='k线图-inx '+xinx,'tmp/tmp_'+xinx+'.html'
df2=df.tail(100)
zdr.drDF_cdl(df2,ftg=fss,m_title=hdr)

print('\n#7.3,plot stk-->tmp/tmp_.html')