相關標簽:網格交易法,趨勢網格交易法,股票網格交易法,趨勢使用網格交易法,趨勢 網格交易系統,外匯網格交易,飛狐 網格交易,惠比特交易和配種專區,夢三國交易專區,
模型策略源碼: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; 點擊復制上述代碼粘貼到到公式管理器
{別忘了將本網告訴您身邊的朋友,向朋友傳達有用資料,也是一種人情,你朋友會感謝你的。}