天数:=200;
上角度调整:=70;
下角度调整:=70;
趋势线开关:=1;
上角度线开关:=1;
下角度线开关:=1;
分割比率开关:=1;
调点:=3;
DRAWTEXT_FIX(1,0.75,0.01,1,'江恩角度线在缺省值是200天周期内自动选择高、低起点,调整天数会选定新的起点,1×1线的终点要通过上、下角度值的调整确定,上升趋势中选择行情的关键最高点,下降趋势中选择行情的关键最低点。'),COLORYELLOW;
{图中的横虚线是江恩比率分割线}
A111:=REF(H,3)=HHV(H,2*6+1);
B111:=FILTER(A111,3);
C111:=BACKSET(B111,3+1);
D111:=FILTER(C111,3+1);
A112:=REF(L,3)=LLV(L,2*6+1);
B112:=FILTER(A112,3+1);
C112:=BACKSET(B112,3+1);
D112:=FILTER(C112,3);
E111:=(REF(LLV(L,2*3),1)+REF(HHV(H,2*3),1))/2;
E112:=(H+L)/2;
H111:=(D111 AND NOT(D112 AND E111>=E112)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
L111:=(D112 AND NOT(D111 AND E111<E112));
H112:=D111 AND NOT(D112 AND E111>=E112);
X111:=REF(BARSLAST(H111),1)+1;
F111:=BACKSET(H111 AND COUNT(L111,X111)>0,LLVBARS(IF(L111,LOW,10000),X111));
G111:=F111>REF(F111,1);
I111:=BACKSET(G111,2);
LD:=I111>REF(I111,1);
L112:=LD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
X112:=REF(BARSLAST(L112),1)+1;
F112:=BACKSET(L112 AND COUNT(H112,X112)>0,HHVBARS(IF(H112,HIGH,0),X112));
G112:=F112>REF(F112,1);
I112:=BACKSET(G112,2);
HD:=I112>REF(I112,1);
IF(趋势线开关=1,DRAWLINE(LD,L,HD,H,0),DRAWNULL)LINETHICK1,DOTLINE,COLOR0000FF;
IF(趋势线开关=1,DRAWLINE(HD,H,LD,L,0),DRAWNULL)LINETHICK1,DOTLINE,COLOR00FF00;
J111:=BACKSET(BARSTATUS=2 ,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J112:=J111>REF(J111,1);
预测走势:=IF(趋势线开关=1,DRAWLINE(J112,IF(HD,H,L),BARSTATUS=2,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),DRAWNULL),COLORYELLOW,DOTLINE;
G:=CURRBARSCOUNT,NODRAW;
DRAWNUMBER(趋势线开关=1 AND HD,H,G),COLORLIRED,DRAWABOVE;
DRAWNUMBER(趋势线开关=1 AND LD,L,G),COLORFFFF00;
STICKLINE(C>=O,C,O,3,0),COLOR000045;
STICKLINE(C>=O,C,O,2.5,0),COLOR000065;
STICKLINE(C>=O,C,O,2,0),COLOR000085;
STICKLINE(C>=O,C,O,1.5,0),COLOR0000A5;
STICKLINE(C>=O,C,O,1,0),COLOR0000C5;
STICKLINE(C>=O,C,O,0.5,0),COLOR0000E5;
STICKLINE(C>=O,H,L,0,0),COLOR0000F5;
STICKLINE(C<O,C,O,3,0),COLOR353500;
STICKLINE(C<O,C,O,2.5,0),COLOR454500;
STICKLINE(C<O,C,O,2,0),COLOR555500;
STICKLINE(C<O,C,O,1.5,0),COLOR656500;
STICKLINE(C<O,C,O,1,0),COLOR757500;
STICKLINE(C<O,C,O,0.5,0),COLOR858500;
STICKLINE(C<O,H,L,0,0),COLOR959500;
角度:=100;
SX跌H:=CONST(HHV(H,天数)),NODRAW;
SX涨L:=CONST(LLV(L,天数)),NODRAW;
涨点:=BARSSINCE(BACKSET(ISLASTBAR,BARSLAST(L=SX涨L)+1));
跌点:=BARSSINCE(BACKSET(ISLASTBAR,BARSLAST(H=SX跌H)+1));
最低:=IF(调点=1,跌点,IF(调点=2,涨点,IF(调点=3,涨点,跌点)));
L斜率:=IF(下角度线开关=1,下角度调整/IF(C<300,1000,10),DRAWNULL);
最高:=IF(调点=1,跌点,IF(调点=2,涨点,IF(调点=3,跌点,涨点)));
H斜率:=IF(上角度线开关=1,上角度调整/IF(C<300,1000,10),DRAWNULL);
天线:=SX跌H;
地线:=SX涨L;
K:=(天线-地线)/(IF(跌点>=涨点,跌点,涨点)-IF(跌点>=涨点,涨点,跌点));
上斜线:=IF(地线+CONST(L斜率*4.00)*最低>=地线,地线+CONST(L斜率*4.00)*最低,DRAWNULL);
上斜线0:=IF(地线+CONST(L斜率*2.00)*最低>=地线,地线+CONST(L斜率*2.00)*最低,DRAWNULL);
上斜线1:=IF(地线+CONST(L斜率*1.5)*最低>=地线,地线+CONST(L斜率*1.5)*最低,DRAWNULL);
上斜线2:=IF(地线+CONST(L斜率*1.00)*最低>=地线,地线+CONST(L斜率*1.000)*最低,DRAWNULL);
上斜线3:=IF(地线+CONST(L斜率*0.70)*最低>=地线,地线+CONST(L斜率*0.70)*最低,DRAWNULL);
上斜线4:=IF(地线+CONST(L斜率*0.50)*最低>=地线,地线+CONST(L斜率*0.50)*最低,DRAWNULL);
上斜线5:=IF(地线+CONST(L斜率*0.365)*最低>=地线,地线+CONST(L斜率*0.365)*最低,DRAWNULL);
上斜线6:=IF(地线+CONST(L斜率*0.250)*最低>=地线,地线+CONST(L斜率*0.250)*最低,DRAWNULL);
上斜线7:=IF(地线+CONST(L斜率*0.165)*最低>=地线,地线+CONST(L斜率*0.165)*最低,DRAWNULL);
上斜线8:=IF(地线+CONST(L斜率*0.123)*最低>=地线,地线+CONST(L斜率*0.123)*最低,DRAWNULL);
上斜线9:=IF(地线+CONST(L斜率*0.06)*最低>=地线,地线+CONST(L斜率*0.06)*最低,DRAWNULL);
上9:IF(上斜线9<=天线*1.05,上斜线9,DRAWNULL),COLORAA00AA,COLORRED;
上8:IF(上斜线8<=天线*1.05,上斜线8,DRAWNULL),COLORAA00AA,COLORRED;
上7:IF(上斜线7<=天线*1.05,上斜线7,DRAWNULL),COLORAA00AA,COLORRED;
上6:IF(上斜线6<=天线*1.05,上斜线6,DRAWNULL),COLORAA00AA,COLORRED;
上5:IF(上斜线5<=天线*1.05,上斜线5,DRAWNULL),COLORAA00AA,COLORRED;
上4:IF(上斜线4<=天线*1.05,上斜线4,DRAWNULL),COLOR0000FF,COLORYELLOW;
上3:IF(上斜线3<=天线*1.05,上斜线3,DRAWNULL),COLORAA00AA,COLORRED;
上2:IF(上斜线2<=天线*1.05,上斜线2,DRAWNULL),COLORAA00AA,COLORRED;
上1:IF(上斜线1<=天线*1.05,上斜线1,DRAWNULL),COLORAA00AA,COLORRED;
上0:IF(上斜线0<=天线*1.05,上斜线0,DRAWNULL),COLORAA00AA,COLORRED;
上:IF(上斜线<=天线*1.05,上斜线,DRAWNULL),COLORAA00AA,COLORRED;
下斜线:=IF(天线-CONST(H斜率*4.00)*最高<=天线,天线-CONST(H斜率*4.00)*最高,DRAWNULL);
下斜线0:=IF(天线-CONST(H斜率*2.00)*最高<=天线,天线-CONST(H斜率*2.00)*最高,DRAWNULL);
下斜线1:=IF(天线-CONST(H斜率*1.500)*最高<=天线,天线-CONST(H斜率*1.500)*最高,DRAWNULL);
下斜线2:=IF(天线-CONST(H斜率*1.000)*最高<=天线,天线-CONST(H斜率*1.000)*最高,DRAWNULL);
下斜线3:=IF(天线-CONST(H斜率*0.70)*最高<=天线,天线-CONST(H斜率*0.70)*最高,DRAWNULL);
下斜线4:=IF(天线-CONST(H斜率*0.50)*最高<=天线,天线-CONST(H斜率*0.50)*最高,DRAWNULL);
下斜线5:=IF(天线-CONST(H斜率*0.365)*最高<=天线,天线-CONST(H斜率*0.365)*最高,DRAWNULL);
下斜线6:=IF(天线-CONST(H斜率*0.250)*最高<=天线,天线-CONST(H斜率*0.250)*最高,DRAWNULL);
下斜线7:=IF(天线-CONST(H斜率*0.165)*最高<=天线,天线-CONST(H斜率*0.165)*最高,DRAWNULL);
下斜线8:=IF(天线-CONST(H斜率*0.123)*最高<=天线,天线-CONST(H斜率*0.123)*最高,DRAWNULL);
下斜线9:=IF(天线-CONST(H斜率*0.06)*最高<=天线,天线-CONST(H斜率*0.06)*最高,DRAWNULL);
下9:IF(下斜线9>=地线*0.95,下斜线9,DRAWNULL),COLORAAAAAA,COLORGREEN;
下8:IF(下斜线8>=地线*0.95,下斜线8,DRAWNULL),COLORAAAAAA,COLORGREEN;
下7:IF(下斜线7>=地线*0.95,下斜线7,DRAWNULL),COLORAAAAAA,COLORGREEN;
下6:IF(下斜线6>=地线*0.95,下斜线6,DRAWNULL),COLORAAAAAA,COLORGREEN;
下5:IF(下斜线5>=地线*0.95,下斜线5,DRAWNULL),COLORAAAAAA,COLORGREEN;
下4:IF(下斜线4>=地线*0.95,下斜线4,DRAWNULL),COLOR0000FF,COLORYELLOW;
下3:IF(下斜线3>=地线*0.95,下斜线3,DRAWNULL),COLORAAAAAA,COLORGREEN;
下2:IF(下斜线2>=地线*0.95,下斜线2,DRAWNULL),COLORAAAAAA,COLORGREEN;
下1:IF(下斜线1>=地线*0.95,下斜线1,DRAWNULL),COLORAAAAAA,COLORGREEN;
下0:IF(下斜线0>=地线*0.95,下斜线0,DRAWNULL),COLORAAAAAA,COLORGREEN;
下:IF(下斜线>=地线*0.95,下斜线,DRAWNULL),COLORAAAAAA,COLORGREEN;
高:=IF(分割比率开关=1,REFDATE(HHV(H,天数),DATE),DRAWNULL);
低:=IF(分割比率开关=1,REFDATE(LLV(L,天数),DATE),DRAWNULL);
H1:=高-(高-低)*0.125;
H2:=高-(高-低)*0.250;
H3:=高-(高-低)*0.375;
H4:=高-(高-低)*0.500;
H5:=高-(高-低)*0.625;
H6:=高-(高-低)*0.750;
H7:=高-(高-低)*0.875;
高位:REFDATE(高,DATE),COLORMAGENTA,CIRCLEDOT,LINETHICK1;
GA1:REFDATE(H7,DATE),COLORRED,DOTLINE,LINETHICK1;
GA2:REFDATE(H6,DATE),COLORLIRED,DOTLINE,LINETHICK1;
GA3:REFDATE(H5,DATE),COLORGREEN,DOTLINE,LINETHICK1;
GA4:REFDATE(H4,DATE),COLORYELLOW,LINETHICK1;
GA5:REFDATE(H3,DATE),COLORGREEN,DOTLINE,LINETHICK1;
GA6:REFDATE(H2,DATE),COLORYELLOW,DOTLINE,LINETHICK1;
GA7:REFDATE(H1,DATE),COLORRED,DOTLINE,LINETHICK1;
低位:REFDATE(低,DATE),COLORGREEN,CIRCLEDOT,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=1,高*0.995,'(高)'),COLORRED;
DRAWTEXT(CURRBARSCOUNT=1,H1,'(7/8)'),DRAWABOVE,COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=1,H2,'(6/8)'),DRAWABOVE,COLORFFFFFF;
DRAWTEXT(CURRBARSCOUNT=1,H3,'(5/8)'),DRAWABOVE,COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=1,H4,'(4/8)'),DRAWABOVE,COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,H5,'(3/8)'),DRAWABOVE,COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=1,H6,'(2/8)'),DRAWABOVE,COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=1,H7,'(1/8)'),DRAWABOVE,COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,低,'(低)'),DRAWABOVE,COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=10,高*0.99,CON2STR(高,2)),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=10,H1,CON2STR(H1,2)),DRAWABOVE,COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=10,H2,CON2STR(H2,2)),DRAWABOVE,COLORFFFFFF;
DRAWTEXT(CURRBARSCOUNT=10,H3,CON2STR(H3,2)),DRAWABOVE,COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=10,H4,CON2STR(H4,2)),DRAWABOVE,COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=10,H5,CON2STR(H5,2)),DRAWABOVE,COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=10,H6,CON2STR(H6,2)),DRAWABOVE,COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=10,H7,CON2STR(H7,2)),DRAWABOVE,COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=10,低*1.003,CON2STR(低,2)),DRAWABOVE,COLORGREEN;