七夕主图(布林线、趋势线)
m:=5;
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)
or ref(c,1)=llv(c,4) and c
or ref(c,2)=llv(c,4) and ref(c,1)<>hhv(c,4) and c
or ref(c,3)=llv(c,4) and c
跌:varbQ,coloraaaaaa,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,1);]
买:varcQ,color00ffff,LINETHICK0;
vardQ:=ref(c,1)=hhv(c,4) and c
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
抛:vardQ,color00ff00,LINETHICK0;
gj:=if(c=INDEXC,(INDEXC+INDEXh+INDEXl+INDEXO)/4,AMOUNT/(v+0.01)/100);
明日阻力:=l+(gj-l)+(c-l);
明日支撑:=l+(c-gj);
阻力:REF(明日阻力,1),LINETHICK0,ColorFF0000;
支撑:REF(明日支撑,1),LINETHICK0,ColorFF00FF;
下档线:=(((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(var9Q,c,(o+c)/2,7,0),color000077;
stickline(var9Q,c,(o+c)/2,6,0),color000099;
stickline(var9Q,c,(o+c)/2,5,0),color0000bb;
stickline(var9Q,c,(o+c)/2,4,0),color0000dd;
stickline(var9Q,c,(o+c)/2,3,0),color0000ff;
stickline(var9Q,c,(o+c)/2,1,0),COLORffffff;
stickline(varaQ,c,(o+c)/2,7,0),colorff33ff;
stickline(varaQ,c,(o+c)/2,6,0),colorff55ff;
stickline(varaQ,c,(o+c)/2,5,0),colorff77ff;
stickline(varaQ,c,(o+c)/2,4,0),colorff99ff;
stickline(varaQ,c,(o+c)/2,3,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),color00aaaa;
stickline(varcQ,o,(o+c)/2,6,0),color00bbbb;
stickline(varcQ,o,(o+c)/2,5,0),color00cccc;
stickline(varcQ,o,(o+c)/2,4,0),color00dddd;
stickline(varcQ,o,(o+c)/2,3,0),color00eeee;
stickline(varcQ,o,(o+c)/2,2,0),color00ffff;
stickline(varcQ,o,(o+c)/2,1,0),colorffffff;
stickline(vardQ,o,(o+c)/2,7,0),color003300;
stickline(vardQ,o,(o+c)/2,6,0),color005500;
stickline(vardQ,o,(o+c)/2,5,0),color007700;
stickline(vardQ,o,(o+c)/2,4,0),color009900;
stickline(vardQ,o,(o+c)/2,3,0),color00bb00;
stickline(vardQ,o,(o+c)/2,2,0),color00dd00;
stickline(vardQ,o,(o+c)/2,1,0),color00ff00;
MID:MA(CLOSE,26),DOTLINE,color888888;
UPPER:MID+2*STD(CLOSE,26),DOTLINE,color888888;
LOWER:MID-2*STD(CLOSE,26),DOTLINE,color888888;
UP:MID+2.5*STD(CLOSE,21),DOTLINE,color888888;
LOOW:MID-2.5*STD(CLOSE,21),DOTLINE,color888888;
{1.96统计学中为95%可信区间,2.58为99%可信区间,故采用1.96和2.58作为参数}
单边上升:=(c>mid);
单边下降:=(c
布林线开口:=up-loow;
多头行情:=c>ma(c,5) and ma(c,5)>ma(c,10);
股价在高位:=((c-llv(c,30))/(hhv(c,30)-llv(c,30))>0.6);
股价在低位:=((c-llv(c,30))/(hhv(c,30)-llv(c,30))<0.4);
布林线缩口:=((upper-mid)/mid<0.05);
drawtext(布林线缩口,mid,'▲'),color0000FF;
STICKLINE(BARSTATUS=2,撑压位,撑压位,40,1),LINETHICK1,COLORFFFFFF;
DRAWTEXT(BARSTATUS=2,撑压位,' 撑压'),COLORFFFFFF,VALIGN1;
STICKLINE(BARSTATUS=2,底,底,40,1),COLOR00FFFF,LINETHICK1;
DRAWTEXT(BARSTATUS=2,底,' 底线'),COLOR00FFFF,VALIGN0;
STICKLINE(BARSTATUS=2,阻力,阻力,20,0),ColorFF0000;
DRAWTEXT(BARSTATUS=2,阻力,' 阻力'),COLORFF0000,VALIGN1;
STICKLINE(BARSTATUS=2,支撑,支撑,20,0),ColorFF00FF;
DRAWTEXT(BARSTATUS=2,支撑,' 支撑'),COLORFF00FF,VALIGN0;
A1:=ref(H,M)=hhv(h,2*M+1);
B1:=filter(A1,M);
C1:=backset(B1,M+1);
D1:=filter(C1,M);{高点}
A2:=ref(l,M)=llv(l,2*M+1);
B2:=filter(A2,M);
C2:=backset(B2,M+1);
D2:=filter(C2,M);{低点}
E1:=(ref(llv(l,2*M),1)+ref(hhv(h,2*M),1))/2;
E2:=(h+l)/2;{高低点出现在同一K线上时可作取舍}
H1:=(D1 AND not(D2 AND E1>=E2)) OR barstatus=2 OR barscount(c)=1;
L1:=(D2 AND not(D1 AND E1
H2:=D1 AND not(D2 AND E1>=E2);
X1:=ref(barslast(H1),1)+1;
F1:=backset(H1 AND count(L1,X1)>0,llvbars(if(L1,l,10000),X1));
G1:=F1>ref(F1,1); I1:=backset(G1,2);
LD:=I1>ref(I1,1);{过滤后低点}
L2:=LD OR barstatus=2 OR barscount(c)=1;
X2:=ref(barslast(L2),1)+1; F2:=backset(L2 AND count(H2,X2)>0,hhvbars(if(H2,h,0),X2));
G2:=F2>ref(F2,1);
I2:=backset(G2,2);
HD:=I2>ref(I2,1);{过滤后高点}
R1:=backset(barstatus=2,barslast(HD)+1);
S1:=R1>ref(R1,1); {前一高}
T1:=backset(barstatus=2,barslast(LD)+1);
U1:=T1>ref(T1,1); {前一低}
R2:=backset(S1,ref(barslast(HD),1)+2);
S2:=R2>ref(R2,1); {前二高}
T2:=backset(U1,ref(barslast(LD),1)+2);
U2:=T2>ref(T2,1); {前二低}
R3:=backset(S2,ref(barslast(HD),1)+2);
S3:=R3>ref(R3,1); {前三高}
T3:=backset(U2,ref(barslast(LD),1)+2);
U3:=T3>ref(T3,1); {前三低}
R4:=backset(S3,ref(barslast(HD),1)+2);
S4:=R4>ref(R4,1); {前四高}
T4:=backset(U3,ref(barslast(LD),1)+2);
U4:=T4>ref(T4,1); {前四低}
{前一高:=IF(R1>ref(R1,1),H,0);
前二高:=IF(R2>ref(R2,1),H,0);
前三高:=IF(R3>ref(R3,1),H,0);
高点取值:=MAX(前一高,前二高,前三高);
主要高点:=HHVALL(高点取值);
前一低:=IF(T1>ref(T1,1),L,H*100);
前二低:=IF(T2>ref(T2,1),L,H*100);
前三低:=IF(T3>ref(T3,1),L,H*100);
低点取值:=MIN(前一低,前二低,前三低);
主要低点:=LLVALL(低点取值);}
短期压力:drawline(S2,h,S1,h,1),Colorgreen;
短期支撑:drawline(U2,l,U1,l,1),Colorred;
中期压力:drawline(S3,h,S2,h,1),Colorffff00;
中期支撑:drawline(U3,l,U2,l,1),Colorff00ff;
长期压力:drawline(S4,h,S3,h,1),COLORwhite;
长期支撑:drawline(U4,l,U3,l,1),Coloryellow;
{主要压力:drawline(S4,h,主要高点=h,h,1),COLORwhite,LINETHICK2;
主要支撑:drawline(U4,l,主要低点=l,l,1),Coloryellow,LINETHICK2;}
DRAWICON(S1,H*1.03,8),ALIGN1;
DRAWICON(S2,H*1.03,8),ALIGN1;
DRAWICON(S3,H*1.03,8),ALIGN1;
DRAWICON(S4,H*1.03,8),ALIGN1;
DRAWICON(U1,L*0.99,7),ALIGN1;
DRAWICON(U2,L*0.99,7),ALIGN1;
DRAWICON(U3,L*0.99,7),ALIGN1;
DRAWICON(U4,L*0.99,7),ALIGN1; |