创新黄金分割: N:=SYSPARAM(3)-SYSPARAM(1)+10; A:=BACKSET(ISLASTBAR,HHVBARS(H,N)+1); B:=COUNT(A,N)=1; 前高:=IF(N>0,REF(H,BARSLAST(B)),0),COLORWHITE; A2:=BACKSET(ISLASTBAR,LLVBARS(L,N)+1); B2:=A2>REF(A2,1); 前低:=REF(L,BARSLAST(B2)),COLORWHITE; hh:= 前高; ll:= 前低; HL:=hh-ll; wH := BARSLAST(H=hh); wL :=BARSLAST(L=ll); K := wH-wL; a2 :=IF(k<0,hh- HL*0.382,ll+HL*0.382); a3 :=IF(k<0,hh- HL*0.618,ll+HL*0.618); mHL:= hh-HL*0.5; A := ISLASTBAR; DRAWTEXT(A AND K<>3, a2,NUMTOSTR(a2,2)+ '\n F3'),ALIGN2,COLORYELLOW; DRAWTEXT(A AND K<>3, a3, NUMTOSTR(a3,2)+'\n F5'),ALIGN2,COLORYELLOW; HH:=SYSPARAM(4); LL:=SYSPARAM(5); P16:=(LL + ((HH - LL) * 0.618)); P17:=(LL + ((HH - LL) * 0.382)); DRAWTEXT(DATACOUNT-BARPOS+1=20,P17, NUMTOSTR(P17,2)+'\n F3'),ALIGN2,colorff; DRAWTEXT(DATACOUNT-BARPOS+1=20,P16, NUMTOSTR(P16,2)+'\n F5'),ALIGN2,colorff; P16:=(HH - ((LL + HH) * 0.382)); P17:=(HH - ((LL + HH) * 0.191)); DRAWTEXT(DATACOUNT-BARPOS+1=20,P17, NUMTOSTR(P17,2)+'\n F3'),ALIGN2,colormagenta; DRAWTEXT(DATACOUNT-BARPOS+8=20,P16, NUMTOSTR(P16,2)+'\n F5'),ALIGN2,colormagenta; HH:=SYSPARAM(6); LL:=SYSPARAM(5); P18:=(LL + ((HH - LL) * 1.618)); P19:=(LL + ((HH - LL) * 1)); P20:=(LL + ((HH - LL) * 0.618)); DRAWTEXT(DATACOUNT-BARPOS+1=40,P18, NUMTOSTR(P18,2)+'\n xop'),color99FF; DRAWTEXT(DATACOUNT-BARPOS+1=40,P19, NUMTOSTR(P19,2)+'\n op'),color99FF; DRAWTEXT(DATACOUNT-BARPOS+1=40,P20, NUMTOSTR(P20,2)+'\n cop'),color99FF; P18:=(HH + ((LL - HH) * 1.618)); P19:=(HH + ((LL - HH) * 1)); P20:=(HH + ((LL - HH) * 0.618)); DRAWTEXT(DATACOUNT-BARPOS+8=40,P18, NUMTOSTR(P18,2)+'\n xop'),Color00FF00; DRAWTEXT(DATACOUNT-BARPOS+1=40,P19, NUMTOSTR(P19,2)+'\n op'),Color00FF00; DRAWTEXT(DATACOUNT-BARPOS+1=40,P20, NUMTOSTR(P20,2)+'\n cop'),Color00FF00; A:=BACKSET(ISLASTBAR,HHVBARS(H,N)+1); B:=COUNT(A,N)=1; 前高:=IF(N>0,REF(H,BARSLAST(B)),0),COLORWHITE; A2:=BACKSET(ISLASTBAR,LLVBARS(L,N)+1); B2:=A2>REF(A2,1); 前低:=REF(L,BARSLAST(B2)),COLORWHITE; hh:= 前高; ll:= 前低; HL:=hh-ll; wH := BARSLAST(H=hh); wL :=BARSLAST(L=ll); K := wH-wL; a1 :=IF(k<0,hh- HL*1.618,ll+HL*1.618); a2 :=IF(k<0,hh- HL*1,ll+HL*1); a3 :=IF(k<0,hh- HL*0.618,ll+HL*0.618); mHL:= hh-HL*0.5; A := ISLASTBAR; DRAWTEXT(A AND K<>3, a1, NUMTOSTR(a1,2)+'\n xop:'),ALIGN2,colormagenta; DRAWTEXT(A AND K<>3, a2,NUMTOSTR(a2,2)+ '\n op:'),ALIGN2,colormagenta; DRAWTEXT(A AND K<>3, a3, NUMTOSTR(a3,2)+'\n cop::'),ALIGN2,colormagenta; 上升下降趋势公式: INPUT:N(240,0,999); hh:=hhv(h,N); hhh:=h; aa:=BARSLAST(h=hh[datacount]); ba:datacount-aa,LINETHICK0; ja:=1; tm1:=999999; for i1=ba[datacount]+1 to datacount do begin k1:=(hh[datacount]-hhh[i1])/ja; if k1<tm1 then begin tm1:=k1; ts1:=ja; end; ja:=ja+1; end; A1:LINEVALUE(h=hh[datacount] and aa=0,h,BARPOS=datacount-aa[datacount]+ts1,h,0,0),colorffff54; cha:=hhv(abs(l-a1),aa); A2:a1-cha[datacount],colorffff54; AI:a1-cha[datacount]/2,colorffff54,LINEDASH; ll:=llv(l,N); lll:=l; a3:=BARSLAST(l=ll[datacount]); b3:=datacount-a3; j3:=1; tm3:=999999; for i3=b3[datacount]+1 to datacount do begin k3:=(lll[i3]-ll[datacount])/j3; if k3<tm3 then begin tm3:=k3; ts3:=j3; end; j3:=j3+1; end; B1:LINEVALUE(l=ll[datacount] and a3=0,l,BARPOS=datacount-a3[datacount]+ts3,l,0,0),color5454ff; chb:=hhv(abs(h-b1),a3); {顶尖财经:股票学院 http://www.58188.com} b2:b1+chb[datacount],color5454ff; bi:b1+chb[datacount]/2,color5454ff,LINEDASH; 未补上下缺口: 指定周期范围内最近一次未补上下缺口和价格【源码】 //缺口 input:缺(240); //默认240日内,设为0则全部 s:=l>ref(h,1);x:=h<ref(l,1);l1:=l;h1:=h;swz:=0;xwz:=0;dt:=datacount;l2:=l;h2:=h; for i=dt downto max(lbound(s)+1,dt-if(缺=0,dt,缺)) do begin if s[i] then begin for m=i to dt do begin if h1[i-1]>l1[m] then break; end; if m>dt then begin swz:=i; break; end; end; end; for i=dt downto max(lbound(x)+1,dt-if(缺=0,dt,缺)) do begin if x[i] then begin for m=i to dt do begin if l1[i-1]<h1[m] then break; end; if m>dt then begin xwz:=i; break; end; end; end; t:=sort(l2,1,swz,dt);t:=sort(h2,0,xwz,dt); if xwz>0 then FILLRGN(barpos>=xwz-1,l1[xwz-1],h2[dt]),COLOR888888; if swz>0 then FILLRGN(barpos>=swz-1,h1[swz-1],l2[dt]),COLOR888888; if xwz>0 then drawtext(dt-barpos=5,(l1[xwz-1]+h2[dt])/2,NUMTOSTR(l1[xwz-1], 2)+'--'+NUMTOSTR(h2[dt], 2)),coloryellow; if swz>0 then drawtext(dt-barpos=5,(h1[swz-1]+l2[dt])/2,NUMTOSTR(h1[swz-1], 2)+'--'+NUMTOSTR(l2[dt], 2)),colorwhite; //缺口 |
上一篇:飞狐三位一体,资金波段,异能指标
下一篇:飞狐指标:抄底与逃顶副图