以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://222.73.7.161/bbs/index.asp) -- 公式模型编写问题提交 (http://222.73.7.161/bbs/list.asp?boardid=4) ---- 范围内找点 (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=144400) |
-- 作者:曹晓东 -- 发布时间:2016/12/9 10:25:44 -- 范围内找点 a1:=ma(c,10); PARTLINE(a1>=ref(a1,1),a1,colorred,2); PARTLINE(a1<ref(a1,1),a1,colorgreen,2); a2:=ma(c,22); PARTLINE(a2>=ref(a2,1),a2,colorred,3); PARTLINE(a2<ref(a2,1),a2,colorgreen,3); a3:=ma(c,10)>=ref(ma(c,10),1) and ma(c,22)>=ref(ma(c,22),1); a8:=ma(c,10)<ref(ma(c,10),1) and ma(c,22)<ref(ma(c,22),1); variable:n=0,m=0; mm:=ref(h,1)=hhv(h,3); nn:=ref(l,1)=llv(l,3); variable:bj=0; variable:dt=0,kt=0; mm:=ref(h,1)=hhv(h,3); nn:=ref(l,1)=llv(l,3); if mm then bj:=1; if nn then bj:=-1; nn1:=barslast(mm); nn2:=barslast(nn); if c<ref(l,nn1+1) and bj=1 then i:=1; if c>ref(h,nn2+1) and bj=-1 then i:=-1; uu3:=cross(i=1,0.5); uu4:=cross(i=-1,0.5); if uu3 or ((ref(c,1)>ref(o,1) and h>ref(h,1) and c<ref(l,1))) or (ref(h,1)=hhv(h,3) and c<ref(l,1)) or c<ref(l,barslast(c>o)) or c<ref(l,1) then begin n:=0; m:=m+1; end //m为绿色 if uu4 or (ref(l,1)=llv(l,3) and c>ref(h,1)) or ((ref(o,1)>ref(c,1) and l<ref(l,1) and c>ref(h,1))) or c>ref(h,barslast(c<o)) or c>ref(h,1) then begin n:=n+1; m:=0; end //n为红色 STICKLINE(cross(m,0.5),o,CLOSE,7.5,0),COLORgreen; STICKLINE(cross(n,0.5),o,c,7.5,0),COLORred; x1:=cross(m,0.5); x2:=cross(n,0.5); 通过代码,把“x1”与“x2”之间的最高最低点找出来。谢谢
|
-- 作者:jinzhe -- 发布时间:2016/12/9 13:47:51 -- n1:=barslast(x1); n2:=barslast(x2); valuewhen(x1,hhv(h,n2+1)); valuewhen(x1,llv(l,n2+1)); 高低点如上所写 |