E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2;T1:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2);T2:=BACKSET(U1,REF(BARSLAST(LD),1)+2);T3:=BACKSET(U2,REF(BARSLAST(LD),1)+2);T4:=BACKSET(U3,REF(BARSLAST(LD),1)+2);R3:=BACKSET(S2,REF(BARSLAST(HD),1)+2);R4:=BACKSET(S3,REF(BARSLAST(HD),1)+2); BIAS3 :=(CLOSE-MA(CLOSE,N3))/MA(CLOSE,N3)*100;{高點(diǎn)}R112:=BACKSET(ISLASTBAR,BARSLAST(D12)+1); S112:=R112>REF(R112,1);趨勢(shì):DRAWLINE(D12,BIAS1,S112,BIAS1,1),COLORYELLOW;A22:=REF(BIAS1,M)=LLV(BIAS1,2*M+1); B22:=FILTER(A22,M);C22:=BACKSET(B22,M+1); D22:=FILTER(C22,M);{低點(diǎn)}T112:=BACKSET(ISLASTBAR,BARSLAST(D22)+1); U112:=T112>REF(T112,1);底線:DRAWLINE(D22,BIAS1,U112,BIAS1,1),COLORYELLOW; {三線法}MA15:=MA(CLOSE,15),COLORYELLOW;MA43:MA(CLOSE,43),COLORMAGENTA;MA210:MA(CLOSE,210),COLORCYAN,LINETHICK1;MA318:MA(CLOSE,318),COLORLIMAGENTA,LINETHICK1; 三線定乾坤源碼。 DRAWLINE(CURRBARSCOUNT=QG,H,ISLASTBAR,REF(H,QG-1),1),COLOR0099FF,POINTDOT;QM1:=REF(QG1,QD1+1);DRAWLINE(CURRBARSCOUNT=QH1,L,ISLASTBAR,REF(L,QH1-1),1),COLORWHITE,POINTDOT;DRAWLINE(CURRBARSCOUNT=QR1,L,ISLASTBAR,REF(L,QR1-1),1),COLORWHITE,POINTDOT;選股指標(biāo):SR1:=REF(HIGH,10)=HHV(HIGH,2*10+1);SR2:=FILTER(SR1,10);SR3:=BACKSET(SR2,10+1);HD:=FILTER(SR3,10);前高:=REF(H,BARSLAST(HD));突破前高:CROSS(C,前高); DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);低點(diǎn)支撐:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORRED;DRAWLINE(CURRBARSCOUNT=DDCS2,L,ISLASTBAR,REF(L,DDCS2-1),1),COLOR0055FF,POINTDOT,LINETHICK2;DRAWLINE(CURRBARSCOUNT=DDCS1,L,ISLASTBAR,REF(L,DDCS1-1),1),COLORYELLOW,POINTDOT,LINETHICK2;LDDTS1:=IF(LDD1,REF(LDDTS,LDD1),LDDTS);LLDDTS1:=IF(LLDD1,REF(LLDDTS,LLDD1),LDDTS); 容易想到的辦法:①倒數(shù)第6天的當(dāng)天,tj2為1,更早的1天tj2=0,因此可以編出如下代碼:tj1:=islastbar;{最后一天的條件}tj2:=backset(tj1,6);tj3:tj2 and ref(tj2,1)=0;②倒數(shù)第6天的當(dāng)天,tj2為1,更早的1天tj2=0,即當(dāng)天tj2比早一天的tj2更大,因此可以編出如下代碼:tj1:=islastbar;{最后一天的條件}tj2:=backset(tj1,6);tj3:tj2>ref(tj2,1); {找出全部長(zhǎng)期高點(diǎn)}A4:=L>REF(L,REF(BARSLAST(LD),1)+1);B4:=REF(L,REF(BARSLAST(LD),1)+1)REF(E4,1);{找出全部長(zhǎng)期低點(diǎn)}DRAWICON(HH,H,10),ALIGN2; DRAWICON(LL,L,12),ALIGN1;H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1; {后面進(jìn)行過(guò)濾,方法同前。 DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);低點(diǎn)支撐:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORRED;DRAWLINE(CURRBARSCOUNT=DDCS2,L,ISLASTBAR,REF(L,DDCS2-1),1),COLOR0055FF,POINTDOT,LINETHICK2;DRAWLINE(CURRBARSCOUNT=DDCS1,L,ISLASTBAR,REF(L,DDCS1-1),1),COLORYELLOW,POINTDOT,LINETHICK2;LDDTS1:=IF(LDD1,REF(LDDTS,LDD1),LDDTS); 買(mǎi)線:ema(c,5),colorred,linethick2;a:=(ref(買(mǎi)線,1));賣(mài)線:ema(slope(c,21)*20+c,42),linethick2; b:=cross(買(mǎi)線,賣(mài)線);s:=cross(賣(mài)線,買(mǎi)線);drawtext(b,low-0.1,''''。b1:=(SYSPARAM(4)-SYSPARAM(5))/(SYSPARAM(3)-SYSPARAM(2));DRAWSL(filter(l=SYSPARAM(5),(sysparam(3)-sysparam(2))),l,30*k/120,0,0),COLORWHITE;DRAWSL(filter(l=SYSPARAM(5),(sysparam(3)-sysparam(2))),l,120*k/120,0,0),COLORRED,linethick2,; 自動(dòng)畫(huà)趨勢(shì)線參數(shù): N1 100 5} A1:=REF(H,N)=HHV(H,2*N+1); B1:=FILTER(A1,N); C1:=BACKSET(B1,N+1); D1:=FILTER(C1,N);{高點(diǎn)} A2:=REF(L,N)=LLV(L,2*N+1); B2:=FILTER(A2,N); C2:=BACKSET(B2,N+1); D2:=FILTER(C2,N);{低點(diǎn)} E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2; E2:=(H+L)/2;{ A1:=REF(TY,10)=HHV(TY,2*10+1);A2:=REF(TY,10)=LLV(TY,2*10+1);前期低位:REF(L,BARSLAST(LD)),COLOR00FF00,POINTDOT;STICKLINE(L,前期低位,前期低位,8,0),COLORRED;TZ:=H;A3:=REF(TY,10)=HHV(TY,2*10+1);A4:=REF(TY,10)=LLV(TY,2*10+1);前期高位:REF(H,BARSLAST(MD)),COLOR00FF00,POINTDOT;STICKLINE(H,前期高位,前期高位,8,0),COLORGREEN; A1:=REF(TY,10)=HHV(TY,2*10+1);A2:=REF(TY,10)=LLV(TY,2*10+1);前期低位:REF(L,BARSLAST(LD)),COLOR00FF00,POINTDOT;STICKLINE(L,前期低位,前期低位,8,0),COLORRED;TZ:=H;A3:=REF(TY,10)=HHV(TY,2*10+1);A4:=REF(TY,10)=LLV(TY,2*10+1);前期高位:REF(H,BARSLAST(MD)),COLOR00FF00,POINTDOT;STICKLINE(H,前期高位,前期高位,8,0),COLORGREEN; A6b:=REF(HIGH,3)=HHV(HIGH,2*3+1);E6b:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2;UU3b:=BACKSET(ISLASTBAR,BARSLAST(LD2b)+1);VV3b:=UU3b>REF(UU3b,1);WW3b:=BACKSET(VV3b,REF(BARSLAST(LD2b),1)+2);UU4b:=BACKSET(ISLASTBAR,BARSLAST(HD2b)+1);VV4b:=UU4b>REF(UU4b,1);WW4b:=BACKSET(VV4b,REF(BARSLAST(HD2b),1)+2); {到前頂或底的距離}gao1:=hhv(h,aa1);a:=barslast(var2=1)+2;前一高:=hhv(h,a);b:=barslast(var2=-1)+2;前一低:=llv(l,b);UU:=BACKSET(BARSTATUS=2,BARSLAST(var3=-1)+1);WW:=BACKSET(VV,REF(BARSLAST(var3=-1),1)+2);WW2:=BACKSET(VV2,REF(BARSLAST(var3=1),1)+2);一低:=REF(L,BARSLAST(VV));二低:=REF(L,BARSLAST(XX));一高:=REF(H,BARSLAST(VV2));二高:=REF(H,BARSLAST(XX2)); AA:=REF(CCI,3)=HHV(CCI,2*3+1);CC:=FILTER(BB,3) AND CCI=HHV(CCI,3+1); |
|
來(lái)自: 很不 > 《劃線公式全套源碼》