资源预览内容
亲,该文档总共1页全部预览完了,如果喜欢就下载吧!
资源描述
/定义参数Input:N(81,1,100,10),P1(14,2,40,4),P2(14,2,40,4),P3(36,10,100,2);/中间变量Variable:ls=0,Gl=0,Dl=0;Num:=2;Em:Ema(Close,34);/收盘价34期EMASm:Sma(Close,8,1);/收盘价8期SMARsv:=(Close-Llv(Low,N)/(Hhv(High,N)-Llv(Low,N)*100;K:Sma(RSV,P1,1),NOAXIS;D:Sma(K,P2,1),noaxis;Tp:=Valuewhen(Cross(k,d),High);/KD交叉时对应高点Gj:=Valuewhen(H=HHV(High,P3),High);/前一轮行情最高价Cond4:=Barslast(H=HHV(High,P3);/前一轮行情高点到现在的周期数Dj:=Llv(Low,Cond4);/前一轮行情最低价Cond1:=SmEm;Cond2:=Cross(K,D);/K、D交叉Cond3:=Barslast(COND2)Tp;/KD交叉以后四个周期内,价格突破BuyCond:Cond1 And KD And Cond3 ;/开仓条件/下单语句If BuyCond And Holding=0 Then Begin Buy(1,Num,Market); Gl:=Gj;/开仓时前一轮行情高价 Dl:=Dj;/开仓时前一轮最低价 ls:=Gl-Dl;/区间幅度 End/幅度止损部分If Enterprice=Gl And Close=Dl+0.786*ls And Enterprice=Gl And Close=Dl+0.5*ls And Enterprice=Dl+0.786*ls And Close=Dl+0.236*ls And EnterpriceDl+0.5*ls And Close=Dl+1.272*ls Then Sell(1,Intpart(Num/2),Market);If Close=Dl+1.618*ls Then Sell(1,0,Market);
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号