相关标签:网格交易法,趋势网格交易法,股票网格交易法,趋势使用网格交易法,趋势 网格交易系统,外汇网格交易,飞狐 网格交易,惠比特交易和配种专区,梦三国交易专区,
模型策略源码:input:grid(3,1,60,1); variable:level=0; dist:=barslast(date<>ref(date,1)); oo:=ref(open,dist); if holding=0 then begin dnprice:=oo-grid*mindiff; if low<=dnprice then begin buy(1,1,limitr,dnprice); level:=-1; end end if holding=0 then begin upprice:=oo+grid*mindiff; if high>=upprice then begin buyshort(1,1,limitr,upprice); level:=1; end end if holding>0 then begin upprice:=oo+(level+1)*grid*mindiff; dnprice:=oo+(level-1)*grid*mindiff; if high>=upprice then begin sell(1,1,limitr,upprice); level:=level+1; end if low<=dnprice then begin buy(1,1,limitr,dnprice); level:=level-1; end if time=closetime(0) then sell(1,holding,limitr,close); end if holding<0 then begin upprice:=oo+(level+1)*grid*mindiff; dnprice:=oo+(level-1)*grid*mindiff; if low<=dnprice then begin sellshort(1,1,limitr,dnprice); level:=level-1; end if high>=upprice then begin buyshort(1,1,limitr,upprice); level:=level+1; end if time=closetime(0) then sellshort(1,holding,limitr,close); end 盈亏:asset,noaxis,colormagenta; 收益:(asset-50000)/50000,linethick0; 次数:totaltrade,linethick0; 胜率:percentwin,linethick0; 连亏:maxseqloss,linethick0; 连赢:maxseqwin,linethick0; 点击复制上述代码粘贴到到公式管理器
{别忘了将本网告诉您身边的朋友,向朋友传达有用资料,也是一种人情,你朋友会感谢你的。}