def bt_endRets(qx): # ---ok ,测试完毕 # 保存测试数据,qxlib,每日收益等数据;xtrdLib,交易清单数据 # qx.qxLib=qx.qxLib.round(4) qx.qxLib.to_csv(qx.fn_qxLib, index=False, encode='utf-8') qx.xtrdLib.to_csv(qx.fn_xtrdLib, index=False, encode='utf-8') # qx.prQLib() # # -------计算交易回报数据 zwx.zwRetTradeCalc(qx) zwx.zwRetPr(qx) # -------绘制相关图表,可采用不同的模板 # 初始化绘图模板:dr_quant3x zwdr.dr_quant3x_init(qx, 12, 8) # 设置相关参数 xcod = zw.stkLibCode[0] # ma1='ma_%d' %qx.staVars[0] ksgn, ksgn2 = qx.priceWrk, 'vwap' kmid8 = [[xcod, ksgn, ksgn2]] # 绘图 zwdr.dr_quant3x(qx, xcod, 'val', kmid8, 'cuban') # 可设置,中间图形窗口的标识 # qx.pltMid.legend([]); # print('') print('每日交易推荐') print('::xtrdLib', qx.fn_xtrdLib) print(qx.xtrdLib.tail())
def bt_endRets(qx): #---ok ,测试完毕 # 保存测试数据,qxlib,每日收益等数据;xtrdLib,交易清单数据 #qx.qxLib=qx.qxLib.round(4) qx.qxLib.to_csv(qx.fn_qxLib, index=False, encode='utf-8') qx.xtrdLib.to_csv(qx.fn_xtrdLib, index=False, encode='utf-8') qx.prQLib() # #-------计算交易回报数据 zwx.zwRetTradeCalc(qx) zwx.zwRetPr(qx) #-------绘制相关图表,可采用不同的模板 # 初始化绘图模板:dr_quant3x zwdr.dr_quant3x_init(qx, 12, 8) # 设置相关参数 xcod = zw.stkLibCode[0] ksgn = qx.priceBuy #xcod='glng';ksgn=qx.priceBuy; #kmid8=[['aeti',ksgn],['egan',ksgn],['glng',ksgn,'ma_5','ma_30'],['simo',ksgn,'ma_5','ma_30']] ma1 = 'ma_%d' % qx.staVars[0] ma2 = 'ma_%d' % qx.staVars[1] kmid8 = [[xcod, qx.priceWrk, ma1, ma2]] # 绘图 zwdr.dr_quant3x(qx, xcod, 'val', kmid8, '')
def bt_endRets(qx): #---ok ,测试完毕 # 保存测试数据,qxlib,每日收益等数据;xtrdLib,交易清单数据 #qx.qxLib=qx.qxLib.round(4) qx.qxLib.to_csv(qx.fn_qxLib, index=False, encode='utf-8') qx.xtrdLib.to_csv(qx.fn_xtrdLib, index=False, encode='utf-8') qx.prQLib() # #-------计算交易回报数据 zwx.zwRetTradeCalc(qx) zwx.zwRetPr(qx) #-------绘制相关图表,可采用不同的模板 # 初始化绘图模板:dr_quant3x zwdr.dr_quant3x_init(qx, 12, 8) # 设置相关参数 xcod = zw.stkLibCode[0] ksgn = qx.priceBuy #xcod='glng';ksgn=qx.priceBuy; #kmid8=[['aeti',ksgn],['egan',ksgn],['glng',ksgn,'ma_5','ma_30'],['simo',ksgn,'ma_5','ma_30']] kmid8 = [[xcod, ksgn, 'xhigh', 'xlow']] # 绘图 zwdr.dr_quant3x(qx, xcod, 'val', kmid8, '') # 可设置,中间图形窗口的标识 #qx.pltMid.legend([]); # print('') print('每日交易推荐') print('::xtrdLib', qx.fn_xtrdLib) print(qx.xtrdLib.tail())
def bt_endRets(qx): # ---ok ,测试完毕 # 保存测试数据,qxlib,每日收益等数据;xtrdLib,交易清单数据 # qx.qxLib=qx.qxLib.round(4) qx.qxLib.to_csv(qx.fn_qxLib, index=False, encode='utf-8') qx.xtrdLib.to_csv(qx.fn_xtrdLib, index=False, encode='utf-8') qx.prQLib() # # -------计算交易回报数据 zwx.zwRetTradeCalc(qx) zwx.zwRetPr(qx) # -------绘制相关图表,可采用不同的模板 # 初始化绘图模板:dr_quant3x zwdr.dr_quant3x_init(qx, 12, 8); # 设置绘图相关参数 xcod = 'glng'; ksgn = qx.priceBuy; kmid8 = [['aeti', ksgn], ['egan', ksgn], ['glng', ksgn, 'ma_5', 'ma_30'], ['simo', ksgn, 'ma_5', 'ma_30']] # 绘图 zwdr.dr_quant3x(qx, xcod, 'val', kmid8, '<xcod>') # 可设置,中间图形窗口的标识 # qx.pltMid.legend([]); # qx.prTrdLib()
def bt_endRets(qx): #---ok ,测试完毕 # 保存测试数据,qxlib,每日收益等数据;xtrdLib,交易清单数据 #qx.qxLib=qx.qxLib.round(4) qx.qxLib.to_csv(qx.fn_qxLib,index=False,encode='utf-8') qx.xtrdLib.to_csv(qx.fn_xtrdLib,index=False,encode='utf-8') qx.prQLib() # #-------计算交易回报数据 zwx.zwRetTradeCalc(qx) zwx.zwRetPr(qx) #-------绘制相关图表,可采用不同的模板 # 初始化绘图模板:dr_quant3x zwdr.dr_quant3x_init(qx,12,8); # 设置相关参数 xcod=zw.stkLibCode[0]; #ma1='ma_%d' %qx.staVars[0] ksgn,ksgn2,ksgn3,ksgn4,ksgn5=qx.priceWrk,'boll_up','boll_low','boll_ma','boll_std' kmid8=[[xcod,ksgn,ksgn2,ksgn3,ksgn4,ksgn5]] # 绘图 zwdr.dr_quant3x(qx,xcod,'val',kmid8,'')