支撑压力黄金柱主图指标
本帖最后由 股海小农民 于 2016-3-3 15:47 编辑**** Hidden Message *****
{撑压互换主图指标}
ZZZT:=IF((C-REF(C,1))*100/REF(C,1)>=(10-0.009*100/REF(C,1)),2,0) AND C=H;
DZZT:=IF((REF(C,1)-C)*100/REF(C,1)>=(10-0.009*100/REF(C,1)),2,0) AND C=L;
SP:=IF((C<100),C,(C/100));
DS:=INTPART(((4*(LOG(SP)/LOG(2)))+1));
HHH1:=((DS-1)/4);
长支撑:IF((C>100),(POW(2,HHH1)*100),POW(2,HHH1)),POINTDOT,LINETHICK4,COLORBROWN;
DRAWTEXT(ISLASTBAR,长支撑,'长支撑'),COLOR0000EE;
长压力:IF((C>100),(POW(2,(HHH1+(1/4)))*100),POW(2,(HHH1+(1/4)))),
POINTDOT,LINETHICK4,COLOR009900;
DRAWTEXT(ISLASTBAR,长压力,'长压力'),COLOREE0000;
{巨量平台}
ZZT:=REF(C,1)*1.1-C<0.01 AND H=C;
{STICKLINE( ZZT,C,O,2,0),COLORYELLOW;}
{走强线:EMA(COST(99),181),COLORYELLOW,LINETHICK2;}
巨量平台:REF(H,BARSLAST(V=HHV(VOL,120))),COLORRED,LINETHICK2;
XG:= NOT(REF(巨量平台,1)=巨量平台) AND ZZT;
DRAWTEXT(XG,L,'量爆'),COLORCYAN;
主升:=CROSS(C,巨量平台);
DRAWTEXT(主升,L,'↖主升'),COLORYELLOW;
DRAWTEXT(主升 AND ZZT,L,'↖超级主升'),COLORRED;
{高点低点画线}
G:=MA(C,5);
D:=MA(C,10);
HH:=REF(H,5)=HHV(H,11);
LL:=REF(L,5)=LLV(L,11);
FG01:=BACKSET(HH,6)>BACKSET(HH,5);
FD01:=BACKSET(LL,6)>BACKSET(LL,5);
FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,
IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));
FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01,
IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));
FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));
FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));
GP:=IF(FG0,H,DRAWNULL),CIRCLEDOT,COLORCYAN;
DP:=IF(FD0,L,DRAWNULL),CIRCLEDOT,COLORCYAN;
GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);
DQ:=H<REF(L,1) AND DAY!=REF(DAY,1);
GQL:=REF(L,BARSLAST(GQ));
DQH:=REF(H,BARSLAST(DQ));
FGH:=REF(H,BARSLAST(FG0));
FGL:=REF(L,BARSLAST(FG0));
FGH1:=REF(H,BARSLAST(FG0)+1);
FGL1:=REF(L,BARSLAST(FG0)+1);
FGH2:=REF(H,BARSLAST(FG0)+2);
FGL2:=REF(L,BARSLAST(FG0)+2);
FDH:=REF(H,BARSLAST(FD0));
FDL:=REF(L,BARSLAST(FD0));
FDH1:=REF(H,BARSLAST(FD0)+1);
FDL1:=REF(L,BARSLAST(FD0)+1);
FDH2:=REF(H,BARSLAST(FD0)+2);
FDL2:=REF(L,BARSLAST(FD0)+2);
FGZH:=IF(FGL<=FGL1,FGH2,FGH1);
FGZL:=IF(FGH1<FGL,FGL,IF(FGL<=FGL1,FGL2,FGL1));
FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));
FDZL:=IF(FDH>=FDH1,FDL2,FDL1);
FG1:=FGH>FDZH AND FG0;
FD1:=FDL<FGZL AND FD0;
FG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;
FD:=FD1 AND FDL<FGL AND FDH<FGH AND FDH1<FGH;
BH0:=(H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1));
BHG:=COUNT(BH0,BARSLAST(FD0));
BHD:=COUNT(BH0,BARSLAST(FG0));
BGQ:=COUNT(GQ,BARSLAST(FD0));
BDQ:=COUNT(DQ,BARSLAST(FG0));
BK0:=IF(BHG>0,BHG+2,IF(BHD,BHD+2,3));
BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));
G1X:=(FG AND BARSLAST(FD)>BK);
D1X:=(FD AND BARSLAST(FG)>BK);
G1:=(FG0 AND REF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))
OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 AND REF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));
D1:=(FD0 AND REF(L,BARSLAST(FD0))<=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)>BARSLAST(D1X))
OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 AND REF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));
G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G1)),REF(H,BARSLAST(D1))),;
D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1)),REF(L,BARSLAST(G1)));
G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);
D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND L<REF(L,1) AND BARSLAST(G1)>BARSLAST(D1);
G3:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2)) AND BARSLAST(D2)>BARSLAST(G2));
D3:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))<REF(L,BARSLAST(D2)) AND BARSLAST(G2)>BARSLAST(D2));
GPB:IF(G1X,H,DRAWNULL),CIRCLEDOT,COLORYELLOW;
DPB:IF(D1X,L,DRAWNULL),CIRCLEDOT,COLORYELLOW;
MMM:="MA.MA1"(5),NODRAW,COLORRED;
NN:=G3;UU:=D3;
近期最低:DRAWLINE(UU,L,NN, H,0),COLORYELLOW;
近期最高:DRAWLINE(NN,H,UU, L,0),COLOR00FF00;
DRAWNUMBER(UU,L*0.99,L);
DRAWNUMBER(NN,H*1.02,H);
DRAWLINE(UU,L,REF(UU,1),REF(L,1),1),COLOR00FF00,LINETHICK1;
DRAWLINE(NN,H,REF(NN,1),REF(H,1),1),COLORFF00FF,LINETHICK1;
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;
AAB:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
{HIGHN日前的最高价=2*HIGHN+1日内最高价的最高值}
QY:=BACKSET(AAB,HIGHN+1);{若AA则将最近HIGHN+1周期置为1}
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
{QY的HIGHN日过滤 AND 最高价=HIGHN+1日内最高价的最高值}
DRAWICON(CC,H*1.005,2);
DDD:=BARSLAST(CC);{上次CC距今天数}
GDTS:=IF(CC,CURRBARSCOUNT,0);{如果CC,返回到最后交易日的周,否则返回0}
DINGBU:=IF(DDD,REF(H,DDD),H);{顶部}
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DINGBU1:=REF(DINGBU,DDD+1);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=REF(DINGBU1,DDD+1);
MMMM:=IF(CURRBARSCOUNT>GDCS2,0,1);
高点压力:DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) COLORGREEN,DOTLINE;
压力A:DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1),COLOR0055FF,DOTLINE;
压力B:DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1),COLORYELLOW,DOTLINE;
AAA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AAA1,LOWN+1);
CCC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
{DRAWICON(CC1,L*0.98,1);}
DD1:=BARSLAST(CCC1);
DDTS:=IF(CCC1,CURRBARSCOUNT,0);
YDB:=IF(DD1,REF(L,DD1),L);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
ZDB:=REF(YDB,DD1+1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
低点支撑:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORRED,DOTLINE;
ZGSTAR:=(高点压力+低点支撑)/2;
ZGEND:=CONST((高点压力+低点支撑)/2);
STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);
中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),POINTDOT,COLORFFBBFF,LINETHICK1;
TTT:=6;
A11:=REF(HIGH,6)=HHV(HIGH,2*TTT+1);
B11:=FILTER(A11,TTT);
C11:=BACKSET(B11,TTT+1);
D11:=FILTER(C11,TTT);
A22:=REF(LOW,TTT)=LLV(LOW,2*TTT+1);
B22:=FILTER(A22,TTT);
C22:=BACKSET(B22,TTT+1);
D22:=FILTER(C22,TTT);
E1:=(REF(LLV(LOW,2*TTT),1)+REF(HHV(HIGH,2*TTT),1))/2;
E2:=(HIGH+LOW)/2;
H1:=(D11 AND NOT(D22 AND E1>=E2)) OR BARSTATUS OR BARSCOUNT(CLOSE)=1;
L11:=(D22 AND NOT(D11 AND E1<E2));
H2:=D11 AND NOT(D22 AND E1>=E2);
X1:=REF(BARSLAST(H1),1)+1;
F1:=BACKSET(H1 AND COUNT(L11,X1)>0,LLVBARS(IF(L11,LOW,10000),X1));
GG1:=F1>REF(F1,1); I1:=BACKSET(GG1,2);
LDD:=I1>REF(I1,1);
LL2:=LDD OR BARSTATUS OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(LL2),1)+1;
F2:=BACKSET(LL2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
GG2:=F2>REF(F2,1);
I2:=BACKSET(GG2,2);
HDD:=I2>REF(I2,1);
UUU:=BACKSET(BARSTATUS,BARSLAST(LDD)+1);
VV:=UUU>REF(UUU,1);
WW:=BACKSET(VV,REF(BARSLAST(LDD),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(BARSTATUS,BARSLAST(HDD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HDD),1)+2);
XX2:=WW2>REF(WW2,1);
近低A:REF(L,BARSLAST(VV)),COLORWHITE,LINETHICK1,DOTLINE;
近低B:REF(L,BARSLAST(XX)),COLORLIRED,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=8,高点压力,STRCAT('压力延伸:',CON2STR(高点压力,2))),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=8,低点支撑,STRCAT('支撑延伸:',CON2STR(低点支撑,2))),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=15,中轨,STRCAT('中轨:',CON2STR(中轨,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=20,压力A*0.995,STRCAT('压力A:',CON2STR(压力A,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=12,压力B*0.995,STRCAT('压力B:',CON2STR(压力B,2))),COLORBLUE;
DRAWTEXT(CURRBARSCOUNT=12,近低A*1.005,STRCAT('←近低A:',CON2STR(近低A,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=20,近低B*1.005,STRCAT('←近低B:',CON2STR(近低B,2))),COLOR0018D8;
{把涨幅和跌幅在4%以上的K线换个颜色显示}
STICKLINE((C-REF(C,1))/REF(C,1)*100>=4,C,O,3,0),COLOR7F00FF;
STICKLINE((C-REF(C,1))/REF(C,1)*100<-4,C,O,3,0),COLORFF7F00;
{涨停和跌停K线加色}
STICKLINE(C<0.905*REF(C,1),C,O,3,0),COLOR00FF00;
STICKLINE(C>1.095*REF(C,1),C,O,3,0),COLORRED;
{倍量加黄色}
STICKLINE(V/REF(V,1)>1.95,OPEN,CLOSE,1.0,0),COLOR00FFFF;
{撑压互换主图指标}
ZZZT:=IF((C-REF(C,1))*100/REF(C,1)>=(10-0.009*100/REF(C,1)),2,0) AND C=H;
DZZT:=IF((REF(C,1)-C)*100/REF(C,1)>=(10-0.009*100/REF(C,1)),2,0) AND C=L;
SP:=IF((C<100),C,(C/100));
DS:=INTPART(((4*(LOG(SP)/LOG(2)))+1));
HHH1:=((DS-1)/4);
长支撑:IF((C>100),(POW(2,HHH1)*100),POW(2,HHH1)),POINTDOT,LINETHICK4,COLORBROWN;
DRAWTEXT(ISLASTBAR,长支撑,'长支撑'),COLOR0000EE;
长压力:IF((C>100),(POW(2,(HHH1+(1/4)))*100),POW(2,(HHH1+(1/4)))),
POINTDOT,LINETHICK4,COLOR009900;
DRAWTEXT(ISLASTBAR,长压力,'长压力'),COLOREE0000;
{巨量平台}
ZZT:=REF(C,1)*1.1-C<0.01 AND H=C;
{STICKLINE( ZZT,C,O,2,0),COLORYELLOW;}
{走强线:EMA(COST(99),181),COLORYELLOW,LINETHICK2;}
巨量平台:REF(H,BARSLAST(V=HHV(VOL,120))),COLORRED,LINETHICK2;
XG:= NOT(REF(巨量平台,1)=巨量平台) AND ZZT;
DRAWTEXT(XG,L,'量爆'),COLORCYAN;
主升:=CROSS(C,巨量平台);
DRAWTEXT(主升,L,'↖主升'),COLORYELLOW;
DRAWTEXT(主升 AND ZZT,L,'↖超级主升'),COLORRED;
{高点低点画线}
G:=MA(C,5);
D:=MA(C,10);
HH:=REF(H,5)=HHV(H,11);
LL:=REF(L,5)=LLV(L,11);
FG01:=BACKSET(HH,6)>BACKSET(HH,5);
FD01:=BACKSET(LL,6)>BACKSET(LL,5);
FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,
IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));
FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01,
IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));
FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));
FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));
GP:=IF(FG0,H,DRAWNULL),CIRCLEDOT,COLORCYAN;
DP:=IF(FD0,L,DRAWNULL),CIRCLEDOT,COLORCYAN;
GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);
DQ:=H<REF(L,1) AND DAY!=REF(DAY,1);
GQL:=REF(L,BARSLAST(GQ));
DQH:=REF(H,BARSLAST(DQ));
FGH:=REF(H,BARSLAST(FG0));
FGL:=REF(L,BARSLAST(FG0));
FGH1:=REF(H,BARSLAST(FG0)+1);
FGL1:=REF(L,BARSLAST(FG0)+1);
FGH2:=REF(H,BARSLAST(FG0)+2);
FGL2:=REF(L,BARSLAST(FG0)+2);
FDH:=REF(H,BARSLAST(FD0));
FDL:=REF(L,BARSLAST(FD0));
FDH1:=REF(H,BARSLAST(FD0)+1);
FDL1:=REF(L,BARSLAST(FD0)+1);
FDH2:=REF(H,BARSLAST(FD0)+2);
FDL2:=REF(L,BARSLAST(FD0)+2);
FGZH:=IF(FGL<=FGL1,FGH2,FGH1);
FGZL:=IF(FGH1<FGL,FGL,IF(FGL<=FGL1,FGL2,FGL1));
FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));
FDZL:=IF(FDH>=FDH1,FDL2,FDL1);
FG1:=FGH>FDZH AND FG0;
FD1:=FDL<FGZL AND FD0;
FG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;
FD:=FD1 AND FDL<FGL AND FDH<FGH AND FDH1<FGH;
BH0:=(H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1));
BHG:=COUNT(BH0,BARSLAST(FD0));
BHD:=COUNT(BH0,BARSLAST(FG0));
BGQ:=COUNT(GQ,BARSLAST(FD0));
BDQ:=COUNT(DQ,BARSLAST(FG0));
BK0:=IF(BHG>0,BHG+2,IF(BHD,BHD+2,3));
BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));
G1X:=(FG AND BARSLAST(FD)>BK);
D1X:=(FD AND BARSLAST(FG)>BK);
G1:=(FG0 AND REF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))
OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 AND REF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));
D1:=(FD0 AND REF(L,BARSLAST(FD0))<=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)>BARSLAST(D1X))
OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 AND REF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));
G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G1)),REF(H,BARSLAST(D1))),;
D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1)),REF(L,BARSLAST(G1)));
G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);
D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND L<REF(L,1) AND BARSLAST(G1)>BARSLAST(D1);
G3:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2)) AND BARSLAST(D2)>BARSLAST(G2));
D3:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))<REF(L,BARSLAST(D2)) AND BARSLAST(G2)>BARSLAST(D2));
GPB:IF(G1X,H,DRAWNULL),CIRCLEDOT,COLORYELLOW;
DPB:IF(D1X,L,DRAWNULL),CIRCLEDOT,COLORYELLOW;
MMM:="MA.MA1"(5),NODRAW,COLORRED;
NN:=G3;UU:=D3;
近期最低RAWLINE(UU,L,NN, H,0),COLORYELLOW;
近期最高RAWLINE(NN,H,UU, L,0),COLOR00FF00;
DRAWNUMBER(UU,L*0.99,L);
DRAWNUMBER(NN,H*1.02,H);
DRAWLINE(UU,L,REF(UU,1),REF(L,1),1),COLOR00FF00,LINETHICK1;
DRAWLINE(NN,H,REF(NN,1),REF(H,1),1),COLORFF00FF,LINETHICK1;
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;
AAB:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
{HIGHN日前的最高价=2*HIGHN+1日内最高价的最高值}
QY:=BACKSET(AAB,HIGHN+1);{若AA则将最近HIGHN+1周期置为1}
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
{QY的HIGHN日过滤 AND 最高价=HIGHN+1日内最高价的最高值}
DRAWICON(CC,H*1.005,2);
DDD:=BARSLAST(CC);{上次CC距今天数}
GDTS:=IF(CC,CURRBARSCOUNT,0);{如果CC,返回到最后交易日的周,否则返回0}
DINGBU:=IF(DDD,REF(H,DDD),H);{顶部}
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DINGBU1:=REF(DINGBU,DDD+1);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=REF(DINGBU1,DDD+1);
MMMM:=IF(CURRBARSCOUNT>GDCS2,0,1);
高点压力RAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) COLORGREEN,DOTLINE;
压力ARAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1),COLOR0055FF,DOTLINE;
压力BRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1),COLORYELLOW,DOTLINE;
AAA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AAA1,LOWN+1);
CCC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
{DRAWICON(CC1,L*0.98,1);}
DD1:=BARSLAST(CCC1);
DDTS:=IF(CCC1,CURRBARSCOUNT,0);
YDB:=IF(DD1,REF(L,DD1),L);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
ZDB:=REF(YDB,DD1+1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
低点支撑RAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORRED,DOTLINE;
ZGSTAR:=(高点压力+低点支撑)/2;
ZGEND:=CONST((高点压力+低点支撑)/2);
STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);
中轨RAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),POINTDOT,COLORFFBBFF,LINETHICK1;
TTT:=6;
A11:=REF(HIGH,6)=HHV(HIGH,2*TTT+1);
B11:=FILTER(A11,TTT);
C11:=BACKSET(B11,TTT+1);
D11:=FILTER(C11,TTT);
A22:=REF(LOW,TTT)=LLV(LOW,2*TTT+1);
B22:=FILTER(A22,TTT);
C22:=BACKSET(B22,TTT+1);
D22:=FILTER(C22,TTT);
E1:=(REF(LLV(LOW,2*TTT),1)+REF(HHV(HIGH,2*TTT),1))/2;
E2:=(HIGH+LOW)/2;
H1:=(D11 AND NOT(D22 AND E1>=E2)) OR BARSTATUS OR BARSCOUNT(CLOSE)=1;
L11:=(D22 AND NOT(D11 AND E1<E2));
H2:=D11 AND NOT(D22 AND E1>=E2);
X1:=REF(BARSLAST(H1),1)+1;
F1:=BACKSET(H1 AND COUNT(L11,X1)>0,LLVBARS(IF(L11,LOW,10000),X1));
GG1:=F1>REF(F1,1); I1:=BACKSET(GG1,2);
LDD:=I1>REF(I1,1);
LL2:=LDD OR BARSTATUS OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(LL2),1)+1;
F2:=BACKSET(LL2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
GG2:=F2>REF(F2,1);
I2:=BACKSET(GG2,2);
HDD:=I2>REF(I2,1);
UUU:=BACKSET(BARSTATUS,BARSLAST(LDD)+1);
VV:=UUU>REF(UUU,1);
WW:=BACKSET(VV,REF(BARSLAST(LDD),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(BARSTATUS,BARSLAST(HDD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HDD),1)+2);
XX2:=WW2>REF(WW2,1);
近低A:REF(L,BARSLAST(VV)),COLORWHITE,LINETHICK1,DOTLINE;
近低B:REF(L,BARSLAST(XX)),COLORLIRED,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=8,高点压力,STRCAT('压力延伸:',CON2STR(高点压力,2))),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=8,低点支撑,STRCAT('支撑延伸:',CON2STR(低点支撑,2))),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=15,中轨,STRCAT('中轨:',CON2STR(中轨,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=20,压力A*0.995,STRCAT('压力A:',CON2STR(压力A,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=12,压力B*0.995,STRCAT('压力B:',CON2STR(压力B,2))),COLORBLUE;
DRAWTEXT(CURRBARSCOUNT=12,近低A*1.005,STRCAT('←近低A:',CON2STR(近低A,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=20,近低B*1.005,STRCAT('←近低B:',CON2STR(近低B,2))),COLOR0018D8;
{把涨幅和跌幅在4%以上的K线换个颜色显示}
STICKLINE((C-REF(C,1))/REF(C,1)*100>=4,C,O,3,0),COLOR7F00FF;
STICKLINE((C-REF(C,1))/REF(C,1)*100<-4,C,O,3,0),COLORFF7F00;
{涨停和跌停K线加色}
STICKLINE(C<0.905*REF(C,1),C,O,3,0),COLOR00FF00;
STICKLINE(C>1.095*REF(C,1),C,O,3,0),COLORRED;
{倍量加黄色}
STICKLINE(V/REF(V,1)>1.95,OPEN,CLOSE,1.0,0),COLOR00FFFF; ZZZT:=IF((C-REF(C,1))*100/REF(C,1)>=(10-0.009*100/REF(C,1)),2,0) AND C=H;
DZZT:=IF((REF(C,1)-C)*100/REF(C,1)>=(10-0.009*100/REF(C,1)),2,0) AND C=L;
SP:=IF((C<100),C,(C/100));
DS:=INTPART(((4*(LOG(SP)/LOG(2)))+1));
HHH1:=((DS-1)/4);
长支撑:IF((C>100),(POW(2,HHH1)*100),POW(2,HHH1)),POINTDOT,LINETHICK4,COLORBROWN;
DRAWTEXT(ISLASTBAR,长支撑,'长支撑'),COLOR0000EE;
长压力:IF((C>100),(POW(2,(HHH1+(1/4)))*100),POW(2,(HHH1+(1/4)))),
POINTDOT,LINETHICK4,COLOR009900;
DRAWTEXT(ISLASTBAR,长压力,'长压力'),COLOREE0000;
{巨量平台}
ZZT:=REF(C,1)*1.1-C<0.01 AND H=C;
{STICKLINE( ZZT,C,O,2,0),COLORYELLOW;}
{走强线:EMA(COST(99),181),COLORYELLOW,LINETHICK2;}
巨量平台:REF(H,BARSLAST(V=HHV(VOL,120))),COLORRED,LINETHICK2;
XG:= NOT(REF(巨量平台,1)=巨量平台) AND ZZT;
DRAWTEXT(XG,L,'量爆'),COLORCYAN;
主升:=CROSS(C,巨量平台);
DRAWTEXT(主升,L,'↖主升'),COLORYELLOW;
DRAWTEXT(主升 AND ZZT,L,'↖超级主升'),COLORRED;
{高点低点画线}
G:=MA(C,5);
D:=MA(C,10);
HH:=REF(H,5)=HHV(H,11);
LL:=REF(L,5)=LLV(L,11);
FG01:=BACKSET(HH,6)>BACKSET(HH,5);
FD01:=BACKSET(LL,6)>BACKSET(LL,5);
FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,
IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));
FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01,
IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));
FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));
FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));
GP:=IF(FG0,H,DRAWNULL),CIRCLEDOT,COLORCYAN;
DP:=IF(FD0,L,DRAWNULL),CIRCLEDOT,COLORCYAN;
GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);
DQ:=H<REF(L,1) AND DAY!=REF(DAY,1);
GQL:=REF(L,BARSLAST(GQ));
DQH:=REF(H,BARSLAST(DQ));
FGH:=REF(H,BARSLAST(FG0));
FGL:=REF(L,BARSLAST(FG0));
FGH1:=REF(H,BARSLAST(FG0)+1);
FGL1:=REF(L,BARSLAST(FG0)+1);
FGH2:=REF(H,BARSLAST(FG0)+2);
FGL2:=REF(L,BARSLAST(FG0)+2);
FDH:=REF(H,BARSLAST(FD0));
FDL:=REF(L,BARSLAST(FD0));
FDH1:=REF(H,BARSLAST(FD0)+1);
FDL1:=REF(L,BARSLAST(FD0)+1);
FDH2:=REF(H,BARSLAST(FD0)+2);
FDL2:=REF(L,BARSLAST(FD0)+2);
FGZH:=IF(FGL<=FGL1,FGH2,FGH1);
FGZL:=IF(FGH1<FGL,FGL,IF(FGL<=FGL1,FGL2,FGL1));
FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));
FDZL:=IF(FDH>=FDH1,FDL2,FDL1);
FG1:=FGH>FDZH AND FG0;
FD1:=FDL<FGZL AND FD0;
FG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;
FD:=FD1 AND FDL<FGL AND FDH<FGH AND FDH1<FGH;
BH0:=(H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1));
BHG:=COUNT(BH0,BARSLAST(FD0));
BHD:=COUNT(BH0,BARSLAST(FG0));
BGQ:=COUNT(GQ,BARSLAST(FD0));
BDQ:=COUNT(DQ,BARSLAST(FG0));
BK0:=IF(BHG>0,BHG+2,IF(BHD,BHD+2,3));
BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));
G1X:=(FG AND BARSLAST(FD)>BK);
D1X:=(FD AND BARSLAST(FG)>BK);
G1:=(FG0 AND REF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))
OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 AND REF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));
D1:=(FD0 AND REF(L,BARSLAST(FD0))<=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)>BARSLAST(D1X))
OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 AND REF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));
G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G1)),REF(H,BARSLAST(D1))),;
D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1)),REF(L,BARSLAST(G1)));
G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);
D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND L<REF(L,1) AND BARSLAST(G1)>BARSLAST(D1);
G3:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2)) AND BARSLAST(D2)>BARSLAST(G2));
D3:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))<REF(L,BARSLAST(D2)) AND BARSLAST(G2)>BARSLAST(D2));
GPB:IF(G1X,H,DRAWNULL),CIRCLEDOT,COLORYELLOW;
DPB:IF(D1X,L,DRAWNULL),CIRCLEDOT,COLORYELLOW;
MMM:="MA.MA1"(5),NODRAW,COLORRED;
NN:=G3;UU:=D3;
近期最低RAWLINE(UU,L,NN, H,0),COLORYELLOW;
近期最高RAWLINE(NN,H,UU, L,0),COLOR00FF00;
DRAWNUMBER(UU,L*0.99,L);
DRAWNUMBER(NN,H*1.02,H);
DRAWLINE(UU,L,REF(UU,1),REF(L,1),1),COLOR00FF00,LINETHICK1;
DRAWLINE(NN,H,REF(NN,1),REF(H,1),1),COLORFF00FF,LINETHICK1;
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;
AAB:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
{HIGHN日前的最高价=2*HIGHN+1日内最高价的最高值}
QY:=BACKSET(AAB,HIGHN+1);{若AA则将最近HIGHN+1周期置为1}
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
{QY的HIGHN日过滤 AND 最高价=HIGHN+1日内最高价的最高值}
DRAWICON(CC,H*1.005,2);
DDD:=BARSLAST(CC);{上次CC距今天数}
GDTS:=IF(CC,CURRBARSCOUNT,0);{如果CC,返回到最后交易日的周,否则返回0}
DINGBU:=IF(DDD,REF(H,DDD),H);{顶部}
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DINGBU1:=REF(DINGBU,DDD+1);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=REF(DINGBU1,DDD+1);
MMMM:=IF(CURRBARSCOUNT>GDCS2,0,1);
高点压力RAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) COLORGREEN,DOTLINE;
压力ARAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1),COLOR0055FF,DOTLINE;
压力BRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1),COLORYELLOW,DOTLINE;
AAA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AAA1,LOWN+1);
CCC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
{DRAWICON(CC1,L*0.98,1);}
DD1:=BARSLAST(CCC1);
DDTS:=IF(CCC1,CURRBARSCOUNT,0);
YDB:=IF(DD1,REF(L,DD1),L);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
ZDB:=REF(YDB,DD1+1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
低点支撑RAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORRED,DOTLINE;
ZGSTAR:=(高点压力+低点支撑)/2;
ZGEND:=CONST((高点压力+低点支撑)/2);
STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);
中轨RAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),POINTDOT,COLORFFBBFF,LINETHICK1;
TTT:=6;
A11:=REF(HIGH,6)=HHV(HIGH,2*TTT+1);
B11:=FILTER(A11,TTT);
C11:=BACKSET(B11,TTT+1);
D11:=FILTER(C11,TTT);
A22:=REF(LOW,TTT)=LLV(LOW,2*TTT+1);
B22:=FILTER(A22,TTT);
C22:=BACKSET(B22,TTT+1);
D22:=FILTER(C22,TTT);
E1:=(REF(LLV(LOW,2*TTT),1)+REF(HHV(HIGH,2*TTT),1))/2;
E2:=(HIGH+LOW)/2;
H1:=(D11 AND NOT(D22 AND E1>=E2)) OR BARSTATUS OR BARSCOUNT(CLOSE)=1;
L11:=(D22 AND NOT(D11 AND E1<E2));
H2:=D11 AND NOT(D22 AND E1>=E2);
X1:=REF(BARSLAST(H1),1)+1;
F1:=BACKSET(H1 AND COUNT(L11,X1)>0,LLVBARS(IF(L11,LOW,10000),X1));
GG1:=F1>REF(F1,1); I1:=BACKSET(GG1,2);
LDD:=I1>REF(I1,1);
LL2:=LDD OR BARSTATUS OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(LL2),1)+1;
F2:=BACKSET(LL2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
GG2:=F2>REF(F2,1);
I2:=BACKSET(GG2,2);
HDD:=I2>REF(I2,1);
UUU:=BACKSET(BARSTATUS,BARSLAST(LDD)+1);
VV:=UUU>REF(UUU,1);
WW:=BACKSET(VV,REF(BARSLAST(LDD),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(BARSTATUS,BARSLAST(HDD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HDD),1)+2);
XX2:=WW2>REF(WW2,1);
近低A:REF(L,BARSLAST(VV)),COLORWHITE,LINETHICK1,DOTLINE;
近低B:REF(L,BARSLAST(XX)),COLORLIRED,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=8,高点压力,STRCAT('压力延伸:',CON2STR(高点压力,2))),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=8,低点支撑,STRCAT('支撑延伸:',CON2STR(低点支撑,2))),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=15,中轨,STRCAT('中轨:',CON2STR(中轨,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=20,压力A*0.995,STRCAT('压力A:',CON2STR(压力A,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=12,压力B*0.995,STRCAT('压力B:',CON2STR(压力B,2))),COLORBLUE;
DRAWTEXT(CURRBARSCOUNT=12,近低A*1.005,STRCAT('←近低A:',CON2STR(近低A,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=20,近低B*1.005,STRCAT('←近低B:',CON2STR(近低B,2))),COLOR0018D8;
{把涨幅和跌幅在4%以上的K线换个颜色显示}
STICKLINE((C-REF(C,1))/REF(C,1)*100>=4,C,O,3,0),COLOR7F00FF;
STICKLINE((C-REF(C,1))/REF(C,1)*100<-4,C,O,3,0),COLORFF7F00;
{涨停和跌停K线加色}
STICKLINE(C<0.905*REF(C,1),C,O,3,0),COLOR00FF00;
STICKLINE(C>1.095*REF(C,1),C,O,3,0),COLORRED;
{倍量加黄色}
STICKLINE(V/REF(V,1)>1.95,OPEN,CLOSE,1.0,0),COLOR00FFFF;
底部买入:IF(X_4=1,30,0),NODRAW;
STICKLINE(底部买入,0,10,0.1,0),COLORWHITE;
STICKLINE(底部买入,0,8,7,0),COLORBLUE;
STICKLINE(底部买入,0,8.02,6.86,0),COLORBLUE;
STICKLINE(底部买入,0,8.04,6.72,0),COLORBLUE;
S
STICKLINE(底部买入,0,8.2,5.6,0),COLORBLUE;
STICKLINE(底部买入,0,8.22,5.46,0),COLORBLUE;
STICKLINE(底部买入,0,8.24,5.32,0),COLORBLUE;
STICKLINE(底部买入,0,8.26,5.18,0),COLORBLUE;
STICKLINE(底部买入,0,8.28,5.04,0),COLORBLUE;
STICKLINE(底部买入,0,8.3,4.9,0),COLORBLUE;
STICKLINE(底部买入,0,8.32,4.76,0),COLORBLUE;
STICKLINE(底部买入,0,8.34,4.62,0),COLORBLUE;
STICKLINE(底部买入,0,8.36,4.48,0),COLORBLUE;
STICKLINE(底部买入,0,8.38,4.34,0),COLORBLUE;
STICKLINE(底部买入,0,8.4,4.2,0),COLORBLUE;
STICKLINE(底部买入,0,8.42,4.06,0),COLORBLUE;
STICKLINE(底部买入,0,8.44,3.92,0),COLORBLUE;
STICKLINE(底部买入,0,8.46,3.78,0),COLORBLUE;
STICKLINE(底部买入,0,8.48,3.64,0),COLORBLUE;
STICKLINE(底部买入,0,8.5,3.5,0),COLORBLUE;
STICKLINE(底部买入,0,8.52,3.36,0),COLORBLUE;
STICKLINE(底部买入,0,8.54,3.22,0),COLORBLUE;
STICKLINE(底部买入,0,8.56,3.08,0),COLORBLUE;
STICKLINE(底部买入,0,8.58,2.94,0),COLORBLUE;
当前公式 : 撑压互换 (指标画线公式)
错误句 :
详细信息 : 引用指标时出现自我调用的情况或者未通过编译!
错误起始位置 : 3459 ; 长度: 2
:victory::victory: 谢谢你的分享 谢谢楼主的分享。 支撑压力黄金柱主图指标 謝謝提供。 娇婕 发表于 2016-3-3 16:14
当前公式 : 撑压互换 (指标画线公式)
错误句 :
详细信息 : 引用指标时出现自我调用的情况或者未通过 ...
股市跌,股民悲;股灾多,中国痛!股市兴,中国兴;股民喜,中国福! 谢谢楼主的分享。 非常感谢楼主的无私奉献! 谢谢楼主共享~~~~~~~~~ O(∩_∩)O~