MA5:MA(C,5)COLORWHITE,LINETHICK1;
MA10:MA(C,10)COLORYELLOW,LINETHICK1;
MA20:MA(C,20),COLORMAGENTA,LINETHICK2;
MA30:=MA(C,30)COLORGREEN,LINETHICK1;
MA60:=MA(C,60)COLORBLUE,LINETHICK2;
JXX:=BARSLASTCOUNT(C MA20);
JXX1:=BACKSET((JXX =4)*JXX,JXX);
JXS:=BARSLASTCOUNT(C MA20);
JXS1:=BACKSET((JXS =4)*JXS,JXS);
KGC:=BARSLASTCOUNT(NOT(JXX1 OR JXS1));
JXL:=BARSLASTCOUNT(REF(JXX1 0,KGC));
JXH:=BARSLASTCOUNT(REF(JXS1 0,KGC));
XWZ:=FILTERX(LLV(L,JXL)=L,JXL);
SWZ:=FILTERX(HHV(H,JXH)=H,JXH);
{DRAWLINE(XWZ,L,SWZ,H,0),COLOR00FFFF;在高低点连斜线}
高:=REF(H,BARSLAST(SWZ)); {九毛八公式指标网www.9m8.cn}
低:=REF(L,BARSLAST(XWZ));{这种情况应对目前在20下方,如青松建化16-4-8};
BB:=BARSLAST(JXL=1);{上次JXL等于1距今天数}
顶点2:=REF(高,BARSLAST(JXL)),COLORYELLOW;
低点2:=REF(低,BB),COLORYELLOW;{上次等于1对应的低价。或用AA:REF(低,BB);}
H23:=((顶点2-低点2)*0.236+低点2);
H38:=((顶点2-低点2)*0.382+低点2);
H中:=((顶点2-低点2)*0.5+低点2);
H61:=((顶点2-低点2)*0.618+低点2);
H80:=((顶点2-低点2)*0.809+低点2);
H138:=((顶点2-低点2)*1.382+低点2);
H161:=((顶点2-低点2)*1.618+低点2);
H200:=((顶点2-低点2)*2+低点2);
顶点A:REFDATE(顶点2,DATE),COLORYELLOW;
低点A:REFDATE(低点2,DATE),COLORYELLOW;
A23:REFDATE(H23,DATE),COLORYELLOW,DOTLINE;
B38:REFDATE(H38,DATE),COLORYELLOW,DOTLINE;
C50:REFDATE(H中,DATE),COLORYELLOW,DOTLINE;
D61:REFDATE(H61,DATE),COLORYELLOW;
E80:REFDATE(H80,DATE),COLORYELLOW,DOTLINE;
F138:REFDATE(H138,DATE),COLORYELLOW,DOTLINE;
G161:REFDATE(H161,DATE),COLORYELLOW;
H201:REFDATE(H200,DATE),COLORYELLOW;
DRAWTEXT(ISLASTBAR,顶点A,'顶点'),COLORWHITE;
DRAWTEXT(ISLASTBAR,A23,'%23.6'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,B38,'%38.2'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,C50,'%50'),COLORRED;
DRAWTEXT(ISLASTBAR,D61,'%61.8'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,E80,'%80.9'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,低点A,'低点'),COLORWHITE;
DRAWTEXT(ISLASTBAR,F138,'%138.2'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,G161,'%161.8'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,H201,'%200'),COLORMAGENTA;