相关标签:阿里云红包购物专区,阿里云红包专区,突破交易策略,惠比特交易和配种专区,梦三国交易专区,梦三国交易专区速秒,灵缇格力交易专区,中京交易市场下载专区,古币银元交易专区,
模型策略源码:runmode:0; variable:longtrade=0; variable:shorttrade=0; variable:stopline=0; predayhigh:=callstock(stklabel,vthigh,6,-1); predaylow:=callstock(stklabel,vtlow,6,-1); predayrange:=(predayhigh-predaylow)*0.5; predayrange:=round(predayrange/mindiff)*mindiff; dayopen:=callstock(stklabel,vtopen,6,0); trailingstop:=predayrange; dist:=barslast(date>ref(date,1))+1; myentrytime:=time<=145500; myexittime:=time>=150000; upperband:=ref(hhv(high,dist),1); lowerband:=ref(llv(low,dist),1); hh:=ref(high,1); ll:=ref(low,1); if holding=0 then begin if myentrytime and dayopenpredaylow then begin if high>=predayhigh and longtrade=0 then begin buy(1,1,limitr,max(open,predayhigh)); longtrade:=1; end if low<=predaylow and shorttrade=0 then begin buyshort(1,1,limitr,min(open,predaylow)); shorttrade:=1; end end if myentrytime and dayopen>=predayhigh then begin if dist>=4 and high>=upperband and longtrade=0 then begin buy(1,1,limitr,max(open,upperband)); longtrade:=1; end end if myentrytime and dayopen<=predaylow then begin if dist>=4 and low<=lowerband and shorttrade=0 then begin buyshort(1,1,limitr,min(open,lowerband)); shorttrade:=1; end end end if holding>0 and enterbars>=1 then begin myexitprice:=0; if stopline=0 then stopline:=enterprice-trailingstop; if hh-trailingstop>stopline then stopline:=hh-trailingstop; if low<=stopline then myexitprice:=min(open,stopline); if myexittime then myexitprice:=close; if myexitprice>0 then begin sell(1,holding,limitr,myexitprice); stopline:=0; end end if holding<0 and enterbars>=1 then begin myexitprice:=0; if stopline=0 then stopline:=enterprice+1000; if ll+trailingstop stopline:=ll+trailingstop; if high>=stopline then myexitprice:=max(open,stopline); if myexittime then myexitprice:=close; if myexitprice>0 then begin sellshort(1,holding,limitr,myexitprice); stopline:=0; end end if myexittime then begin longtrade:=0; shorttrade:=0; end 盈亏:asset-500000,noaxis,coloryellow,linethick2; 点击复制上述代码粘贴到到公式管理器
{别忘了将本网告诉您身边的朋友,向朋友传达有用资料,也是一种人情,你朋友会感谢你的。}