-- 作者:十字军
-- 发布时间:2011/2/25 9:34:58
-- [求助]请帮我看看这个指标哪错了
V1:=iSLASTbAR; V2:=REF(H,N)=HHV(H,2*N+1); V3:=FILTER(V2,N); V4:=BACKSET(V3,N+1); V5:=FILTER(V4,N); V6:=V5 OR V1; V7:=REF(L,N)=LLV(L,2*N+1); V8:=FILTER(V7,N); V9:=BACKSET(V8,N+1); VA:=FILTER(V9,N); VB:=VA AND NOT(V5); VC:=BACKSET(V6,REF(BARSLAST(VB),1)+1); VD:=VC>REF(VC,1); VE:=BACKSET(VD,2); VF:=VE>REF(VE,1); V10:=BACKSET(VF AND COUNT(V6,REF(BARSLAST(VB),1)+2)=0,REF(BARSLAST(VB),1)+2); V11:=V10>REF(V10,1); V12:=BACKSET(V11 AND COUNT(V6,REF(BARSLAST(VB),1)+2)=0,REF(BARSLAST(VB),1)+2); V13:=V12>REF(V12,1); V14:=IF(V6,COUNT(VB,REF(BARSLAST(V6),1)+1),0); V15:=IF(V14=1 AND V6,BARSLAST(VF),0); V16:=IF(V6 AND REF(L,BARSLAST(VF))>=REF(L,BARSLAST(V11)),BARSLAST(V11),BARSLAST(VF)); V17:=IF(V14=2 AND V6,V16,0); V18:=IF(V14>=3 AND V6,IF(V6 AND REF(L,V16)>=REF(L,BARSLAST(V13)),BARSLAST(V13),V16),0); V19:=V15+V17+V18; V1A:=BACKSET(V6,V19); V1B:=V1A>REF(V1A,1); V1C:=BACKSET(V1B,2); V1D:=V1C>REF(V1C,1); V1E:=V1D OR V1; V1F:=BACKSET(V1E,REF(BARSLAST(V6),1)+1); V20:=V1F>REF(V1F,1); V21:=BACKSET(V20,2); V22:=V21>REF(V21,1); V23:=BACKSET(V22 AND COUNT(V1E,REF(BARSLAST(V6),1)+2)=0,REF(BARSLAST(V6),1)+2); V24:=V23>REF(V23,1); V25:=BACKSET(V24 AND COUNT(V1E,REF(BARSLAST(V6),1)+2)=0,REF(BARSLAST(V6),1)+2); V26:=V25>REF(V25,1); V27:=IF(V1E,COUNT(V5,REF(BARSLAST(V1E),1)+1),0); V28:=IF(V27=1 AND V1E,BARSLAST(V22),0); V29:=IF(V1E AND REF(H,BARSLAST(V22))<=REF(H,BARSLAST(V24)),BARSLAST(V24),BARSLAST(V22)); V2A:=IF(V27=2 AND V1E,V29,0); V2B:=IF(V27>=3 AND V1E,IF(V1E AND REF(H,V29)<=REF(H,BARSLAST(V26)),BARSLAST(V26),V29),0); V2C:=V28+V2A+V2B; V2D:=BACKSET(V1E,V2C); V2E:=V2D>REF(V2D,1); V2F:=BACKSET(V2E,2); V30:=V2F>REF(V2F,1); DRAWLINE(V1D,L,V30,H,0),linethick1; DRAWLINE(V30,H,V1D,L,0),linethick1; V31:=BACKSET(V1,BARSLAST(V1D)+1); V32:=V31>REF(V31,1); V33:=BACKSET(V1,BARSLAST(V30)+1); V34:=V33>REF(V33,1); V35:=IF(BARSLAST(V32)<BARSLAST(V34),V32,V34); V36:=IF(BARSLAST(V32)<BARSLAST(V34),L,H); DRAWLINE(V35,V36,V1,C,0),linethick1; V37:=BACKSET(V1,BARSLAST(V1D)+1); V38:=V37>REF(V37,1); V39:=BACKSET(V38,REF(BARSLAST(V1D),1)+2); V3A:=V39>REF(V39,1); DRAWLINE(V3A,L,V38,L,1),linethick1,coloryellow,pointdot; V3B:=BACKSET(V1,BARSLAST(V30)+1); V3C:=V3B>REF(V3B,1); V3D:=BACKSET(V3C,REF(BARSLAST(V30),1)+2); V3E:=V3D>REF(V3D,1); DRAWLINE(V3E,H,V3C,H,1),linethick1,coloryellow,pointdot;
xx1: REF(L,BARSLAST(V38)),colorccff99,linethick2; 前二低: REF(L,BARSLAST(V3A)),colormagenta,linethick2; yy1: REF(H,BARSLAST(V3C)),colorccff99,linethick2; 前二高: REF(H,BARSLAST(V3E)),colormagenta,linethick2; drawnumber(islastbar,yy1,yy1,2); drawnumber(islastbar,xx1,xx1,2); drawnumber(islastbar,前二低,前二低,2); drawnumber(islastbar,前二高,前二高,2);
J:=REF(H,N)=HHV(H,2*N+1); JA:=FILTER(J,N); BB:=BACKSET(JA,N+1); J1:=FILTER(BB,N); J:=J1 OR ISLASTBAR; J2:=REF(L,N)=LLV(L,2*N+1); JA2:=FILTER(J2,N); BB2:=BACKSET(JA2,N+1); J22:=FILTER(BB2,N); J2:=J22 AND NOT(J1); EA:=BACKSET(J,REF(BARSLAST(J2),1)+1); EB:=EA>REF(EA,1); JF:=BACKSET(EB,2); JJ1:=JF>REF(JF,1); JF2:=BACKSET(JJ1 AND COUNT(J,REF(BARSLAST(J2),1)+2)=0,REF(BARSLAST(J2),1)+2); JJ2:=JF2>REF(JF2,1); JF3:=BACKSET(JJ2 AND COUNT(J,REF(BARSLAST(J2),1)+2)=0,REF(BARSLAST(J2),1)+2); JJ3:=JF3>REF(JF3,1); js:=IF(J,COUNT(J2,REF(BARSLAST(J),1)+1),0); G1:=IF(JS=1 AND J,BARSLAST(JJ1),0); GA:=IF(J AND REF(L,BARSLAST(JJ1))>=REF(L,BARSLAST(JJ2)),BARSLAST(JJ2),BARSLAST(JJ1)); G2:=IF(JS=2 AND J,GA,0); G3:=IF(JS>=3 AND J,IF(J AND REF(L,GA)>=REF(L,BARSLAST(JJ3)),BARSLAST(JJ3),GA),0); GG:=G1+G2+G3; JA:=BACKSET(J,GG); JB:=JA>REF(JA,1); JJ:=BACKSET(JB,2); LD:=JJ>REF(JJ,1); LD1:=LD OR ISLASTBAR; hEA:=BACKSET(LD1,REF(BARSLAST(J),1)+1); hEB:=hEA>REF(hEA,1); hJF:=BACKSET(hEB,2); hJJ1:=hJF>REF(hJF,1); hJF2:=BACKSET(hJJ1 AND COUNT(LD1,REF(BARSLAST(J),1)+2)=0,REF(BARSLAST(J),1)+2); hJJ2:=hJF2>REF(hJF2,1); hJF3:=BACKSET(hJJ2 AND COUNT(LD1,REF(BARSLAST(J),1)+2)=0,REF(BARSLAST(J),1)+2); hJJ3:=hJF3>REF(hJF3,1); hjs:=IF(LD1,COUNT(J1,REF(BARSLAST(LD1),1)+1),0); hG1:=IF(hJS=1 AND LD1,BARSLAST(hJJ1),0); hGA:=IF(LD1 AND REF(H,BARSLAST(hJJ1))<=REF(H,BARSLAST(hJJ2)),BARSLAST(hJJ2),BARSLAST(hJJ1)); hG2:=IF(hJS=2 AND LD1,hGA,0); hG3:=IF(hJS>=3 AND LD1,IF(LD1 AND REF(H,hGA)<=REF(H,BARSLAST(hJJ3)),BARSLAST(hJJ3),hGA),0); hGG:=hG1+hG2+hG3; hJA:=BACKSET(LD1,hGG); hJB:=hJA>REF(hJA,1); hJJ:=BACKSET(hJB,2); HD:=hJJ>REF(hJJ,1),linethick2; UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1); VV:=10*(UU>REF(UU,1)); UU2:=BACKSET(ISLASTBAR,BARSLAST(HD)+1); VV2:=20*(UU2>REF(UU2,1));
底1:=REF(L,BARSLAST(LD)),COLORred,LINETHICK1; 頂1:=REF(H,BARSLAST(HD)),COLORGreen,LINETHICK1; StickLine(HD ,頂1,底1,0,0),Color660099,linethick1; DRAWLINE(LD,L,HD,H,0),Color660099,linethick1;{斜} DRAWLINE(LD,L,HD,底1,0),Color660099,linethick1;{?} StickLine(LD,頂1,底1,0,0),Color666666,linethick1; DRAWLINE(HD,H,LD,L,0),Color666666,linethick1;{斜} DRAWLINE(HD,H,LD,頂1,0),Color666666,linethick1;{?}
底:REF(L,BARSLAST(VV)),COLORred,LINETHICK2; 頂:REF(H,BARSLAST(VV2)),COLORGreen,LINETHICK2;
{下迭三角形:藍色三角形畫完介入} StickLine(VV,頂,底,0,0),Colorff6633,linethick3; DRAWLINE(VV2,H,VV,L,0),Colorff6633,linethick3;{斜} DRAWLINE(VV2,H,VV,頂,0),Colorff6633,linethick3;{?}
{DRAWLINE(c>0,H,VV,L,0),Colorcyan,linethick2;}{斜} {DRAWLINE(c>1,H,VV,頂,0),Colorcyan,linethick2;}{?} {上漲三角形:紅色三角形畫完出局} StickLine(VV2 ,頂,底,0,0),Colorred,linethick3;{??} DRAWLINE(VV,L,VV2,H,0),Colorred,linethick3;{斜} DRAWLINE(VV,L,VV2,底,0),Colorred,linethick3;{?}
hat:=hhv(h,20); hbt:=llv(l,20); hht:=h; llt:=l; xat:=hat[datacount]; xbt:=hbt[datacount]; hbc[1]:=0; nat:=hbc[1]; nbt:=hbc[1]; hnat:=hbc[1]; hnbt:=hbc[1]; cat:=hbc[1]; cbt:=hbc[1]; hct:=c; for i=datacount downto datacount-200 do begin if hat=xat then nat:=nat+1; if hat=xat and nat=1 then cat:=i; if hat=xat and nat=1 then hnat:=hat;
if hbt=xbt then nbt:=nbt+1; if hbt=xbt and nbt=1 then cbt:=i; if hbt=xbt and nbt=1 then hnbt:=hbt; end;
hac[1]:=0; atta:=hac[1]; attb:=hac[1]; atth1:=hac[1]; atth2:=hac[1]; atthi1:=hac[1]; atthi2:=hac[1]; attl1:=hac[1]; attl2:=hac[1]; attli1:=hac[1]; attli2:=hac[1]; hh:=H; LL:=L;
FOR I=datacount downTO datacount-300 do begin if HD>0 then atta:=atta+1;
if HD>0 and atta=1 then atth1:=hh; if HD>0 and atta=1 then atthi1:=i; if HD>0 and atta=2 then atth2:=hh; if HD>0 and atta=2 then atthi2:=i; if LD>0 then attb:=attb+1; if LD>0 and attb=1 then attl1:=LL; if LD>0 and attb=1 then attli1:=i; if LD>0 and attb=2 then attl2:=LL; if LD>0 and attb=2 then attli2:=i; end;
nnn1:=70; nnn:=70; nnn2:=200; nnn3:=DATACOUNT-1;
{HH:=HHV(H,Nnn1);} {LL:=LLV(L,Nnn1);} dd3:=c; dd4:=c; dd5:=c; ddt:=c; ldd3:=c; ldd4:=c; ldd5:=c; lddt:=c; hh1:=atth1; hh2:=atth2; ll1:=attl1; ll2:=attl2;
aa:=h; xbb:=l; cc:=c; caa1:=atthi1,linethick1; // caa1,linethick7; caa2:=atthi2; cbb1:=attli1; cbb2:=attli2; hnaa1:=atth1; hnaa2:=atth2; hnbb1:=attl1; hnbb2:=attl2; // hnbb2,linethick5; // hnaa2,linethick5;
hnaat:=hnat; hnbbt:=hnbt; caat:=cat; cbbt:=cbt;
<% VH1=FFL.VARDATA("HH1") VH2=FFL.VARDATA("HH2") VL1=FFL.VARDATA("LL1") VL2=FFL.VARDATA("LL2") VN=FFL.VARDATA("NNN2") vdd3=FFL.VARDATA("dd3") vdd4=FFL.VARDATA("dd4") vdd5=FFL.VARDATA("dd5") vddt=FFL.VARDATA("ddt") vldd3=FFL.VARDATA("ldd3") vldd4=FFL.VARDATA("ldd4") vldd5=FFL.VARDATA("ldd5") vlddt=FFL.VARDATA("lddt") vbb=FFL.VARDATA("xbb") vaa=FFL.VARDATA("aa") vcaa1=FFL.VARDATA("caa1") vcaa2=FFL.VARDATA("caa2") vcaat=FFL.VARDATA("caat") vcbb1=FFL.VARDATA("cbb1") vcbb2=FFL.VARDATA("cbb2") vcbbt=FFL.VARDATA("cbbt") vhnaa1=FFL.VARDATA("hnaa1") vhnaa2=FFL.VARDATA("hnaa2") vhnaat=FFL.VARDATA("hnaat") vhnbb1=FFL.VARDATA("hnbb1") vhnbb2=FFL.VARDATA("hnbb2") vhnbbt=FFL.VARDATA("hnbbt") LAST=FFL.VARDATA("nnn3")
dtt4=LAST-VN+1 bbtt4=0 aatt4=0 if vhnbb2<vhnbb1 then bbtt4=vhnbb2 else bbtt4=vhnbb1 end if if vhnaa2<vhnaa1 then aatt4=vhnaa1 else aatt4=vhnaa2 end if
vcaat1=vcaa1 vcaat2=vcaa2 vcbbt1=vcbb1 vcbbt2=vcbb2
FOR I=LAST-VN+1 TO LAST If vcaat1<vcbbt1 then vdd3(i-(last-vcaat2+1))=vhnaa2+(i-(LAST-VN+1))*(vhnbb2-vhnaa2)/abs(vcbbt2-vcaat2) vdd4(i-(last-vcaat2+1))=vhnaa2+(i-(LAST-VN+1))*(vhnaa1-vhnaa2)/abs(vcaat1-vcaat2) vdd5(i-(last-vcaat2+1))=vhnaa2+(i-(LAST-VN+1))*((vhnbb2+vhnaa1)/2-vhnaa2)/(Int((vcbbt2+vcaat1)/2)-vcaat2) else vdd3(i-(last-vcaat2+1))=vhnaa2+(i-(LAST-VN+1))*(vhnbb1-vhnaa2)/abs(vcbbt1-vcaat2) vdd4(i-(last-vcaat2+1))=vhnaa2+(i-(LAST-VN+1))*(vhnaa1-vhnaa2)/abs(vcaat1-vcaat2) vdd5(i-(last-vcaat2+1))=vhnaa2+(i-(LAST-VN+1))*((vhnbb1+vhnaa1)/2-vhnaa2)/(Int((vcbbt1+vcaat1)/2)-vcaat2) end if if vdd5(i-(last-vcaat2+1))<=bbtt4*0.9 then vdd5(i-(last-vcaat2+1))=bbtt4*0.9
If vcaat1<vcbbt1 then vldd3(i-(last-vcbbt2+1))=vhnbb2+(i-(LAST-VN+1))*(vhnaa1-vhnbb2)/abs(vcaat1-vcbbt2) vldd4(i-(last-vcbbt2+1))=vhnbb2+(i-(LAST-VN+1))*(vhnbb1-vhnbb2)/abs(vcbbt1-vcbbt2) vldd5(i-(last-vcbbt2+1))=vhnbb2+(i-(LAST-VN+1))*((vhnaa1+vhnbb1)/2-vhnbb2)/(Int((vcaat1+vcbbt1)/2)-vcbbt2) else vldd3(i-(last-vcbbt2+1))=vhnbb2+(i-(LAST-VN+1))*(vhnaa2-vhnbb2)/abs(vcaat2-vcbbt2) vldd4(i-(last-vcbbt2+1))=vhnbb2+(i-(LAST-VN+1))*(vhnbb1-vhnbb2)/abs(vcbbt1-vcbbt2) vldd5(i-(last-vcbbt2+1))=vhnbb2+(i-(LAST-VN+1))*((vhnaa2+vhnbb1)/2-vhnbb2)/(Int((vcaat2+vcbbt1)/2)-vcbbt2) end if if vldd5(i-(last-vcbbt2+1))>aatt4*1.35 then vldd5(i-(last-vcbbt2+1))=aatt4*1.35
If vcbbt1>vcaat1 then vddt(i-(last-vcaat1+1))=vhnaa1+(i-(LAST-VN+1))*((vhnbb1+vhnaat)/2-vhnaa1)/(Int((vcbbt1+vcaat)/2)-vcaat1) Else vddt(i-(last-vcaat1+1))=vhnaa1 End If if vddt(i-(last-vcaat1+1))<bbtt4*0.9 then vddt(i-(last-vcaat1+1))=bbtt4*0.9
if vcbbt1<vcaat1 then vlddt(i-(last-vcbbt1+1))=vhnbb1+(i-(LAST-VN+1))*((vhnaa1+vhnbbt)/2-vhnbb1)/(Int((vcaat1+vcbbt)/2)-vcbbt1) Else vlddt(i-(last-vcbbt1+1))=vhnbb1 End If if vlddt(i-(last-vcbbt1+1))>aatt4*1.35 then vlddt(i-(last-vcbbt1+1))=aatt4*1.35
NEXT
FFL.VARDATA("dd3")=Vdd3 FFL.VARDATA("dd4")=Vdd4 FFL.VARDATA("dd5")=Vdd5 FFL.VARDATA("ddt")=Vddt FFL.VARDATA("ldd3")=Vldd3 FFL.VARDATA("ldd4")=Vldd4 FFL.VARDATA("ldd5")=Vldd5 FFL.VARDATA("lddt")=Vlddt FFL.VARSTARTINDEX("HH1")=LAST-VN-(last-vcaat2+1)+1 FFL.VARSTARTINDEX("HH2")=LAST-VN-(last-vcaat2+1)+1 FFL.VARSTARTINDEX("LL1")=LAST-VN-(last-vcaat2+1)+1 FFL.VARSTARTINDEX("LL2")=LAST-VN-(last-vcaat2+1)+1 FFL.VARSTARTINDEX("dd3")=LAST-VN-(last-vcaat2+1)+1 FFL.VARSTARTINDEX("dd4")=LAST-VN-(last-vcaat2+1)+1 FFL.VARSTARTINDEX("dd5")=LAST-VN-(last-vcaat2+1)+1
FFL.VARSTARTINDEX("ddt")=LAST-VN-(last-vcaat1+1)+1 FFL.VARSTARTINDEX("ldd3")=LAST-VN-(last-vcbbt2+1)+1 FFL.VARSTARTINDEX("ldd4")=LAST-VN-(last-vcbbt2+1)+1 FFL.VARSTARTINDEX("ldd5")=LAST-VN-(last-vcbbt2+1)+1 FFL.VARSTARTINDEX("lddt")=LAST-VN-(last-vcbbt1+1)+1 %>
// partline(c>0 and barscount(c)<datacount-(datacount-caa2) and dd3>sysparam(5)*0.9,dd3),linethick1,shift199,color007700; // partline(c>0 and barscount(c)<datacount-(datacount-caa2),dd4),linethick1,shift199,coloryellow; partline(c>0 and barscount(c)<datacount-(datacount-caa2) and (dd5>sysparam(5)*0.94 and dd5<sysparam(4)*1.06),dd5),linethick2,pointdot,shift199,color007700; drawnumber(barscount(c)+199=datacount and (dd5>sysparam(5)*0.94 and dd5<sysparam(4)*1.06),dd5,dd5,2),color007700,shift200; stickline(barscount(c)+199=datacount and (dd5>sysparam(5)*0.94 and dd5<sysparam(4)*1.06),dd5,dd5+dd5*0.0001,60,0),color007700,shift199;
partline(c>0 and barscount(c)<datacount-(datacount-caa1) and ddt>sysparam(5)*0.975,ddt),linethick4,pointdot,shift199,color007700; drawnumber(barscount(c)+199=datacount,ddt,ddt,2),color007700,shift200; stickline(barscount(c)+199=datacount,ddt,ddt+ddt*0.0001,60,0),color007700,shift199;
{partline(c>0 and barscount(c)<datacount-(datacount-cbb2)+30 and ldd3<sysparam(4)*2.07,ldd3),linethick1,shift199,colorcc3366;} {partline(c>0 and barscount(c)<datacount-(datacount-cbb2),ldd4),linethick1,shift199,colorcc3366;} partline(c>0 and barscount(c)<datacount-(datacount-cbb2) and ldd5<sysparam(4)*1.06,ldd5),linethick2,pointdot,shift199,colorcc3366; drawnumber(barscount(c)+199=datacount,ldd5,ldd5,2),colorcc3366,shift200; stickline(barscount(c)+199=datacount,ldd5,ldd5+ldd5*0.0001,60,0),colorcc3366,shift199;
partline(c>0 and barscount(c)<datacount-(datacount-cbb1) and lddt<sysparam(4)*1.06,lddt),linethick4,pointdot,shift199,colorcc3366; drawnumber(barscount(c)+199=datacount,lddt,lddt,2),colorcc3366,shift200; stickline(barscount(c)+199=datacount,lddt,lddt+lddt*0.0001,60,0),colorcc3366,shift199;
|
-- 作者:十字军
-- 发布时间:2011/2/25 9:35:51
--
这是剩下的那部分源码,一个贴发不了
AC:=C; AH:=H; AL:=L; AO:=O;
STICKLINE(AC>=AO,AH,AC,1,0),color008899; STICKLINE(AC>=AO,AH,AC,0,0),color77ffee; STICKLINE(AC>=AO,AO,AL,1,0),color008899; STICKLINE(AC>=AO,AO,AL,0,0),color77ffee;
STICKLINE(AC>AO,AC,AO,8,0),COLOR008899; STICKLINE(AC>AO,AC,AO,7,0),COLOR1199aa; STICKLINE(AC>AO,AC,AO,6,0),COLOR22aabb; STICKLINE(AC>AO,AC,AO,5,0),COLOR33bbcc; STICKLINE(AC>AO,AC,AO,4,0),COLOR44ccdd; STICKLINE(AC>AO,AC,AO,3,0),COLOR55ddee; STICKLINE(AC>AO,AC,AO,2,0),COLOR66eeee; STICKLINE(AC>AO,AC,AO,1,0),COLOR77ffee;
STICKLINE(AC<=AO,AH,AC,1,0),colorff8800; STICKLINE(AC<=AO,AH,AC,0,0),colorffff33; STICKLINE(AC<=AO,AO,AL,1,0),colorff8800; STICKLINE(AC<=AO,AO,AL,0,0),colorffff33;
STICKLINE(AC<=AO,AC,AO,8,0),COLORff8800; STICKLINE(AC<=AO,AC,AO,7,0),COLORff9900; STICKLINE(AC<=AO,AC,AO,6,0),COLORffaa11; STICKLINE(AC<=AO,AC,AO,5,0),COLORffbb11; STICKLINE(AC<=AO,AC,AO,4,0),COLORffcc22; STICKLINE(AC<=AO,AC,AO,3,0),COLORffdd22; STICKLINE(AC<=AO,AC,AO,2,0),COLORffee33; STICKLINE(AC<=AO,AC,AO,1,0),COLORffff33;
|