通达信A压力支撑主图源码
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));
WW2:=BACKSET(BARSTATUS=2,(BARSLAST(HEE2) + 1));
XX2:=(WW2 > REF(WW2,1));
VAR246:=BACKSET(XX2,(REF(BARSLAST(HEE2),1) + 2));
VAR247:=((K=2 OR K=0) AND VAR246 > REF(VAR246,1));
压2:=DRAWLINE(VAR247,LOW,XX2,LOW,1),COLORFF0000,LINETHICK2;
VAR249:=BACKSET(BARSTATUS=2,(BARSLAST(Z2) + 1));
VAR250:=(VAR249 > REF(VAR249,1));
VAR251:=BACKSET(VAR250,(REF(BARSLAST(Z2),1) + 2));
VAR252:=((K=2 OR K=0) AND VAR251 > REF(VAR251,1));
支1:=DRAWLINE(VAR252,HIGH,VAR250,HIGH,1),COLORFF0000,LINETHICK1;
IF(BETWEEN(压1,高点,低点),压1,DRAWNULL)DOTLINE,COLORFFFF00,LINETHICK1;
IF(BETWEEN(压2,高点,低点),压2,DRAWNULL)DOTLINE,COLORFFFF00,LINETHICK1;
IF(BETWEEN(支1,高点,低点),支1,DRAWNULL)DOTLINE,COLORFFFF00,LINETHICK1;
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;
WH1:=(WD1 AND NOT(WD2 AND WE1>=WE2)) OR BARSTATUS=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 BARSTATUS=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(BARSTATUS=2,BARSLAST(WHD)+1);
WS1:=WR1>REF(WR1,1); {前一高}
WT1:=BACKSET((K=3 OR K=0) AND BARSTATUS=2,BARSLAST(WLD)+1); WU1:=WT1>REF(WT1,1); {前一低}
WR2:=BACKSET((K=3 OR K=0) AND WS1,REF(BARSLAST(WHD),1)+2); WS2:=WR2>REF(WR2,1); {前二高}
WT2:=BACKSET((K=3 OR K=0) AND WU1,REF(BARSLAST(WLD),1)+2); WU2:=WT2>REF(WT2,1); {前二低}
WT3:=BACKSET((K=3 OR K=0) AND WU2,REF(BARSLAST(WLD),1)+2); WU3:=WT3>REF(WT3,1); {前三低}
WT4:=BACKSET((K=3 OR K=0) AND WU3,REF(BARSLAST(WLD),1)+2); WU4:=WT4>REF(WT4,1); {前四低}
WR3:=BACKSET((K=3 OR K=0) AND WS2,REF(BARSLAST(WHD),1)+2); WS3:=WR3>REF(WR3,1); {前三高}
WR4:=BACKSET((K=3 OR K=0) AND WS3,REF(BARSLAST(WHD),1)+2); WS4:=WR4>REF(WR4,1); {前四高}
压力1:=DRAWLINE(WS2,H,WS1,H,1),COLOR008888; {★压力1:}
支撑1:=DRAWLINE(WU2,L,WU1,L,1),POINTDOT,COLOR008888;{★支撑1:}
压力2:=DRAWLINE(WS3,H,WS2,H,1),COLOR888000; {★压力2:}
支撑2:=DRAWLINE(WU3,L,WU2,L,1),POINTDOT,COLOR888000;{★支撑2:}
压力3:=DRAWLINE(WS4,H,WS3,H,1),COLOR0000CC;{★压力3:}
支撑3:=DRAWLINE(WU4,L,WU3,L,1),POINTDOT,COLOR0000CC;{★支撑3:};
IF(BETWEEN(压力1,高点,低点),压力1,DRAWNULL),COLORGRAY,LINETHICK1;
IF(BETWEEN(支撑1,高点,低点),支撑1,DRAWNULL),COLORGRAY,LINETHICK1;
IF(BETWEEN(压力2,高点,低点),压力2,DRAWNULL)DOTLINE,COLORFF00FF,LINETHICK1;
- 上一篇公式:通达信原创张清华KDJ均线战法主图源码
- 下一篇公式:通达信众赢波段赢家等公式组