相关标签:
对冲模型策略源码一:runmode:0; holding1:=stkindi(stklabel,\'f1a.持仓\',0,dataperiod,0); holding2:=stkindi(stklabel,\'f2a.持仓\',0,dataperiod,0); targetholding:=holding1+holding2; if holding<> targetholding then begin if holding=0 then begin if targetholding>0 then buy(1,targetholding,limitr,close); if targetholding<0 then buyshort(1,-targetholding,limitr,close); end\\WWW.CXH99.COM if holding>0 then begin if targetholding=0 then sell(1,holding,limitr,close); if targetholding>0 then begin if targetholding>holding then buy(1,targetholding-holding,limitr,close); if targetholding<holding then sell(1,holding-targetholding,limitr,close); end if targetholding<0 then begin sell(1,holding,limitr,close); buyshort(1,targetholding,limitr,close); end end if holding<0 then begin if targetholding=0 then sellshort(1,holding,limitr,close); \\www.cxh99.com if targetholding>0 then begin sellshort(1,holding,limitr,close); buy(1,targetholding,limitr,close); end if targetholding<0 then begin if targetholding>holding then sellshort(1,targetholding-holding,limitr,close); \\www.cxh99.com if targetholding<holding then buyshort(1,holding-targetholding,limitr,close); end end end 点击复制上述代码粘贴到到公式管理器
对冲模型策略源码二:runmode:0; variable:currentholding=0; holding1:=stkindi(stklabel,\'f1a.持仓\',0,dataperiod,0); holding2:=stkindi(stklabel,\'f2a.持仓\',0,dataperiod,0); targetholding:=holding1+holding2; if targetholding=0 then begin if currentholding>0 then sell(1,currentholding,limitr,close); if currentholding<0 then sellshort(1,-currentholding,limitr,close); end \\WWW.CXH99.COM if targetholding>0 then begin if currentholding=0 then buy(1,targetholding,limitr,close); if currentholding>0 then begin if targetholding>currentholding then buy(1,targetholding-currentholding,limitr,close); if targetholding<currentholding then sell(1,currentholding-targetholding,limitr,close); end \\WWW.CXH99.COM if currentholding<0 then begin sellshort(1,-currentholding,limitr,close); buy(1,targetholding,limitr,close); end end if targetholding<0 then begin if currentholding=0 then buyshort(1,-targetholding,limitr,close); if currentholding>0 then begin sell(1,currentholding,limitr,close); buyshort(1,-targetholding,limitr,close); end if currentholding<0 then begin if targetholding>currentholding then sellshort(1,targetholding-currentholding,limitr,close); if targetholding<currentholding then buyshort(1,currentholding-targetholding,limitr,close); end end currentholding:=targetholding; 仓位:holding,noaxis,linethick0; 收益:asset-500000,noaxis,colormagenta,linethick2; 点击复制上述代码粘贴到到公式管理器
{别忘了将本网告诉您身边的朋友,向朋友传达有用资料,也是一种人情,你朋友会感谢你的。}
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)