江恩画线法全部原码的详细介绍
画线法10波浪+趋势
{以下语句为新结构波浪}
A1:=REF(HIGH,3)=HHV(HIGH,2*3+1); B1:=FILTER(A1,3); C1:=BACKSET(B1,3+1); D1:=FILTER(C1,3);{高点}
A2:=REF(LOW,3)=LLV(LOW,2*3+1); B2:=FILTER(A2,3); C2:=BACKSET(B2,3+1); D2:=FILTER(C2,3);{低点}
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2; E2:=(HIGH+LOW)/2;{高低点出现在同一K线上时可作取舍}
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
L1:=(D2 AND NOT(D1 AND E1<E2)); 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,LOW,10000),X1));
G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{过滤后低点}
L2:=LD OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1);{过滤后高点}
DRAWLINE(LD,L,HD,H,0),COLORWHITE,LINETHICK1,POINTDOT;
DRAWLINE(HD,H,LD,L,0),COLORWHITE,LINETHICK1,POINTDOT;
J1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD),BARSLAST(LD))+1); J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),ISLASTBAR,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORWHITE,LINETHICK1,POINTDOT;
{以上语句为新结构波浪}
A3:=H<REF(H,REF(BARSLAST(HD),1)+1);
B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD; E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2); HH:=E3>REF(E3,1);{找出全部长期高点}
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1)<REF(L,REF(BARSLAST(LD),1)+2+REF(BARSLAST(LD),REF(BARSLAST(LD),1)+2));
D4:=A4 AND B4 AND LD; E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LL:=E4>REF(E4,1);{找出全部长期低点}
DRAWICON(HH,H,10),ALIGN2; DRAWICON(LL,L,12),ALIGN1;
H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1; {后面进行过滤,方法同前。只是不用考虑高低点出现在同一K线}
X3:=REF(BARSLAST(H3),1)+1; F3:=BACKSET(H3 AND COUNT(LL,X3)>0,LLVBARS(IF(LL,L,POW(10,20)),X3));
G3:=F3>REF(F3,1);I3:=BACKSET(G3,2);LZ:=I3>REF(I3,1),LINETHICK0; {长期低点,也可供引用}
L4:=LZ OR ISLASTBAR OR BARSCOUNT(C)=1;
X4:=REF(BARSLAST(L4),1)+1; F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,H,-POW(10,20)),X4));
G4:=F4>REF(F4,1);I4:=BACKSET(G4,2);HZ:=I4>REF(I4,1),LINETHICK0;{长期高点,也可供引用}
DRAWLINE(HZ,H,LZ,L,0),COLORGREEN,LINETHICK1;
DRAWLINE(LZ,L,HZ,H,0),COLORGREEN,LINETHICK1;{长期连线}
K1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HZ),BARSLAST(LZ))+1); K2:=K1>REF(K1,1);
DRAWLINE(K2,IF(HZ,H,L),ISLASTBAR,C,0),COLORGREEN,LINETHICK1; {最后的长期连线,连在收盘价上}
{以下是两条趋势线原码}
UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
DRAWLINE(XX,L,VV,L,1),COLORMAGENTA,LINETHICK1;
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
DRAWLINE(XX2,H,VV2,H,1),COLORMAGENTA,LINETHICK1;
前一低:REF(L,BARSLAST(VV)),COLOR99FF66,POINTDOT,LINETHICK3;
前二低:REF(L,BARSLAST(XX)),COLORFF66FF,POINTDOT,LINETHICK3;
前一高:REF(H,BARSLAST(VV2)),COLOR99FF66,POINTDOT,LINETHICK3;
前二高:REF(H,BARSLAST(XX2)),COLORFF66FF,POINTDOT,LINETHICK3;
短高:=REF(H,BARSLAST(VV2)),LINETHICK0;
短低:=REF(L,BARSLAST(VV)),LINETHICK0;
短比: (C-短低)/(短高-短低),LINETHICK0;
{以下语句是大盘趋势叠加}
常数:=REF(INDEXC,BARSLAST(VV))/REF(C,BARSLAST(VV));
叠1:INDEXC/常数,COLORGRAY,LINETHICK0;
PARTLINE(1,叠1),COLORGRAY;
常数2:=REF(INDEXC,BARSLAST(XX))/REF(C,BARSLAST(XX));
叠2:INDEXC/常数2,COLORGRAY,LINETHICK0;
PARTLINE(1,叠2),COLORGRAY;
DRAWNUMBER(HD,1.02*H,DATEDIFF(REF(DATE,BARSLAST(LD)),DATE),0),COLORCYAN;
DRAWNUMBER(LD,0.98*L,DATEDIFF(REF(DATE,BARSLAST(HD)),DATE),0),COLORCYAN;
DRAWNUMBER(HD,H*(1+0.002),H,2),COLORBLUE,ALIGN0;
DRAWNUMBER(LD,L*(1.001-0.002),L,2),COLORBLUE,ALIGN0;
画线法11波浪结构
input:n(20),n1(7),n2(69);
A1:=REF(HIGH,3)=HHV(HIGH,2*3+1); B1:=FILTER(A1,3); C1:=BACKSET(B1,3+1); D1:=FILTER(C1,3);{高点}
A2:=REF(LOW,3)=LLV(LOW,2*3+1); B2:=FILTER(A2,3); C2:=BACKSET(B2,3+1); D2:=FILTER(C2,3);{低点}
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2; E2:=(HIGH+LOW)/2;{高低点出现在同一K线上时可作取舍}
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
H2:=D1 AND NOT(D2 AND E1>=E2);
L1:=D2 AND NOT(D1 AND E1=E2);
X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,1000000),X1));
G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{过滤后低点}
L2:=LD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1);{过滤后高点}
DRAWLINE(LD,L,HD,H,0),COLORWHITE,LINETHICK1,POINTDOT;
DRAWLINE(HD,H,LD,L,0),COLORWHITE,LINETHICK1,POINTDOT;
J1:=BACKSET(BARSTATUS=2,MIN(BARSLAST(HD),BARSLAST(LD))+1); J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),BARSTATUS=2,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORWHITE,LINETHICK1,POINTDOT;
A3:=H; B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD; E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2); HH:=E3>REF(E3,1);{找出全部长期高点}
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1); D4:=A4 AND B4 AND LD; E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LL:=E4>REF(E4,1);{找出全部长期低点}
DRAWICON(HH,H,5),ALIGN1; DRAWICON(LL,L,4),ALIGN1;
H3:=HH OR BARSTATUS=2 OR BARSCOUNT(C)=1; {后面进行过滤,方法同前。只是不用考虑高低点出现在同一K线}
X3:=REF(BARSLAST(H3),1)+1; F3:=BACKSET(H3 AND COUNT(LL,X3)>0,LLVBARS(IF(LL,L,POW(10,20)),X3));
G3:=F3>REF(F3,1);I3:=BACKSET(G3,2);LZ:=I3>REF(I3,1); {长期低点,也可供引用}
L4:=LZ OR BARSTATUS=2 OR BARSCOUNT(C)=1;
X4:=REF(BARSLAST(L4),1)+1; F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,H,-POW(10,20)),X4));
G4:=F4>REF(F4,1);I4:=BACKSET(G4,2);HZ:=I4>REF(I4,1);{长期高点,也可供引用}
DRAWLINE(HZ,H,LZ,L,0),COLORGREEN,LINETHICK1;
DRAWLINE(LZ,L,HZ,H,0),COLORGREEN,LINETHICK1;{长期连线}
K1:=BACKSET(BARSTATUS=2,MIN(BARSLAST(HZ),BARSLAST(LZ))+1); K2:=K1>REF(K1,1);
DRAWLINE(K2,IF(HZ,H,L),BARSTATUS=2,C,0),COLORGREEN,LINETHICK1; {最后的长期连线,连在收盘价上}
UU:=BACKSET(BARSTATUS=2,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
DRAWLINE(XX,L,VV,L,1),COLORMAGENTA,LINETHICK1;
UU2:=BACKSET(BARSTATUS=2,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
DRAWLINE(XX2,H,VV2,H,1),COLORMAGENTA,LINETHICK1;
前一低:REF(L,BARSLAST(VV)),COLOR99FF66,POINTDOT,LINETHICK3;
前二低:REF(L,BARSLAST(XX)),COLORFF66FF,POINTDOT,LINETHICK3;
前一高:REF(H,BARSLAST(VV2)),COLOR99FF66,POINTDOT,LINETHICK3;
前二高:REF(H,BARSLAST(XX2)),COLORFF66FF,POINTDOT,LINETHICK3;
短高:=REF(H,BARSLAST(VV2));
短低:=REF(L,BARSLAST(VV));
短比: (C-短低)/(短高-短低),LINETHICK0;
常数:=REF(INDEXC,BARSLAST(VV))/REF(C,BARSLAST(VV));
叠1:INDEXC/常数,COLORGRAY,LINETHICK0;
PARTLINE(叠1,1),COLORGRAY;
常数2:=REF(INDEXC,BARSLAST(XX))/REF(C,BARSLAST(XX));
叠2:INDEXC/常数2,COLORGRAY,LINETHICK0;
PARTLINE(叠2,1),COLORGRAY;
{
s:=NUMTOSTRN(DAYS1970-DATETOD1970(REF( DATE,BARSLAST(LD) ) ),0 );
s1:=NUMTOSTRN(DAYS1970-DATETOD1970(REF( DATE,BARSLAST(HD) ) ),0 );
s2:=NUMTOSTRN(H,2 );
s3:=NUMTOSTRN(L,2 );
DRAWTEXT(HD,1.02*H,s),COLORCYAN;
DRAWTEXT(LD,0.98*L,s1),COLORCYAN;
DRAWTEXT(HD,H*(1+0.002),s2),COLORBLUE,ALIGN0;
DRAWTEXT(LD,L*(1.001-0.002),s3),COLORBLUE,ALIGN0;}
{以下语句为三角形部分}
底:REF(L,BARSLAST(VV)),COLORred,LINETHICK2;
頂:REF(H,BARSLAST(VV2)),COLORGreen,LINETHICK2;
{下迭三角形:藍色三角形畫完介入}
StickLine(VV,頂,底,0,0),Colorff6633,linethick3;{}
DRAWLINE(VV2,H,VV,L,0),Colorff6633,linethick3;{斜}
DRAWLINE(VV2,H,VV,頂,0),Colorff6633,linethick3;{?}
{DRAWLINE(c>0,H,VV,L,0),Colorcyan,linethick2;}{斜}
{DRAWLINE(c>1,H,VV,頂,0),Colorcyan,linethick2;}{?}
{上漲三角形:紅色三角形畫完出局}
StickLine(VV2 ,頂,底,0,0),Colorred,linethick3;{}
DRAWLINE(VV,L,VV2,H,0),Colorred,linethick3;{斜}
DRAWLINE(VV,L,VV2,底,0),Colorred,linethick3;{?};
SYSPARAM(6),colorwhite;
M3: EMA(CLOSE,3);
M8: EMA(CLOSE,8),COLORGREEN;
M13: EMA(M8,13),COLORRED;
M62: EMA(M8,62),COLORCYAN;
Var1:=EMA(M13,62);
M81: EMA(M62,81),COLORYELLOW;
M144: EMA(Var1,144),LINETHICK2 , COLORRED;
M250: EMA(Var1,250),LINETHICK2 , COLORMAGENTA;
Var2:=(CLOSE+HIGH+LOW)/3;
Var3:=EMA(Var2,10);
Var4:=REF(Var3,1);
STICKLINE(Var3>Var4,Var3,Var4,15,0),COLORYELLOW;
STICKLINE(Var3< Var4,Var3,Var4,20,0),COLOR00ff00;
Var5:=(REF(HIGH,1)+REF(LOW,1))/2;
Var6:=MA(CLOSE,N)+2*STD(CLOSE,N);
DRAWICON(CROSS(Var5,Var6),HIGH*1.035,1);
DRAWTEXT(CROSS(Var5,Var6),HIGH*1.04,'卖出'),COLORGREEN;
Var7:=REF(CLOSE,1);
Var8:=SMA(MAX(CLOSE-Var7,0),N1,1)/SMA(ABS(CLOSE-Var7),N1,1)*100;
Var9:=CROSS(N2,Var8);
VarA:=FILTER(Var9,4);
DRAWICON(VarA,HIGH*1.035,1);
DRAWTEXT(VarA,HIGH*1.04,'卖出'),COLORWHITE;
VarB:=(2*CLOSE+HIGH+LOW)/4;
VarC:=LLV(LOW,34);
VarD:=HHV(HIGH,34);
VarE:=EMA((VarB-Var1)/(Var5-Var1)*100,7);
VarF:=EMA(0.667*REF(VarE,1)+0.333*VarE,5);
DRAWTEXT(IF(COUNT(CLOSE< REF(CLOSE,1),8)/8>0.6 AND VOL>=1.5*MA(VOL,5) AND COUNT(VarE>=VarF,3) AND REF(LOW,1)<=LLV(LOW,120),1,0),LOW,'●买进'),colorred;
DRAWTEXT(IF(COUNT(CLOSE< REF(CLOSE,1),13)/13>0.6 AND COUNT(VarE>VarF,6) AND REF(LOW,5)=LLV(LOW,120) AND REF(CLOSE>=OPEN,4) AND REF(CLOSE>OPEN,3) AND REF(CLOSE>OPEN,2) AND REF(OPEN>CLOSE,1) AND OPEN>REF(CLOSE,1),1,0),LOW,'●买进'),COLORYELLOW;
Var10:=MA(CLOSE,80)-MA(CLOSE,10)/3;
DRAWTEXT(IF(CLOSE< Var10 AND VOL/240>MA(VOL,5)/240 AND CLOSE>REF(CLOSE,1)*1.08 AND CLOSE< MA(CLOSE,13)*1.3,1,0),LOW,'●抄底'),COLORRED;
画线法12大鲨鱼形态-画线预警
SFF:=H/REF(H,1)<1 AND REF(h,1)/REF(h,2)<1AND L/REF(L,1)>1 and REF(L,1)/REF(L,2)>1 ;
STICKLINE(BACKSET(SFF,3),C,O,7,1),COLORYELLOW;
DRAWTEXT(SFF,L*0.97,'大鲨鱼'),COLORYELLOW;
w:=barslast(FILTER(BACKSET(SFF,3),3));
预警:cross(c,ref(h,w))LINETHICK0;
DRAWLINE(FILTER(BACKSET(SFF,3),3),h,cross(c,ref(h,w)),ref(h,w),0);
//顶底画线
DRAWLINE(l=sysparam(5),l,barpos=SYSPARAM(3)-1,l,1),Colorgreen;
DRAWLINE(h=sysparam(4),h,barpos=SYSPARAM(3)-1,h,1),Coloryellow;
x:=ma(c,5);
n1:=sysparam(3);
n:=n1-sysparam(2)+1;
hh:=hhv(x,n);
ll:=llv(x,n);
tsh:=hhvbars(x,n);
tsl:=llvbars(x,n);
最高:hh[n1],POINTDOT;
最低:ll[n1],POINTDOT;
drawicon(barpos=n1-tsh[n1],l,5);
drawicon(barpos=n1-tsl[n1],l,4);
drawtext(barpos=n1-tsh[n1],h*1.02,'大顶')colorred;
drawtext(barpos=n1
画线法4奇妙撑压
INPUT:N(13,1,100),P(3,1,10),Q(3,1,35);
X1:=REF(C,1);
X2:=SMA(MAX(C-X1,0),N,1)/SMA(ABS(C-X1),N,1)*100;
X3:=((3*SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1)-2*SMA(SMA((C-LLV
(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1),3,1)-50)*1.032+50);
X4:=(X2+X3)/2;
奇妙线:C+(X4/50-1)*(MA(C,30)/20)*P,COLORFFEEBB;
AA1:=EMA(C,2); { 短指数平滑移动平均线 }
BB1:=EMA(AA1,2); { 平滑 }
A:=MA(BB1,3); { 平均 }
AA2:=EMA((H+C+O)/3,18); { 长指数平滑移动平均线 }
DD3:=A>=AA2 AND C>AA2;{ 短>长,且收>长 }
DD4:=A<AA2 ; { 短<长 }
DD5:=A>AA2 ; { 短>长 }
STICKLINE((DD4 OR DD5)AND O<=C,C,O,6,0),COLORFF88CC; {跌势阳线}
STICKLINE((DD4 OR DD5)AND O<=C,H,L,0.5,0),COLORFF88CC; {跌势阳线}
STICKLINE((DD4 OR DD5)AND O>=C,C,O,6,0),COLORCYAN; {跌势阴线}
STICKLINE((DD4 OR DD5)AND O>=C,H,L,0.5,0),COLORCYAN; {跌势阴线}
STICKLINE((DD3 OR C>AA2)AND O<=C,C,O,6,0),COLORRED; {涨势阳线}
STICKLINE((DD3 OR C>AA2)AND O<=C,H,L,0.5,0),COLORRED; {涨势阳线}
STICKLINE((DD3 OR C>AA2)AND O>=C,C,O,6,0),COLOR00CC99; {涨势阴线}
STICKLINE((DD3 OR C>AA2)AND O>=C,H,L,0.5,0),COLOR00CC99;{涨势阴线};
RSV1:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
KK:=SMA(RSV1,3,1);
DD:=SMA(KK,3,1);
JJ:=3*KK-2*DD;
M:=BARSLAST(CROSS(DD,JJ));
警示线:REF(H,M),POINTDOT,COLORYELLOW;{进场; 止赢; 止损; 黄}
STICKLINE(警示线,警示线,警示线,3.8,1),COLORYELLOW;
A1:=BACKSET(REF(H,2)=HHV(H,5),3);
A2:=BACKSET(REF(L,2)=LLV(L,5),3);
A3:=CROSS(A1,0.9);
A4:=CROSS(A2,0.9);
上沿:REF(H,BARSLAST(A3)),POINTDOT,COLORFF8918;
STICKLINE(C,REF(H,BARSLAST(A3)),REF(H,BARSLAST(A3)),5,1),COLORFF8918;
下沿:REF(L,BARSLAST(A4)),POINTDOT,COLORMAGENTA;
STICKLINE(C,REF(L,BARSLAST(A4)),REF(L,BARSLAST(A4)),5,1),COLORMAGENTA
画线法45画线趋势
{--画线趋势---------------------------------------------------------}
N:=p1;{原码 N:=3;}
A1:=向前引用(最高价,N)=最高值(最高价,2*N+1); B1:=信号过滤(A1,N); C1:=向前赋值(B1,N+1);
D1:=信号过滤(C1,N);{高点}
A2:=向前引用(最低价,N)=最低值(最低价,2*N+1); B2:=信号过滤(A2,N); C2:=向前赋值(B2,N+1);
D2:=信号过滤(C2,N);{低点}
E1:=(向前引用(最低值(最低价,2*N),1)+向前引用(最高值(最高价,2*N),1))/2; E2:=(最高价+最低价)/2;{高低点出现
在同一K线上时可作取舍}
H1:=(D1 AND 求逻辑非(D2 AND E1>=E2)) OR 是否最后周期 OR 有效值周期数(收盘价)=1;
L1:=(D2 AND 求逻辑非(D1 AND E1<E2));H2:=D1 AND 求逻辑非(D2 AND E1>=E2);
X1:=向前引用(上一次条件成立位置(H1),1)+1; F1:=向前赋值(H1 AND 统计总数(L1,X1)>0,上一低点位置
(条件函数(L1,最低价,10000),X1));
G1:=F1>向前引用(F1,1); I1:=向前赋值(G1,2); LD:=I1>向前引用(I1,1),LINETHICK0;{过
滤后低点}
L2:=LD OR 是否最后周期 OR 有效值周期数(收盘价)=1;
X2:=向前引用(上一次条件成立位置(L2),1)+1; F2:=向前赋值(L2 AND 统计总数(H2,X2)>0,上一高点位置
(条件函数(H2,最高价,0),X2));
G2:=F2>向前引用(F2,1); I2:=向前赋值(G2,2); HD:=I2>向前引用(I2,1),LINETHICK0;{过
滤后高点}
///HD:="jgb.HD"(N);LD:="jgb.LD"(N);
R1:=向前赋值(是否最后周期,上一次条件成立位置(HD)+1); S1:=R1>向前引用(R1,1); {前一高}
T1:=向前赋值(是否最后周期,上一次条件成立位置(LD)+1); U1:=T1>向前引用(T1,1); {前一低}
R2:=向前赋值(S1,向前引用(上一次条件成立位置(HD),1)+2); S2:=R2>向前引用(R2,1); {前二高}
T2:=向前赋值(U1,向前引用(上一次条件成立位置(LD),1)+2); U2:=T2>向前引用(T2,1); {前二低}
T3:=向前赋值(U2,向前引用(上一次条件成立位置(LD),1)+2); U3:=T3>向前引用(T3,1); {前三低}
T4:=向前赋值(U3,向前引用(上一次条件成立位置(LD),1)+2); U4:=T4>向前引用(T4,1); {前四低}
R3:=向前赋值(S2,向前引用(上一次条件成立位置(HD),1)+2); S3:=R3>向前引用(R3,1); {前三高}
R4:=向前赋值(S3,向前引用(上一次条件成立位置(HD),1)+2); S4:=R4>向前引用(R4,1); {前四高}
★压力1:画直线(S2,最高价,S1,最高价,1),Color80FFFF,linethick2;
★支撑1:画直线(U2,最低价,U1,最低价,1),点状线,Color00FFFF,linethick2;
★压力2:画直线(S3,最高价,S2,最高价,1),ColorFF8000,linethick2;
★支撑2:画直线(U3,最低价,U2,最低价,1),点状线,ColorFF8000,linethick2;
★压力3:画直线(S4,最高价,S3,最高价,1),Color0000FF,linethick2;
★支撑3:画直线(U4,最低价,U3,最低价,1)点状线,Color0000FF,linethick2;
画图标(S2,最高价*1.01,10); 画图标(S3,最高价*1.01,10);
显示数字(S2,最高价*1.02,最高价,2),COLORMAGENTA;
显示数字(S1,最高价*1.02,最高价,2),COLORMAGENTA;
显示数字(S3,最高价*1.02,最高价,2),COLORMAGENTA;
画图标(U1,最低价*0.99,11); 画图标(U2,最低价*0.99,11);
画图标(U3,最低价*0.99,11);画图标(U4,最低价*0.99,11);
显示数字(U1,最低价*0.98,最低价,2),COLORCYAN;
显示数字(U2,最低价*0.98,最低价,2),COLORCYAN;
显示数字(U3,最低价*0.98,最低价,2),COLORCYAN;
显示数字(U4,最低价*0.98,最低价,2),COLORCYAN;
画线法40上升(下降)通道自动划
hh:=hhv(h,0);
hhh:=h;
aa:=BARSLAST(h=hh[datacount]);
ba:=datacount-aa;
ja:=1;
tm1:=999999;
for i1=ba[datacount]+1 to datacount do begin
k1:=(hh[datacount]-hhh[i1])/ja;
if k1<tm1 then begin
tm1:=k1;
ts1:=ja;
end;
ja:=ja+1;
end;
A1:LINEVALUE(h=hh[datacount] and aa=0,h,BARPOS=datacount-aa[datacount]+ts1,h,0,0),colorffff54;
cha:=hhv(abs(l-a1),aa);
A2:a1-cha[datacount],colorffff54;
AI:a1-cha[datacount]/2,colorffff54,LINEDASH;
ll:=llv(l,0);
lll:=l;
a3:=BARSLAST(l=ll[datacount]);
b3:=datacount-a3;
j3:=1;
tm3:=999999;
for i3=b3[datacount]+1 to datacount do begin
k3:=(lll[i3]-ll[datacount])/j3;
if k3<tm3 then begin
tm3:=k3;
ts3:=j3;
end;
j3:=j3+1;
end;
B1:LINEVALUE(l=ll[datacount] and a3=0,l,BARPOS=datacount-a3[datacount]+ts3,l,0,0),color5454ff;
chb:=hhv(abs(h-b1),a3);
b2:b1+chb[datacount],color5454ff;
bi:b1+chb[datacount]/2,color5454ff,LINEDASH;
画线法32黄金切割率-2
前高:SYSPARAM(4),colorwhite;
DRAWNUMBER(ISLASTBAR,前高,前高,2),aligno5,SHIFT3,COLORWHITE;
DRAWTEXT(ISLASTBAR,前高,'(前高)'),SHIFT7,COLORWHITE;
前低:SYSPARAM(5),colorwhite;
DRAWNUMBER(ISLASTBAR,前低,前低,2),aligno5,SHIFT3,COLORWHITE;
DRAWTEXT(ISLASTBAR,前低,'(前低)'),SHIFT7,COLORWHITE;
F1:((前高-前低)*0.236)+前低,COLORYELLOW;
DRAWNUMBER(ISLASTBAR,F1,F1,2),aligno5,SHIFT3,COLORYELLOW;
F2:((前高-前低)*0.382)+前低,COLORFF00FF;
DRAWNUMBER(ISLASTBAR,F2,F2,2),aligno5,SHIFT3,COLORFF00FF;
F3:((前高-前低)*0.5)+前低,COLORFFFF00;
DRAWNUMBER(ISLASTBAR,F3,F3,2),aligno5,SHIFT3,COLORFFFF00;
F4:((前高-前低)*0.618)+前低,COLORFF00FF;
DRAWNUMBER(ISLASTBAR,F4,F4,2),aligno5,SHIFT3,COLORFF00FF;
F5:((前高-前低)*0.764)+前低,COLORYELLOW;
DRAWNUMBER(ISLASTBAR,F5,F5,2),aligno5,SHIFT3,COLORYELLOW;
画线法30黄金切割率
N:=SYSPARAM(3)-SYSPARAM(2);
A:=BACKSET(ISLASTBAR,HHVBARS(H,N)+1);
B:=COUNT(A,N)=1;
前高:REF(H,BARSLAST(B)),COLORWHITE;
DRAWNUMBER(ISLASTBAR,前高,前高,2),aligno5,SHIFT3,COLORWHITE;
DRAWTEXT(ISLASTBAR,前高,'(前高)'),SHIFT7,COLORWHITE;
A2:=BACKSET(ISLASTBAR,LLVBARS(L,N)+1);
B2:=A2>REF(A2,1);
前低:REF(L,BARSLAST(B2)),COLORWHITE;
DRAWNUMBER(ISLASTBAR,前低,前低,2),aligno5,SHIFT3,COLORWHITE;
DRAWTEXT(ISLASTBAR,前低,'(前低)'),SHIFT7,COLORWHITE;
F1:((前高-前低)*0.236)+前低,COLORYELLOW;
DRAWNUMBER(ISLASTBAR,F1,F1,2),aligno5,SHIFT3,COLORYELLOW;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F1,'(0.236)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)<BARSLAST(B2) and ISLASTBAR,F1,'(0.764)'),SHIFT7,COLORWHITE;
F2:((前高-前低)*0.382)+前低,COLORFF00FF;
DRAWNUMBER(ISLASTBAR,F2,F2,2),aligno5,SHIFT3,COLORFF00FF;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F2,'(0.382)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)<BARSLAST(B2) and ISLASTBAR,F2,'(0.618)'),SHIFT7,COLORWHITE;
F3:((前高-前低)*0.5)+前低,COLORFFFF00;
DRAWNUMBER(ISLASTBAR,F3,F3,2),aligno5,SHIFT3,COLORFFFF00;
DRAWTEXT(ISLASTBAR,F3,'(0.5)'),SHIFT7,COLORWHITE;
F4:((前高-前低)*0.618)+前低,COLORFF00FF;
DRAWNUMBER(ISLASTBAR,F4,F4,2),aligno5,SHIFT3,COLORFF00FF;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F4,'(0.618)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)<BARSLAST(B2) and ISLASTBAR,F4,'(0.382)'),SHIFT7,COLORWHITE;
F5:((前高-前低)*0.764)+前低,COLORYELLOW;
DRAWNUMBER(ISLASTBAR,F5,F5,2),aligno5,SHIFT3,COLORYELLOW;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F5,'(0.764)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)<BARSLAST(B2) and ISLASTBAR,F5,'(0.236)'),SHIFT7,COLORWHITE;
江恩角度线--- 一发千钧主图
N:=120;
AA:=REF(H,N)=HHV(H,2*N+1),LINETHICK0;
BB:=BACKSET(AA,N+1),LINETHICK0;
CC:=FILTER(BB,N) AND H=HHV(H,N+1);
AA2:=REF(L,N)=LLV(L,2*N+1);
BB2:=BACKSET(AA2,N+1);
CC2:=FILTER(BB2,N) AND L=LLV(L,N+1);
{定位分形峰位高低点}
GG:=ISLASTBAR AND REF(CC,BARSLAST(CC));
DD:=BACKSET(GG,BARSLAST(CC)+1);
II:=DD>REF(DD,1);{定位第一高点}
JJ:=REF(BARSLAST(CC),1);
KK:=BACKSET(II,JJ+2);
EE:=KK>REF(KK,1);{定位第一高点之前高点}
GG2:= ISLASTBAR AND REF(CC2,BARSLAST(CC2));
DD2:=BACKSET(GG2,BARSLAST(CC2)+1);
II2:=DD2>REF(DD2,1);
JJ2:=REF(BARSLAST(CC2),1);
KK2:=BACKSET(II2,JJ2+2);
EE2:=KK2>REF(KK2,1);
HH:=REF(H,BARSLAST(II)),LINETHICK0,COLORWHITE;
LL:=REF(L,BARSLAST(II2)),LINETHICK0,COLORWHITE;
HD:=BARSLAST(II),LINETHICK0,COLORWHITE;
LD:=BARSLAST(II2),LINETHICK0,COLORWHITE;
DRAWLINE(II2=1,LL,LD=1,LL,2),colorblue,linethick2;
DRAWLINE(II2=1,LL,LD=1,LL*0.08+LL,2),COLORMAGENTA;
DRAWLINE(II2=1,LL,LD=1,LL*0.07+LL,2),color82B610;
DRAWLINE(II2=1,LL,LD=1,LL*0.06+LL,2),colorred;
DRAWLINE(II2=1,LL,LD=1,LL*0.05+LL,2),color70824B;
DRAWLINE(II2=1,LL,LD=1,LL*0.04+LL,2),COLORCYAN;
DRAWLINE(II2=1,LL,LD=1,LL*0.03+LL,2),colorgreen;
DRAWLINE(II2=1,LL,LD=1,LL*0.02+LL,2),colorwhite;
DRAWLINE(II2=1,LL,LD=1,LL*0.015+LL,2),colorAB9CE9;
DRAWLINE(II2=1,LL,LD=1,LL*0.01+LL,2),colorred,linethick2;
DRAWLINE(II2=1,LL,LD=1,LL/1.5*0.01+LL,2),colorAB9CE9;
DRAWLINE(II2=1,LL,LD=1,LL/2*0.01+LL,2),colorwhite;
DRAWLINE(II2=1,LL,LD=1,LL/3*0.01+LL,2),colorgreen;
DRAWLINE(II2=1,LL,LD=1,LL/4*0.01+LL,2),COLORCYAN;
DRAWLINE(II2=1,LL,LD=1,LL/5*0.01+LL,2),color70824B;
DRAWLINE(II2=1,LL,LD=1,LL/6*0.01+LL,2),colorred;
DRAWLINE(II2=1,LL,LD=1,LL/7*0.01+LL,2),color82B610;
DRAWLINE(II2=1,LL,LD=1,LL/8*0.01+LL,2),COLORMAGENTA;
DRAWLINE(II=1,HH,HD=1,HH-HH*0.08,2),COLORMAGENTA;
DRAWLINE(II=1,HH,HD=1,HH-HH*0.07,2),color82B610;
DRAWLINE(II=1,HH,HD=1,HH-HH*0.06,2),colorred;
DRAWLINE(II=1,HH,HD=1,HH-HH*0.05,2),color70824B;
DRAWLINE(II=1,HH,HD=1,HH-HH*0.04,2),COLORCYAN;
DRAWLINE(II=1,HH,HD=1,HH-HH*0.03,2),colorgreen;
DRAWLINE(II=1,HH,HD=1,HH-HH*0.02,2),colorwhite;
DRAWLINE(II=1,HH,HD=1,HH-HH*0.015,2),colorAB9CE9;
DRAWLINE(II=1,HH,HD=1,HH-HH*0.01,2),colorred,linethick2;
DRAWLINE(II=1,HH,HD=1,HH-HH/1.5*0.01,2),colorwhite,colorAB9CE9;
DRAWLINE(II=1,HH,HD=1,HH-HH/2*0.01,2),colorwhite;
DRAWLINE(II=1,HH,HD=1,HH-HH/3*0.01,2),colorgreen;
DRAWLINE(II=1,HH,HD=1,HH-HH/4*0.01,2),COLORCYAN;
DRAWLINE(II=1,HH,HD=1,HH-HH/5*0.01,2),color70824B;
DRAWLINE(II=1,HH,HD=1,HH-HH/6*0.01,2),colorred;
DRAWLINE(II=1,HH,HD=1,HH-HH/7*0.01,2),color82B610;
DRAWLINE(II=1,HH,HD=1,HH-HH/8*0.01,2),COLORMAGENTA;
DRAWLINE(II=1,HH,HD=1,HH,2),COLORblue,linethick2;
角度线----杨文亮制作
k:=(SYSPARAM(4)-SYSPARAM(5))/(SYSPARAM(3)-SYSPARAM(2));
if 点定位=1 then
begin
if 线方向=1 then
begin
DRAWSL(filter(h=SYSPARAM(4),(sysparam(3)-sysparam(2))),h,-30*k/120,0,0),COLORyellow;
DRAWSL(filter(h=SYSPARAM(4),(sysparam(3)-sysparam(2))),h,-40*k/120,0,0),COLORyellow;
DRAWSL(filter(h=SYSPARAM(4),(sysparam(3)-sysparam(2))),h,-60*k/120,0,0),COLORyellow;
DRAWSL(filter(h=SYSPARAM(4),(sysparam(3)-sysparam(2))),h,-120*k/120,0,0),COLORyellow,LINETHICK2;
DRAWSL(filter(h=SYSPARAM(4),(sysparam(3)-sysparam(2))),h,-240*k/120,0,0),COLORyellow;
DRAWSL(filter(h=SYSPARAM(4),(sysparam(3)-sysparam(2))),h,-360*k/120,0,0),COLORyellow;
DRAWSL(filter(h=SYSPARAM(4),(sysparam(3)-sysparam(2))),h,-480*k/120,0,0),COLORyellow;
end;
if 线方向=2 then
begin
DRAWSL(filter(l=SYSPARAM(5),(sysparam(3)-sysparam(2))),l,30*k/120,0,0),COLORWHITE;
DRAWSL(filter(l=SYSPARAM(5),(sysparam(3)-sysparam(2))),l,40*k/120,0,0),COLORWHITE;
DRAWSL(filter(l=SYSPARAM(5),(sysparam(3)-sysparam(2))),l,60*k/120,0,0),COLORWHITE;
DRAWSL(filter(l=SYSPARAM(5),(sysparam(3)-sysparam(2))),l,120*k/120,0,0),COLORWHITE,linethick2;
DRAWSL(filter(l=SYSPARAM(5),(sysparam(3)-sysparam(2))),l,240*k/120,0,0),COLORWHITE;
DRAWSL(filter(l=SYSPARAM(5),(sysparam(3)-sysparam(2))),l,360*k/120,0,0),COLORWHITE;
DRAWSL(filter(l=SYSPARAM(5),(sysparam(3)-sysparam(2))),l,480*k/120,0,0),COLORWHITE;
end ;
end;
if 点定位=2 then
begin
if 线方向=1 then
begin
DRAWSL(barpos=SYSPARAM(1),h,-30*k/120,0,0),COLORyellow;
DRAWSL(barpos=SYSPARAM(1),h,-40*k/120,0,0),COLORyellow;
DRAWSL(barpos=SYSPARAM(1),h,-60*k/120,0,0),COLORyellow;
DRAWSL(barpos=SYSPARAM(1),h,-120*k/120,0,0),COLORyellow,LINETHICK2;
DRAWSL(barpos=SYSPARAM(1),h,-240*k/120,0,0),COLORyellow;
DRAWSL(barpos=SYSPARAM(1),h,-360*k/120,0,0),COLORyellow;
DRAWSL(barpos=SYSPARAM(1),h,-480*k/120,0,0),COLORyellow;
end;
if 线方向=2 then
begin
DRAWSL(barpos=SYSPARAM(1),l,30*k/120,0,0),COLORWHITE;
DRAWSL(barpos=SYSPARAM(1),l,40*k/120,0,0),COLORWHITE;
DRAWSL(barpos=SYSPARAM(1),l,60*k/120,0,0),COLORWHITE;
DRAWSL(barpos=SYSPARAM(1),l,120*k/120,0,0),COLORWHITE,linethick2;
DRAWSL(barpos=SYSPARAM(1),l,240*k/120,0,0),COLORWHITE;
DRAWSL(barpos=SYSPARAM(1),l,360*k/120,0,0),COLORWHITE;
DRAWSL(barpos=SYSPARAM(1),l,480*k/120,0,0),COLORWHITE;
end ;
end;
画线法21价量时空
INPUT:N(5);
DRAWGBK(C, COLORRGB(50,50,0), COLORRGB(50,100,0),1);
a0:=BARSCOUNT(c);a3:=SYSPARAM(3);a2:=SYSPARAM(2);
a4:=SYSPARAM(4);a5:=SYSPARAM(5);
nn0:=a3-a2;nn:=a0-a2;hh1:=(a4-a5)/10;
y0:=a0>=a2;vv0:=if(y0=1 and SYSPARAM(1)>=a0,v,0);
c1:=if(BETWEEN(c,a4-0*hh1,a4-1*hh1),vv0,0);
c2:=if(BETWEEN(c,a4-1*hh1,a4-2*hh1),vv0,0);
c3:=if(BETWEEN(c,a4-2*hh1,a4-3*hh1),vv0,0);
c4:=if(BETWEEN(c,a4-3*hh1,a4-4*hh1),vv0,0);
c5:=if(BETWEEN(c,a4-4*hh1,a4-5*hh1),vv0,0);
c6:=if(BETWEEN(c,a4-5*hh1,a4-6*hh1),vv0,0);
c7:=if(BETWEEN(c,a4-6*hh1,a4-7*hh1),vv0,0);
c8:=if(BETWEEN(c,a4-7*hh1,a4-8*hh1),vv0,0);
c9:=if(BETWEEN(c,a4-8*hh1,a4-9*hh1),vv0,0);
c10:=if(BETWEEN(c,a4-9*hh1,a4-10*hh1),vv0,0);
v1:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c1,nn0),0),2));
v2:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c2,nn0),0),2));
v3:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c3,nn0),0),2));
v4:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c4,nn0),0),2));
v5:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c5,nn0),0),2));
v6:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c6,nn0),0),2));
v7:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c7,nn0),0),2));
v8:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c8,nn0),0),2));
v9:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c9,nn0),0),2));
v10:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c10,nn0),0),2));
av0:=max(v1,max(v2,max(v3,max(v4,max(v5,max(v6,max(v7,max(v8,max(v9,v10)))))))));
FILLRGN(v1/av0>=nn/nn0 and nn>=0,a4-0*hh1,a4-1*hh1+0.05),colorgray;
FILLRGN(v2/av0>=nn/nn0 and nn>=0,a4-1*hh1,a4-2*hh1+0.05),colorgray;
FILLRGN(v3/av0>=nn/nn0 and nn>=0,a4-2*hh1,a4-3*hh1+0.05),colorgray;
FILLRGN(v4/av0>=nn/nn0 and nn>=0,a4-3*hh1,a4-4*hh1+0.05),colorgray;
FILLRGN(v5/av0>=nn/nn0 and nn>=0,a4-4*hh1,a4-5*hh1+0.05),colorgray;
FILLRGN(v6/av0>=nn/nn0 and nn>=0,a4-5*hh1,a4-6*hh1+0.05),colorgray;
FILLRGN(v7/av0>=nn/nn0 and nn>=0,a4-6*hh1,a4-7*hh1+0.05),colorgray;
FILLRGN(v8/av0>=nn/nn0 and nn>=0,a4-7*hh1,a4-8*hh1+0.05),colorgray;
FILLRGN(v9/av0>=nn/nn0 and nn>=0,a4-8*hh1,a4-9*hh1+0.05),colorgray;
FILLRGN(v10/av0>=nn/nn0 and nn>=0,a4-9*hh1,a4-10*hh1+0.05),colorgray;
hh:=SYSPARAM(4);ll:=SYSPARAM(5);
x:=ll-(hh-ll+MINDIFF)/n;
y:=HHV(VOL,SYSPARAM(3)-SYSPARAM(2)+1);
yvb:=y[SYSPARAM(3)]/(ll-x+MINDIFF);
z:=VOL/yvb+x;
STICKLINE(CLOSE>REF(CLOSE,1),x,z,7,1),Color0000FF;
STICKLINE(CLOSE<=REF(CLOSE,1),x,z,7,0),ColorEAE000;
五日:MA(z,5),SHIFT5;
十日:MA(z,10),SHIFT5;
DRAWTEXT(BARPOS=SYSPARAM(2),HIGH,{STKNAME+'\n'+STKLABEL+'\n'+}BLKNAME)align4,COLORGREEN;
STICKLINE(C>=O,C,O,7,0),COLORRED;
STICKLINE(C>=O,C,O,4,0),COLORB0B0FF;
STICKLINE(C>=O,C,O,2,0),COLORYELLOW;
STICKLINE(C>=O,H,L,0,0),COLORYELLOW;
STICKLINE(C<=O,C,O,7,0),COLORFF2020;
STICKLINE(C<=O,C,O,4,0),COLORFF6600;
STICKLINE(C<=O,C,O,2,0),COLORCYAN;
STICKLINE(C<=O,H,L,0,0),COLORCYAN;
博弈线:=WMA(CLOSE,8),linethick3;
byx:=WMA(CLOSE,8),linethick3;
FILLRGN(byx>ref(byx,1),byx,ref(byx,1)),COLORRED;
FILLRGN(byx<ref(byx,1),byx,ref(byx,1)),COLORgreen;
ma21:ma(c,21),SHIFT5,color00ff00;
Var1:=SYSPARAM(3)-SYSPARAM(2)+1;
Var2:=SYSPARAM(3)-BARPOS;
Var3:=HHV(HIGH,Var1);
Var4:=LLV(LOW,VaR1);
Var5:=REFX(Var3,Var2); //主图最高价
Var5:IF(SYSPARAM(3)<>SYSPARAM(1),SYSPARAM(6),Var5),COLORRED,POINTDOT;
Var6:REFX(Var4,Var2),COLORWHITE,POINTDOT;//主图最低价
黄191:(Var5-Var6)*0.191+Var6,COLORYELLOW,POINTDOT;
黄382:(Var5-Var6)*0.382+Var6,COLORYELLOW,POINTDOT;
黄500:(Var5-Var6)*0.500+Var6,COLORGREEN,POINTDOT;
黄618:(Var5-Var6)*0.618+Var6,COLORYELLOW,POINTDOT;
黄809:(Var5-Var6)*0.809+Var6,COLORYELLOW,POINTDOT;
A:=LOW=LLV(LOW,240);
A1:=BARSLAST(A);
VERTLINE(A1=30);
VERTLINE(A1=60);
VERTLINE(A1=90);
VERTLINE(A1=120);
VERTLINE(A1=150);
VERTLINE(A1=180);
VERTLINE(A1=210);
VERTLINE(A1=240);
DRAWTEXT(A1=30,HIGH,'第一时间');
DRAWTEXT(A1=60,HIGH,'第二时间');
DRAWTEXT(A1=90,HIGH,'第三时间');
DRAWTEXT(A1=120,HIGH,'第四时间');
DRAWTEXT(A1=150,HIGH,'第五时间');
DRAWTEXT(A1=180,HIGH,'第六时间');
DRAWTEXT(A1=210,HIGH,'第七时间');
DRAWTEXT(A1=240,HIGH,'第八时间');
Varr1:=SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),6,1)*100;
DRAWICON(CROSS(82,Varr1),HIGH+0.108,2);VERTLINE(CROSS(82,varr1)),POINTDOT;
DRAWSL(CROSS(82,varr1),HHV(HIGH,1),0,8,1),colormagenta,POINTDOT;
DRAWICON(COUNT(CROSS(Varr1,18),5) and CROSS(WMA(CLOSE,5),ref(WMA(CLOSE,5),1)),l-0.108,1);
b1:=(SYSPARAM(4)-SYSPARAM(5))/(SYSPARAM(3)-SYSPARAM(2));
DRAWSL(BARPOS=SYSPARAM(1),LOW,378*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,188*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,141*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,95*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,48*b1/100,0,0),COLORgreen,;
DRAWSL(BARPOS=SYSPARAM(1),LOW,24.5*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,16.5*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,13*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,7*b1/100,0,0),COLORwhite,POINTDOT;
m1:=barslast(month<>ref(month,1));
w1:=barslast(weekday<ref(weekday,1));
wO:ref(O,w1),colorff00ff;//周開盤,
mO:ref(O,m1),colorwhite;//月開盤,
画线法1超短压力线
STICKLINE(CLOSE<OPEN and ref(CLOSE,1)>ref(OPEN,1),ref(close,1),ref(close,1),20,0),COLORFFFFFF;
画线法19画线性回归通道
input:t(60);
drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
p:=if(SYSPARAM(1)<datacount-t,SYSPARAM(1),SYSPARAM(3)-t);
Ax:=p=BARPOS;//A点横坐标
yk:=slope(c,t+1);//通道斜率
yc:=forcast(c,t+1);
Ay:=yc[p+t]-yk[p+t]*t;//A点纵坐标
Bx:=ref(Ax,t);//B点横坐标
By:=yc[p+t];//B点纵坐标
中:LINEVALUE(Ax,Ay,Bx,By,0,0);
js:=hhv(h-中,t+1);
jq:=hhv(中-L,t+1);
上:LINEVALUE(Ax,Ay+js[p+t],Bx,By+js[p+t],0,0);
下:LINEVALUE(Ax,Ay-jq[p+t],Bx,By-jq[p+t],0,0);
STICKLINE(Ax or Bx,上,下,0.01,0)COLORGRAY,POINTDOT;
K:=(中-ref(中,t))/t;//(refx(中,t)-中)/中/t*100;
斜y:k,linethick0;
斜%:K[p+t]/中*100,linethick0;
宽%:((上-下)*cos(atan(K[p+t]))/下[p+t])*100,linethick0;//相对宽度
宽y:(上-下)*cos(atan(K[p+t])),linethick0;//绝对宽度
时间黄金分割
公式用法, 1鼠标选取画线范围,然后放大。2假如左右边界多余几棵K线,可以不再次放大,调整参数即可。3对于0.236和0.764的划分,我单独做了个开关,调整参数即可。
{时间黄金分割}{☆殊途同归☆ by天津 x1835}
{☆§提示:1计算机画线不能代替手工作图。
2确定历史数据完整。}
{精确的黄金分割是二分之根号五减一,即0.618=(SQRT(5)-1)/2}
{注释里有黄金分割的解释}
input:左侧右移(0),右侧左移(0),开关(1,1,2);
t1:=barpos=sysparam(2)+左侧右移;
t2:=barpos=sysparam(3)-右侧左移;
t11:=sysparam(2)+左侧右移;
t21:=sysparam(3)-右侧左移;
ymd:=date;
D1:ymd[t11],linethick0;
D2:ymd[t21],linethick0;
{D2:hhv(if(t2,date,0),0),linethick0;}
VERTLINE(t1),color00ffff,LINEDOT;
VERTLINE(t2),color00ffff,LINEDOT;
{d1:=if(t1 or t2,barpos,0);
dd:=d1;
x835:=SORTPOS(dd,1,1,datacount);
间隔:abs(d1[dd[1]]-d1[dd[2]]),linethick0;}
间隔:t21-t11,linethick0;
{ccc:ref(BARSTATUS=2,右侧左移);}
x1:=间隔*(0.191);
x8:=间隔*(0.382);
x05:=间隔*(0.5);
x3:=间隔*(0.618);
x5:=间隔*(0.809);
x1831:=sysparam(2)+左侧右移+ROUND(x1);
tx1:=BARPOS=x1831;
VERTLINE(tx1),colorffff33,LINEDOT;
D191:ymd[x1831],linethick0;
x1838:=t11+ROUND(x8);
tx8:=BARPOS=x1838;
VERTLINE(tx8),color00aaaa,LINEDOT;
D382:ymd[x1838],linethick0;
x18305:=t11+ROUND(x05);
tx05:=BARPOS=x18305;
VERTLINE(tx05),color0000ff,LINEDOT;
D05:ymd[x18305],linethick0;
x1833:=t11+ROUND(x3);
tx3:=BARPOS=x1833;
VERTLINE(tx3),color00aaaa,LINEDOT;
D618:ymd[x1833],linethick0;
x1835:=t11+ROUND(x5);
tx5:=BARPOS=x1835;
VERTLINE(tx5),colorffff33,LINEDOT;
D809:ymd[x1835],linethick0;
ph:=SYSPARAM(4);
pl:=SYSPARAM(5);
drawtext(t1,pl,STRLEFT(NUMTOSTR(d1+19000000,0),4)+STRRIGHT(NUMTOSTR(d1,0),4)),color00ffff;
drawtext(t2,pl,STRLEFT(NUMTOSTR(d2+19000000,0),4)+STRRIGHT(NUMTOSTR(d2,0),4)),color00ffff,align2;
drawtext(tx1,pl,STRLEFT(NUMTOSTR(d191+19000000,0),4)+STRRIGHT(NUMTOSTR(d191,0),4)),colorffff33;
drawtext(tx8,pl,STRLEFT(NUMTOSTR(d382+19000000,0),4)+STRRIGHT(NUMTOSTR(D382,0),4)),color00aaaa;
drawtext(tx05,pl,STRLEFT(NUMTOSTR(d05+19000000,0),4)+STRRIGHT(NUMTOSTR(D05,0),4)),color0000ff;
drawtext(tx3,pl,STRLEFT(NUMTOSTR(d618+19000000,0),4)+STRRIGHT(NUMTOSTR(D618,0),4)),color00aaaa;
drawtext(tx5,pl,STRLEFT(NUMTOSTR(d809+19000000,0),4)+STRRIGHT(NUMTOSTR(d809,0),4)),colorffff33;
drawtext(t1,ph,'0点'),color00ffff;
drawtext(t2,ph,'100%'),color00ffff,align2;
drawtext(tx1,ph,'0.191'),colorffff33;
drawtext(tx8,ph,'0.382'),color00aaaa;
drawtext(tx05,ph,'0.5'),color0000ff;
drawtext(tx3,ph,'0.618'),color00aaaa;
drawtext(tx5,ph,'0.809'),colorffff33;
if 开关=2 then
begin
x236:=间隔*(0.236);
x764:=间隔*(0.764);
x236:=sysparam(2)+左侧右移+ROUND(x236);
tx236:=BARPOS=x236;
VERTLINE(tx236),coloraaaaaa,LINEDOT;
D236:ymd[x236],linethick0;
x764:=t11+ROUND(x764);
tx764:=BARPOS=x764;
VERTLINE(tx764),coloraaaaaa,LINEDOT;
D764:ymd[x764],linethick0;
pllh:=(pl*4+ph)/5;
phhl:=(pl+ph*4)/5;
drawtext(tx236,pllh,STRLEFT(NUMTOSTR(d236+19000000,0),4)+STRRIGHT(NUMTOSTR(d236,0),4)),coloraaaaaa;
drawtext(tx764,pllh,STRLEFT(NUMTOSTR(d764+19000000,0),4)+STRRIGHT(NUMTOSTR(d764,0),4)),coloraaaaaa;
drawtext(tx236,phhl,'0.236'),coloraaaaaa;
drawtext(tx764,phhl,'0.764'),coloraaaaaa;
end;
{§历史影响现在,现在影响未来。§}
江恩角度线 周期、角A
a:=BARSCOUNT(c);
ah:=hhv(h,72);
al:=llv(l,72);
a0:=(ah-al)/21;
b1:=l-a0;
stickline((a+0)/13=FLOOR((a+0)/13),b1,b1-3*a0,1,0);
drawtext((a+0)/13=FLOOR((a+0)/13),b1-2.5*a0,'转向'),COLORWHITE;
INPUT:n(13,1,999),上角(11,0,500),下角(11,0,500);
N日:=n*10;
p1:=CLOSE-REF(CLOSE,1);p2:=SUM(ABS(p1),0); p3:=COUNT(CLOSE>0,0);
k1:=p2/p3/上角*10;k2:=p2/p3/下角*10;
DRAWSL(FILTER(BACKSET(ISLASTBAR,HHVBARS(HIGH,N日)+1),N日),HIGH,-0.5*K2,0,0),COLOR33FFCC,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,HHVBARS(HIGH,N日)+1),N日),HIGH, -K2,0,0),COLOR33FFCC,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,HHVBARS(HIGH,N日)+1),N日),HIGH,-2*K2,0,0),COLOR33FFCC;
DRAWSL(FILTER(BACKSET(ISLASTBAR,HHVBARS(HIGH,N日)+1),N日),HIGH,-4*K2,0,0),COLOR33FFCC,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,HHVBARS(HIGH,N日)+1),N日),HIGH,-8*K2,0,0),COLOR33FFCC,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,LLVBARS(LOW,N日)+1),N日),LOW,0.5*K1,0,0),COLORffCCff,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,LLVBARS(LOW,N日)+1),N日),LOW, K1,0,0),COLORffCCff,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,LLVBARS(LOW,N日)+1),N日),LOW,2*K1,0,0),COLORffCCff;
DRAWSL(FILTER(BACKSET(ISLASTBAR,LLVBARS(LOW,N日)+1),N日),LOW,4*K1,0,0),COLORffCCff,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,LLVBARS(LOW,N日)+1),N日),LOW,8*K1,0,0),COLORffCCff,POINTDOT;
买线:EMA(C,5),colorred,linethick2;
A:=(REF(买线,1));
卖线:EMA(SLOPE(C,10)*13+C,31),linethick2;
b:=cross(买线,卖线);
s:=cross(卖线,买线);
drawtext(b,LOW-0.1,'。买 '),colorf00ff0,linethick1;
drawtext(s,HIGH+0.1,'。卖'),coloryellow,linethick1;
ma30:ma(c,30);
ma60:ma(c,60),COLORWHITE;
自动划线RSI
input:n1(14),n(3);
REFLINE: 30, 50,70,;
LC := REF(c,1);
RSI1:SMA(MAX(c-LC,0),N1,1)/SMA(ABS(c-LC),N1,1)*100,COLORRED;
M3:ema(rsi1,3),Color114433;
M5:ema(rsi1,5),Color116611;
M8:ema(rsi1,8),Color118811;
M10:ema(rsi1,10),Color11aa11;
M12:ema(rsi1,12),COLOR11cc11;
M14:ema(rsi1,14),Color11dd11;
RSI3:SMA(MAX(CLOSE-LC,0),16,1)/SMA(ABS(CLOSE-LC),16,1)*100,COLOR272c9C;
RSI5:SMA(MAX(CLOSE-LC,0),18,1)/SMA(ABS(CLOSE-LC),18,1)*100,COLOR272480;
RSI8:SMA(MAX(CLOSE-LC,0),20,1)/SMA(ABS(CLOSE-LC),20,1)*100,Color27246a;
RSI12:SMA(MAX(CLOSE-LC,0),22,1)/SMA(ABS(CLOSE-LC),20,1)*100,Color272450;
RSI2:SMA(MAX(CLOSE-LC,0),14,1)/SMA(ABS(CLOSE-LC),14,1)*100,COLORWHITE,LINETHICK1;
中轨:ma(RSI1,6),Color033337,LINETHICK2;
r:=(RSI1-中轨)*(RSI1-中轨);
x:=SQRT(ma(r,20));
UPPER:=中轨+1.96*x,COLOR224422;
LOWER:=中轨-1.96*x,COLOR224422;
M7:MA(RSI1,7),ColorAFAFAF;
ty:=rsi1;
A1:=REF(ty,N)=HHV(ty,2*N+1); B1:=FILTER(A1,N); C1:=BACKSET(B1,N+1); D1:=FILTER(C1,N);{前高}
A2:=REF(ty,N)=LLV(ty,2*N+1); B2:=FILTER(A2,N); C2:=BACKSET(B2,N+1); D2:=FILTER(C2,N);{前低}
H1:=(D1 AND NOT(D2)) OR islastbar OR BARSCOUNT(C)=1;
L1:=(D2 AND NOT(D1));H2:=D1 AND NOT(D2);
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 islastbar 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(islastbar,BARSLAST(HD)+1); S1:=R1>REF(R1,1); {前一高}
T1:=BACKSET(islastbar,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); {前二低}
T3:=BACKSET(U2,REF(BARSLAST(LD),1)+2); U3:=T3>REF(T3,1); {前三低}
T4:=BACKSET(U3,REF(BARSLAST(LD),1)+2); U4:=T4>REF(T4,1); {前四低}
R3:=BACKSET(S2,REF(BARSLAST(HD),1)+2); S3:=R3>REF(R3,1); {前三高}
R4:=BACKSET(S3,REF(BARSLAST(HD),1)+2); S4:=R4>REF(R4,1); {前四高}
压力一:dRAWLINE(S2,ty,S1,ty,1),Color3EFFBC; {★压力1:}
支撑一:dRAWLINE(U2,ty,U1,ty,1),COLORYELLOW,linethick1;{★支撑1:重要}
压力二:dRAWLINE(S3,ty,S2,ty,1),ColorFF8000; {★压力2:}
支撑二:DRAWLINE(U3,ty,U2,ty,1),POINTDOT,ColorFF8000;{★支撑2:}
压力三:DRAWLINE(S4,ty,S3,ty,1),COLORMAGENTA;{★压力3:}
支撑三:DRAWLINE(U4,ty,U3,ty,1),POINTDOT,COLORMAGENTA,LINETHICK1;{★支撑3:};
QS:=HHV(RSI1,13);
RS:=llV(RSI1,13);
Var1:=BACKSET(REF(QS,2)=HHV(QS,5),3);
Var2:=CROSS(Var1,0.9);
Var3:=BACKSET(REF(RS,2)=LLV(RS,5),3);
Var4:=CROSS(Var3,0.9);
压力:REF(QS,BARSLAST(Var2)),POINTDOT,Color00ff00;
STICKLINE(RSI1,REF(QS,BARSLAST(Var2)),REF(QS,BARSLAST(Var2)),5,0),Color00ff00;
支撑:REF(RS,BARSLAST(Var4)),POINTDOT,Color0087FF;
STICKLINE(RSI1,REF(RS,BARSLAST(Var4)),REF(RS,BARSLAST(Var4)),5,0),Color0087FF;
DRAWICON(CROSS(RSI1,LOWER),LOWER,4);
DRAWICON(CROSS(UPPER,RSI1),UPPER,5);
RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
DRAWTEXT(CROSS(88,RSI),80,'顶'),COLORCYAN;
本文地址:
http://www.45fan.com/a/question/38429.html