以下是通达信经典主图线指标公式源码和截图
通达信经典主图黄金分割线指标公式源码:
N:=80;
M:=3;
高:=7.41;
低:=4.30;
ma5:MA(CLOSE,5);
MA10:MA(CLOSE,10);
MA20:MA(CLOSE,20),LINETHICK1;
MA60:MA(CLOSE,60),LINETHICK1;
{高:=REF(HHV(H,N),M);
低:=REF(LLV(L,N),M);}{自动定位法}
H38:=高-(高-低)*0.382;
H中:=高-(高-低)*0.5;
H61:=高-(高-低)*0.618;
顶点:REFDATE(高,DATE),DOTLINE,COLORWHITE;
H61.8%:REFDATE(H38,DATE),DOTLINE,COLORMAGENTA;
H50%:REFDATE(H中,DATE),DOTLINE,COLORRED;
H38.2%:REFDATE(H61,DATE),DOTLINE,COLORMAGENTA;
低点:REFDATE(低,DATE),DOTLINE,COLORWHITE;
DRAWTEXT(ISLAstBAR,顶点,'顶点'),COLORWHITE;
DRAWTEXT(ISLASTBAR,H38.2%,'H38.2%'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,H50%,'H50%'),COLORRED;
DRAWTEXT(ISLASTBAR,H61.8%,'H61.8%'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,低点,'低点'),COLORWHITE;
日:=150;昨前:=3;
高1:=REF(HHV(H,日),昨前);
低1:=REF(LLV(L,日),昨前);
H1:=高1-(高1-低1)*0.191;
H2:=高1-(高1-低1)*0.382;
H3:=高1-(高1-低1)*0.5;
H4:=高1-(高1-低1)*0.618;
H5:=高1-(高1-低1)*0.809;
顶:REFDATE(高1,DATE),COLORGREEN,CROSSDOT,LINETHICK2;
零点191:REFDATE(H1,DATE),COLORCYAN;
零点382:REFDATE(H2,DATE),COLORYELLOW;
零点5:REFDATE(H3,DATE),COLORRED;
零点618:REFDATE(H4,DATE),COLORYELLOW;
零点809:REFDATE(H5,DATE),COLORCYAN;
低:REFDATE(低1,DATE),COLORRED,CROSSDOT,LINETHICK2;
N1:=5;
N2:=10;
N3:=20;
N4:=30;
{画K线}
STICKLINE(C =BBI,O,C,2.5,1),COLOR0000EE;
STICKLINE(C =BBIANDC =O,C,H,0,1),COLOR0000EE;
STICKLINE(C =BBIANDC =O,O,L,0,1),COLOR0000EE;
STICKLINE(C =BBIANDC O,O,H,0,1),COLOR0000EE;
STICKLINE(C =BBIANDC O,C,L,0,1),COLOR0000EE;
STICKLINE(C BBI,O,C,2.5,1),COLORBLUE;
STICKLINE(C BBIANDC =O,C,H,0,1),COLORBLUE;
STICKLINE(C BBIANDC =O,O,L,0,1),COLORBLUE;
STICKLINE(C BBIANDC O,O,H,0,1),COLORBLUE;
STICKLINE(C BBIANDC O,C,L,0,1),COLORBLUE;
BBI:(MA(CLOSE,N1)+MA(CLOSE,N2)+MA(CLOSE,N3)+MA(CLOSE,N4))/4,COLORRED,LINETHICK2;
BB:=BBI REF(BBI,1);
IF(BB,BBI,DRAWNULL)COLORGREEN,LINETHICK2;
DRAWICON(CROSS(C,BBI),BBI*0.975,1);
DRAWICON(CROSS(BBI,C),BBI*1.015,2);
BS:=EMA(C,5),COLORWHITE;
升升不息:EMA(BS,30),COLORMAGENTA,LINETHICK2;
重心:(H+L+3*C+O)/6,NODRAW;
STICKLINE(重心 0,重心,重心*1.001,0.1,0),COLORLIRED;
重心转向:重心 REF(重心,1)ANDREF(重心,1) REF(重心,2),NODRAW;
STICKLINE(重心转向,L,MAX(C,O),0.1,0),COLORYELLOW;
STICKLINE(重心转向,L,L*1.001,2,0),COLORYELLOW;
N:=33;
高:=EMA(H/REF(CLOSE,1),N)*C,COLORCYAN,DOTLINE;
低:=EMA(L/REF(CLOSE,1),N)*C,COLORRED,DOTLINE;
卖:IF(CURRBARSCOUNT=1,高,DRAWNULL),COLORLIRED;
买:IF(CURRBARSCOUNT=1,低,DRAWNULL),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,卖,'_____'),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=1,买,'_____'),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=1,卖*1.01,卖),COLORLIRED;
DRAWNUMBER(CURRBARSCOUNT=1,买*1.01,买),COLORYELLOW;
VAR6:=REF(C,1);
VAR7:=SMA(MAX(C-VAR6,0),6,1)/SMA(ABS(C-VAR6),6,1)*100;
DRAWTEXT(CROSS(82,VAR7),H*1.01,'高抛'),COLORYELLOW;
通达信经典主图黄金分割线指标公式截图