大智慧最新的主图画线公式
input: k(2,0,2),n(10,1,255),p1(3,1,255);
bbi:(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4,pointdot,COLORFFFFFF;
BBI2:BBI+3*stD(BBI,10),pointdot,COLORmagenta;
BBI3:BBI-3*STD(BBI,10),pointdot,COLORblue;
B1:=MA(CLOSE,1);
B2:=SMA(SMA(SMA(B1,2,1),2,1),2,1) ;
SMA2:=MA(B2,3) ;
FILLRGN(b2,sma2,b2>sma2),colorred;
FILLRGN(b2,sma2,b2<sma2),colorgreen;
var9Q:=c= hhv(c,4)and (ref(c,1)>=ref(c,2) or ref(c,1)>=ref(c,3))
or ref(c,1)=hhv(c,4) and close>=ref(c,2)
or ref(c,2)=hhv(c,4) and ref(c,3)=llv(c,4) and c>=ref(c,1)
or ref(c,3)=hhv(c,4) and c>=ref(c,1) and c>=ref(c,2);
红持:var9Q,color0000ff,LINETHICK0;
varaQ:=c=hhv(c,4) and ref(c,1)=llv(c,4);
粉变:varaQ,colorff99ff,LINETHICK0;
varbQ:=c=llv(c,4) and (ref(c,1)<ref(c,2) or ref(c,1)<ref(c,3))
or ref(c,1)=llv(c,4) and c<ref(c,2)
or ref(c,2)=llv(c,4) and ref(c,1)<>hhv(c,4) and c<ref(c,1)
or ref(c,3)=llv(c,4) and c<ref(c,1) and c<ref(c,2);
灰跌:varbQ,color888888,LINETHICK0;
varcQ:=ref(c,1)=llv(c,4) and c>=ref(c,2) or ref(c,2)=llv(c,4)
and ref(c,1)<=ref(c,3) and ref(c,2)<ref(c,4) and c>=ref(c,1);
绿买:varcQ,color00ff00,LINETHICK0;
vardQ:=ref(c,1)=hhv(c,4) and c<ref(c,2)
or (ref(c,2)=hhv(c,4) and ref(c,1)>ref(c,3)
or ref(c,3)=hhv(c,4) and ref(c,1)>ref(c,2))
and ref(c,2)>=ref(c,4) and c<ref(c,1);
蓝抛:vardQ,colorff9900,LINETHICK0;
if DATATYPE>1 then begin;
xxx1:=(C+L+H)/3;
xxx2:EMA(xxx1,6),colorFFFFFF,linethick1;
xxx3:EMA(xxx2,5),color00FFFF,linethick1;
VAR1111:=BacKSET(REF(HIGH,2)=HHV(HIGH,5),3);
VAR2222:=crOSS(VAR1111,0.9);
VAR3333:=BACKSET(REF(LOW,2)=LLV(LOW,5),3);
VAR4444:=CROSS(VAR3333,0.9);
压力: REF(HIGH,BArslAST(Var2222)), POINTDOT,ColorEA91B5;
STICKLINE(CLOSE,REF(HIGH,BARSLAST(Var2222)),REF(HIGH,BARSLAST(Var2222)),5,0),ColorEA91B5;
支撑: REF(LOW,BARSLAST(Var4444)), POINTDOT,Color00b4ff;
STICKLINE(CLOSE,REF(LOW,BARSLAST(Var4444)),REF(LOW,BARSLAST(Var4444)),5,0),Color00b4ff;
下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);
aRSV:=SMA(下档线,3,1);
aK:=SMA(aRSV,3,1);
aD:=((3 * aRSV) - (2 * aK));
aJ12:=(((CLOSE - LLV(LOW,55)) / (HHV(HIGH,55) - LLV(LOW,55))) * 100);
aRSV24:=SMA(aJ12,3,1);
aK24:=SMA(aRSV24,3,1);
aD24:=((3 * aRSV24) - (2 * aK24));
撑压位:=IF(CROSS(aD24,aD),HIGH,REF(HIGH,BARSLAST(CROSS(aD24,aD)))) {,LINETHICK2,COLORFFFFFF};
底:=LLV(HIGH,30){,COLOR00FF00,LINETHICK2};
STICKLINE(BARSTATUS=2 ,撑压位,撑压位,30,1),LINETHICK1,COLORFFFFFF;
DRAWTEXT(BARSTATUS=2 ,撑压位,' 撑压'),COLORFFFFFF,VALIGN1;
STICKLINE(BARSTATUS=2 ,底,底,30,1),COLOR00FF00,LINETHICK1;
DRAWTEXT(BARSTATUS=2 ,底,' 底线'),COLOR00FF00,VALIGN0;
END;
STICKLINE(CLOSE>OPEN,OPEN,LOW,0.5,0 ),COLOR0000FF;
STICKLINE(CLOSE>OPEN,CLOSE,HIGH,0.5 ,0 ),COLOR0000FF;
STICKLINE(OPEN>=CLOSE,CLOSE,LOW,0.5 ,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE,OPEN,HIGH,0.5 ,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,7,0 ),COLORff7700;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),COLORff9900;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,5,0 ),COLORffbb00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,4,0 ),COLORffcc00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3,0 ),COLORffdd00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),COLORffee00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1,0 ),COLORffFF00;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,7,0) ,COLOR000055;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0) ,COLOR000066;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0) ,COLOR000077;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0) ,COLOR000099;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0) ,COLOR0000bb;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLOR0000dd;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0) ,COLOR0000ff;
stickline(var9Q,c,(o+c)/2,7,0),color000077;
stickline(var9Q,c,(o+c)/2,6,0),color000088;
stickline(var9Q,c,(o+c)/2,5,0),color0000aa;
stickline(var9Q,c,(o+c)/2,4,0),color0000cc;
stickline(var9Q,c,(o+c)/2,2,0),color0000ff;
stickline(var9Q,c,(o+c)/2,0,0),COLORffffff;
stickline(varaQ,c,(o+c)/2,7,0),colorff11ff;
stickline(varaQ,c,(o+c)/2,6,0),colorff33ff;
stickline(varaQ,c,(o+c)/2,5,0),colorff55ff;
stickline(varaQ,c,(o+c)/2,4,0),colorff77ff;
stickline(varaQ,c,(o+c)/2,3,0),colorff99ff;
stickline(varaQ,c,(o+c)/2,2,0),colorffbbff;
stickline(varaQ,c,(o+c)/2,1,0),colorffddff;
stickline(varbQ,c,(o+c)/2,7,0),color333333;
stickline(varbQ,c,(o+c)/2,6,0),color555555;
stickline(varbQ,c,(o+c)/2,5,0),color777777;
stickline(varbQ,c,(o+c)/2,4,0),color999999;
stickline(varbQ,c,(o+c)/2,3,0),colorbbbbbb;
stickline(varbQ,c,(o+c)/2,2,0),colordddddd;
stickline(varbQ,c,(o+c)/2,1,0),colorffffff;
stickline(varcQ,o,(o+c)/2,7,0),color003300;
stickline(varcQ,o,(o+c)/2,6,0),color005500;
stickline(varcQ,o,(o+c)/2,5,0),color007700;
stickline(varcQ,o,(o+c)/2,4,0),color009900;
stickline(varcQ,o,(o+c)/2,3,0),color00bb00;
stickline(varcQ,o,(o+c)/2,2,0),color00dd00;
stickline(varcQ,o,(o+c)/2,1,0),color00ff00;
stickline(vardQ,o,(o+c)/2,7,0),colorff1100;
stickline(vardQ,o,(o+c)/2,6,0),colorff3300;
stickline(vardQ,o,(o+c)/2,5,0),colorff5500;
stickline(vardQ,o,(o+c)/2,4,0),colorff7700;
stickline(vardQ,o,(o+c)/2,3,0),colorff9900;
stickline(vardQ,o,(o+c)/2,2,0),colorffbb00;
stickline(vardQ,o,(o+c)/2,1,0),colorffdd00;
V7:=BARSTATUS=2;
V8:=(REF(HIGH,n) = HHV(HIGH,((2 * n) + 1)));
V9:=FILTER(V8,n);
VA:=BACKSET(V9,(n + 1));
VB:=FILTER(VA,n);
VC:=(VB OR V7);
VD:=(REF(LOW,n) = LLV(LOW,((2 * n) + 1)));
VE:=FILTER(VD,n);
VF:=BACKSET(VE,(n + 1));
V10:=FILTER(VF,n);
V11:=(V10 AND NOT(VB));
V12:=BACKSET(VC,(REF(BARSLAST(V11),1) + 1));
V13:=(V12 > REF(V12,1));
V14:=BACKSET(V13,2);
V15:=(V14 > REF(V14,1));
V16:=BACKSET((V15 AND (COUNT(VC,(REF(BARSLAST(V11),1) + 2)) = 0)),(REF(BARSLAST(V11),1) + 2));
V17:=(V16 > REF(V16,1));
V18:=BACKSET((V17 AND (COUNT(VC,(REF(BARSLAST(V11),1) + 2)) = 0)),(REF(BARSLAST(V11),1) + 2));
V19:=(V18 > REF(V18,1));
V1A:=IF(VC,COUNT(V11,(REF(BARSLAST(VC),1) + 1)),0);
V1B:=IF(((V1A = 1) AND VC),BARSLAST(V15),0);
V1C:=IF((VC AND (REF(LOW,BARSLAST(V15)) >= REF(LOW,BARSLAST(V17)))),BARSLAST(V17),BARSLAST(V15));
V1D:=IF(((V1A = 2) AND VC),V1C,0);
V1E:=IF(((V1A >= 3) AND VC),IF((VC AND (REF(LOW,V1C) >= REF(LOW,BARSLAST(V19)))),BARSLAST(V19),V1C),0);
V1F:=((V1B + V1D) + V1E);
V20:=BACKSET(VC,V1F);
V21:=(V20 > REF(V20,1));
V22:=BACKSET(V21,2);
V23:=(V22 > REF(V22,1));
V24:=(V23 OR V7);
V25:=BACKSET(V24,(REF(BARSLAST(VC),1) + 1));
V26:=(V25 > REF(V25,1));
V27:=BACKSET(V26,2);
V28:=(V27 > REF(V27,1));
V29:=BACKSET((V28 AND (COUNT(V24,(REF(BARSLAST(VC),1) + 2)) = 0)),(REF(BARSLAST(VC),1) + 2));
V2A:=(V29 > REF(V29,1));
V2B:=BACKSET((V2A AND (COUNT(V24,(REF(BARSLAST(VC),1) + 2)) = 0)),(REF(BARSLAST(VC),1) + 2));
V2C:=(V2B > REF(V2B,1));
V2D:=IF(V24,COUNT(VB,(REF(BARSLAST(V24),1) + 1)),0);
V2E:=IF(((V2D = 1) AND V24),BARSLAST(V28),0);
V2F:=IF((V24 AND (REF(HIGH,BARSLAST(V28)) <= REF(HIGH,BARSLAST(V2A)))),BARSLAST(V2A),BARSLAST(V28));
V30:=IF(((V2D = 2) AND V24),V2F,0);
V3B:=IF(((V2D >= 3) AND V24),IF((V24 AND (REF(HIGH,V2F) <= REF(HIGH,BARSLAST(V2C)))),BARSLAST(V2C),V2F),0);
V3C:=((V2E + V30) + V3B);
V3D:=BACKSET(V24,V3C);
V3E:=(V3D > REF(V3D,1));
AA:=BACKSET(V3E,2);
AAA:=(AA > REF(AA,1));
BB:=BACKSET(V7,(BARSLAST(AAA) + 1));
CC1:=(BB > REF(BB,1));
CC:=BACKSET(CC1,(REF(BARSLAST(AAA),1) + 2));
AAA2:=(CC > REF(CC,1));
DRAWLINE(K=1 AND AAA2,HIGH,K=1 AND CC1,HIGH,1),POINTDOT,color00AAAA;
BB2:=(REF(HIGH,4) = HHV(HIGH,((2 * 4) + 1)));
CC22:=FILTER(BB2,4);
CC2:=BACKSET(CC22,(4 + 1));
EA:=FILTER(CC2,4);
EB:=(EA OR BARSTATUS=2);
A6:=(REF(LOW,4) = LLV(LOW,((2 * 4) + 1)));
EE:=FILTER(A6,4);
FF1:=BACKSET(EE,(4 + 1));
EE2:=FILTER(FF1,4);
FF2:=(EE2 AND NOT(EA));
EE3:=BACKSET(EB,(REF(BARSLAST(FF2),1) + 1));
FF3:=(EE3 > REF(EE3,1));
JS:=BACKSET(FF3,2);
G1:=(JS > REF(JS,1));
GA:=BACKSET((G1 AND (COUNT(EB,(REF(BARSLAST(FF2),1) + 2)) = 0)),(REF(BARSLAST(FF2),1) + 2));
G2:=(GA > REF(GA,1));
G3:=BACKSET((G2 AND (COUNT(EB,(REF(BARSLAST(FF2),1) + 2)) = 0)),(REF(BARSLAST(FF2),1) + 2));
GG:=(G3 > REF(G3,1));
JA:=IF(EB,COUNT(FF2,(REF(BARSLAST(EB),1) + 1)),0);
JB:=IF(((JA = 1) AND EB),BARSLAST(G1),0);
JJ:=IF((EB AND (REF(LOW,BARSLAST(G1)) >= REF(LOW,BARSLAST(G2)))),BARSLAST(G2),BARSLAST(G1));
LD:=IF(((JA = 2) AND EB),JJ,0);
LD1:=IF(((JA >= 3) AND EB),IF((EB AND (REF(LOW,JJ) >= REF(LOW,BARSLAST(GG)))),BARSLAST(GG),JJ),0);
HEA:=((JB + LD) + LD1);
HEB:=BACKSET(EB,HEA);
HEE:=(HEB > REF(HEB,1));
HFF1:=BACKSET(HEE,2);
HEE2:=(HFF1 > REF(HFF1,1));
HFF2:=(HEE2 OR BARSTATUS=2);
HEE3:=BACKSET(HFF2,(REF(BARSLAST(EB),1) + 1));
HFF3:=(HEE3 > REF(HEE3,1));
HJS:=BACKSET(HFF3,2);
HG1:=(HJS > REF(HJS,1));
HGA:=BACKSET((HG1 AND (COUNT(HFF2,(REF(BARSLAST(EB),1) + 2)) = 0)),(REF(BARSLAST(EB),1) + 2));
HG2:=(HGA > REF(HGA,1));
HG3:=BACKSET((HG2 AND (COUNT(HFF2,(REF(BARSLAST(EB),1) + 2)) = 0)),(REF(BARSLAST(EB),1) + 2));
HGG:=(HG3 > REF(HG3,1));
HJA:=IF(HFF2,COUNT(EA,(REF(BARSLAST(HFF2),1) + 1)),0);
HJB:=IF(((HJA = 1) AND HFF2),BARSLAST(HG1),0);
HJJ:=IF((HFF2 AND (REF(HIGH,BARSLAST(HG1)) <= REF(HIGH,BARSLAST(HG2)))),BARSLAST(HG2),BARSLAST(HG1));
HD:=IF(((HJA = 2) AND HFF2),HJJ,0);
X1:=IF(((HJA >= 3) AND HFF2),IF((HFF2 AND (REF(HIGH,HJJ) <= REF(HIGH,BARSLAST(HGG)))),BARSLAST(HGG),HJJ),0);
X2:=((HJB + HD) + X1);
Y1:=BACKSET(HFF2,X2);
Y2:=(Y1 > REF(Y1,1));
Z1:=BACKSET(Y2,2);
Z2:=(Z1 > REF(Z1,1));
UU:=BACKSET(BARSTATUS=2,(BARSLAST(HEE2) + 1));
VV:=(UU > REF(UU,1));
WW:=BACKSET(BARSTATUS=2,(BARSLAST(Z2) + 1));
XX:=(WW > REF(WW,1));
UU2:=IF((BARSLAST(VV) < BARSLAST(XX)),VV,XX);
VV2:=IF((BARSLAST(VV) < BARSLAST(XX)),LOW,HIGH);
DRAWLINE(K=1 AND UU2,VV2,K=1 AND BARSTATUS=2,CLOSE,0),POINTDOT,colorFF9900;
WW2:=BACKSET(BARSTATUS=2,(BARSLAST(HEE2) + 1));
XX2:=(WW2 > REF(WW2,1));
VAR246:=BACKSET(XX2,(REF(BARSLAST(HEE2),1) + 2));
VAR247:=(VAR246 > REF(VAR246,1));
DRAWLINE(K=1 AND VAR247,LOW, K=1 AND XX2,LOW,1),POINTDOT,color00ffff;
VAR249:=BACKSET(BARSTATUS=2,(BARSLAST(Z2) + 1));
VAR250:=(VAR249 > REF(VAR249,1));
VAR251:=BACKSET(VAR250,(REF(BARSLAST(Z2),1) + 2));
VAR252:=(VAR251 > REF(VAR251,1));
DRAWLINE(K=1 AND VAR252,HIGH, K=1 AND VAR250,HIGH,1),POINTDOT,color00ffff;
wN:=p1;{原码 N:=3;}
wA1:=REF(H,wN)=HHV(H,2*wN+1); wB1:=FILTER(wA1,wN); wC1:=BACKSET(wB1,wN+1); wD1:=FILTER(wC1,wN);{高点}
wA2:=REF(L,wN)=LLV(L,2*wN+1); wB2:=FILTER(wA2,wN); wC2:=BACKSET(wB2,wN+1); wD2:=FILTER(wC2,wN);{低点}
wE1:=(REF(LLV(L,2*wN),1)+REF(HHV(H,2*wN),1))/2; wE2:=(H+L)/2;{高低点出现在同一k线上时可作取舍}
wH1:=(wD1 AND NOT(wD2 AND wE1>=wE2)) OR DISPSTATUS=2 OR BARSCOUNT(C)=1;
wL1:=(wD2 AND NOT(wD1 AND wE1<wE2)); wH2:=wD1 AND NOT(wD2 AND wE1>=wE2);
wX1:=REF(BARSLAST(wH1),1)+1; wF1:=BACKSET(wH1 AND COUNT(wL1,wX1)>0,LLVBARS(IF(wL1,L,10000),wX1));
wG1:=wF1>REF(wF1,1); wI1:=BACKSET(wG1,2); wLD:=wI1>REF(wI1,1);{过滤后低点}
wL2:=wLD OR DISPSTATUS=2 OR BARSCOUNT(C)=1;
wX2:=REF(BARSLAST(wL2),1)+1; wF2:=BACKSET(wL2 AND COUNT(wH2,wX2)>0,HHVBARS(IF(wH2,H,0),wX2));
wG2:=wF2>REF(wF2,1); wI2:=BACKSET(wG2,2); wHD:=wI2>REF(wI2,1);{过滤后高点}
wr1:=BACKSET(DISPSTATUS=2,BARSLAST(wHD)+1); wS1:=wR1>REF(wR1,1); {前一高}
wT1:=BACKSET(DISPSTATUS=2,BARSLAST(wLD)+1); wU1:=wT1>REF(wT1,1); {前一低}
wR2:=BACKSET(wS1,REF(BARSLAST(wHD),1)+2); wS2:=wR2>REF(wR2,1); {前二高}
wT2:=BACKSET(wU1,REF(BARSLAST(wLD),1)+2); wU2:=wT2>REF(wT2,1); {前二低}
wT3:=BACKSET(wU2,REF(BARSLAST(wLD),1)+2); wU3:=wT3>REF(wT3,1); {前三低}
wT4:=BACKSET(wU3,REF(BARSLAST(wLD),1)+2); wU4:=wT4>REF(wT4,1); {前四低}
wR3:=BACKSET(wS2,REF(BARSLAST(wHD),1)+2); wS3:=wR3>REF(wR3,1); {前三高}
wR4:=BACKSET(wS3,REF(BARSLAST(wHD),1)+2); wS4:=wR4>REF(wR4,1); {前四高}
DRAWLINE(K=2 AND wS2,H,K=2 AND wS1,H,1),Color008888; {压力1:}
DRAWLINE(K=2 AND wU2,L,K=2 AND wU1,L,1),POINTDOT,Color008888;{支撑1:}
DRAWLINE(K=2 AND wS3,H,K=2 AND wS2,H,1),Color888000; {压力2:}
DRAWLINE(K=2 AND wU3,L,K=2 AND wU2,L,1),POINTDOT,Color888000;{支撑2:}
DRAWLINE(K=2 AND wS4,H,K=2 AND wS3,H,1),Color0000CC;{压力3:}
DRAWLINE(K=2 AND wU4,L,K=2 AND wU3,L,1),POINTDOT,Color0000CC;{支撑3:};