有了这个通达信主图公式 支撑压力一目了然了
153144453.png
MA1:=MA(CLOSE,5);
MA2:=MA(CLOSE,10);
MA3:=MA(CLOSE,20);
MA4:=MA(CLOSE,60);
ZGD:=HHV(H,60);
ZGD2:=CONST(ZGD);
ZDD:=LLV(L,60);
ZDD2:=CONST(ZDD);
GJ:=(C+H+L+O)/4;
明日阻力:=L+(GJ-L)+(C-L);
明日支撑:=L+(C-GJ);
KOH:=L>REF(H,1);
KOL:=H<REF(L,1);
HIF:=L>REF(H,BARSLAST(KOH)+1);
NHIF:=L<=REF(H,BARSLAST(KOH)+1);
LIF:=H<REF(L,BARSLAST(KOL)+1);
NLIF:=H>=REF(L,BARSLAST(KOL)+1);
下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);
RRRSV:=SMA(下档线,3,1);
KKK:=SMA(RRRSV,3,1);
DDDDD:=((3 * RRRSV) - (2 * KKK));
JJ12:=(((CLOSE - LLV(LOW,55)) / (HHV(HIGH,55) - LLV(LOW,55))) * 100);
RSV24:=SMA(JJ12,3,1);
K24:=SMA(RSV24,3,1);
D24:=((3 * RSV24) - (2 * K24));
压力2:=IF(CROSS(D24,DDDDD),HIGH,REF(HIGH,BARSLAST(CROSS(D24,DDDDD)))),COLORFFFFFF;
底部:=LLV(HIGH,30),COLOR00FF00;
AA:=REF(H,N)=HHV(H,2*N+1);
AA1:=REF(L,N)=LLV(L,2*N+1);
QY:=BACKSET(AA,N+1); QY1:=BACKSET(AA1,N+1);
CC:=FILTER(QY,N) AND H=HHV(H,N+1); CC1:=FILTER(QY1,N) AND L=LLV(L,N+1);
DDD:=BARSLAST(CC); DD1:=BARSLAST(CC1);
GDTS:=IF(CC,CURRBARSCOUNT,0); DDTS:=IF(CC1,CURRBARSCOUNT,0);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS); DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
GDCS1:=CONST(DINGBUTS); DDCS1:=CONST(DDTS1);
GDCS13:=CONST(REF(HIGH,GDCS1-1)); DDCS13:=CONST(REF(L,DDCS1-1));
DINGBUTS1:=REF(DINGBUTS,DDD+1); DDTS2:=REF(DDTS1,DD1+1);
GDCS2:=CONST(DINGBUTS1); DDCS2:=CONST(DDTS2);
GDCS23:=CONST(REF(HIGH,DINGBUTS1-1)); DDCS23:=CONST(REF(L,DDTS2-1));
XG1:=BACKSET(ISLASTBAR,GDCS1); XD1:=BACKSET(ISLASTBAR,DDCS1);
XG2:=BACKSET(ISLASTBAR,DINGBUTS1); XD2:=BACKSET(ISLASTBAR,DDTS2);
XDD:=IF(DDCS13<=DDCS23,XD1,XD2);
M:=INTPART(3*N/5);
AAA:=REF(H,M)=HHV(H,2*M+1);
QYY:=BACKSET(AAA,M+1);
CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);
DDDD:=BARSLAST(CCC),NODRAW;
GDTSS:=IF(CCC,CURRBARSCOUNT,0);
DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS);
GDCS11:=CONST(DINGBUTSS);
DINGBUTS11:=REF(DINGBUTSS,DDDD+1);
GDCS22:=CONST(DINGBUTS11);
AA11:=REF(L,M)=LLV(L,2*M+1);
QY11:=BACKSET(AA11,M+1);
CC11:=FILTER(QY11,M) AND L=LLV(L,M+1);
DD11:=BARSLAST(CC11);
DDTSS:=IF(CC11,CURRBARSCOUNT,0);
DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);
DDCS11:=CONST(DDTS11);
DDTS22:=REF(DDTS11,DD11+1);
DDCS22:=CONST(DDTS22);
高点压力M:=DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBARSCOUNT=GDCS11,H,1),COLORRED,LINETHICK1;
低点支撑M:=DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBARSCOUNT=DDCS11,L,1) COLORRED,LINETHICK1;
高点压力:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) ,COLORBLUE,LINETHICK1;
低点支撑:=DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1),COLORBLUE,LINETHICK1;
高:=CONST(MAX(MAX(MAX(MAX(MAX(MAX(ZGD2,高点压力),低点支撑),GDCS13),GDCS23),高点压力M)
,低点支撑M));
低:=CONST(MIN(MIN(MIN(MIN(MIN(MIN(ZDD2,DDCS23),DDCS13),低点支撑),高点压力),低点支撑M)
,高点压力M));
DRAWBAND(高,RGB(100,100,100),低,RGB(100,100,100));
DRAWBAND(高点压力,RGB(00,00,600),低点支撑,RGB(00,00,1000));
MA5:MA(CLOSE,5);
MA10:MA(CLOSE,10);
MA20:MA(CLOSE,20);
{MA30:MA(CLOSE,30);}
MA60:MA(CLOSE,60);
MA120:MA(CLOSE,120);
ZGSTAR:=(高点压力+低点支撑)/2;
ZGEND:=CONST((高点压力+低点支撑)/2);
STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);
中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLOR555555,LINETHICK1;
DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBARSCOUNT=GDCS11,H,1),COLORRED,LINETHICK1;
DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBARSCOUNT=DDCS11,L,1) COLORRED,LINETHICK1;
STICKLINE(XG2,GDCS23,GDCS23,0.5,1),COLORWHITE;
STICKLINE(XG1,GDCS13,GDCS13,0.5,1),COLORYELLOW;
STICKLINE(XD2,DDCS23,DDCS23,0.5,1),COLORMAGENTA;
STICKLINE(XD1,DDCS13,DDCS13,0.5,1),COLORCYAN;
DRAWKLINE(H,O,L,C);
{短期压力支撑 N1 1 100 5}
A1:=REF(H,N1)=HHV(H,2*N1+1);
B1:=FILTER(A1,N1);
C1:=BACKSET(B1,N1+1);
D1:=FILTER(C1,N1);{高点}
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1); S11:=R11>REF(R11,1);
短压:DRAWLINE(D1,H,S11,H,1),COLORFFFF00;
A2:=REF(L,N1)=LLV(L,2*N1+1);
B2:=FILTER(A2,N1);
C2:=BACKSET(B2,N1+1);
D2:=FILTER(C2,N1);{低点}
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1); U11:=T11>REF(T11,1);
短撑:DRAWLINE(D2,L,U11,L,1),COLORFFFF00;
{参数 N3=900101 1501231 1080918}{小/大/缺省}
{P2=900101 1501231 1080925}{小/大/缺省}
中心价:(H+L+O+C)/4,NODRAW,COLOR00FFFF;
价格:=REF(中心价,DATE=(N3+1)),NODRAW;
颈线:DRAWLINE(DATE=N3,中心价,DATE>N3,价格,1),NODRAW,COLOR40FF00{颈线};
颈线A:STICKLINE(颈线,颈线,颈线,0.5,1),COLOR40FF00;
价格2:=REF(中心价,DATE=(P2+1));
颈线B: DRAWLINE(DATE=P2,中心价,DATE>N3,价格2,1),NODRAW,COLOR8000FF;
颈B: STICKLINE(颈线B,颈线B,颈线B,0.5,1),COLOR8000FF;
{画线B}
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;
AAR:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QYQ:=BACKSET(AAR,HIGHN+1);
CCQ:=FILTER(QYQ,HIGHN) AND H=HHV(H,HIGHN+1);
DDDQQ:=BARSLAST(CCQ);
GDTSQ:=IF(CCQ,CURRBARSCOUNT,0);
DINGBU:=IF(DDDQQ,REF(H,DDDQQ),H);{顶部}
DINGBUTSQ:=IF(DDDQQ,REF(GDTSQ,DDDQQ),GDTSQ);
DINGBU1:=REF(DINGBU,DDDQQ+1);
GDCS1Q:=CONST(DINGBUTSQ);
DINGBUTS1Q:=REF(DINGBUTSQ,DDDQQ+1);
GDCS2Q:=CONST(DINGBUTS1Q);
DINGBU2:=REF(DINGBU1,DDDQQ+1);
MM:=IF(CURRBARSCOUNT>GDCS2Q,0,1);
高点压力2:DRAWLINE(CURRBARSCOUNT=GDCS2Q,H,CURRBARSCOUNT=GDCS1Q,H,1) COLORGREEN,LINETHICK1;
AA1Q:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1Q:=BACKSET(AA1Q,LOWN+1);
CC1Q:=FILTER(QY1Q,LOWN) AND L=LLV(L,LOWN+1);
DD1Q:=BARSLAST(CC1Q);
DDTSQ:=IF(CC1Q,CURRBARSCOUNT,0);
YDB:=IF(DD1Q,REF(L,DD1Q),L);
DDTS1Q:=IF(DD1Q,REF(DDTSQ,DD1Q),DDTSQ);
DDCS1Q:=CONST(DDTS1Q);
ZDB:=REF(YDB,DD1Q+1);
DDTS2Q:=REF(DDTS1Q,DD1Q+1);
DDCS2Q:=CONST(DDTS2Q);
低点支撑2:DRAWLINE(CURRBARSCOUNT=DDCS2Q,L,CURRBARSCOUNT=DDCS1Q,L,1),COLORFF00FF,LINETHICK1;
{SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100);
趋势:EMA(((SLOPE(CLOSE,21) * 20) + CLOSE),42),POINTDOT,COLORFF00FF,LINETHICK4;}
AA21:=AMOUNT/V;
BB1:=L<AA21*0.9;
CC21:=(C-REF(C,1))/REF(C,1)*100>1.2;
DD21:=L<MA(C,5)*0.921;
EE1:=V<MA(V,5)*1.5;
FF1:=BB1 AND CC21 AND DD21 AND EE1;
DRAWTEXT(FF1,(LOW* 0.99),'鼠'),COLOR4080FF;
A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑马线:=EMA(A51,5);A54:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趋势线:=(MA(3*SMA(A54,6,1)-2*SMA(SMA(A54,5,1),5,1),2));
DRAWTEXT(CROSS(趋势线,0)AND 黑马线<40,(HIGH* 0.97),'▲大马'),COLORYELLOW;
LC:=REF(CLOSE,1);
RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
FF:=EMA(CLOSE,3);MA15:=EMA(CLOSE,21);
STICKLINE(CROSS(FF,MA15),O,C,0.3,0),COLOR00FFFF;
STICKLINE(CROSS(88,RSI),O,C,0.3,0),COLOR113311;
VAR2:=LLV(LOW,27);
VAR3:=HHV(HIGH,34);
VAR4:=EMA((CLOSE-VAR2)/(VAR3-VAR2)*4,4)*25;
注意买:=IF((VAR4<10),80,100);
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
超跌:=IF(J<0,10,0);BDDD:=LLV(J,2)=LLV(J,8);
买入:=IF(CROSS(J,REF(J+0.01,1)) AND BDDD AND J<20,30,0);
DRAWTEXT(买入 AND 注意买=100 AND 超跌=0,LOW,'买'),COLORRED;
MTM:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
买:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);
DRAWTEXT(FILTER(买=1,5),LOW-0.03,'拉'),COLOR0000FF;
1531177317.png
|