以下是通达信箱体主图指标公式源码和使用说明
通达信趋势箱体主图指标公式源码:
高1:=REF(HHV(H,144),3);
低1:=REF(LLV(L,144),3);
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),POINTDOT,COLORCYAN;
%19:=REFDATE(H1,DATE),POINTDOT,COLORYELLOW;
%38:REFDATE(H2,DATE),POINTDOT,COLORYELLOW;
%50:REFDATE(H3,DATE),POINTDOT,COLORWHITE;
%62:REFDATE(H4,DATE),POINTDOT,COLORYELLOW;
%80:=REFDATE(H5,DATE),POINTDOT,COLORYELLOW;
☆价:REF(EMA(C,14),1)COLORBLUE;
A1X:=(EMA(C,14)-☆突破价)/☆突破价*100,NODRAW;
★操作区:IF(A1X =0,REF(EMA(C,14),BARSLAST(CROSS(A1X,0))+1),DRAWNULL)COLORGREEN,LINETHICK2;
☆观望区:IF(A1X 0,REF(EMA(C,14),BARSLAST(CROSS(0,A1X))+1),DRAWNULL)COLORBLUE,LINETHICK2;
趋势而为:IF(A1X =0,☆突破价,DRAWNULL)COLORGREEN;
STICKLINE(A1X =0,★操作区,☆突破价,0,-1)COLORGREEN;
STICKLINE(A1X 0,☆观望区,☆突破价,0,-1)COLORBLUE;
STICKLINE(CROSS(A1X,0),C,O,2,0)COLORGREEN;
STICKLINE(CROSS(0,A1X),C,O,2,0)COLORBLUE;
上收:=C;
上开:=O;
上高:=H;
上低:=L;
上箱顶:MA(REF(HHV(上收,21),1),4),COLORFF00FF,LINETHICK2;
下箱底:MA(REF(LLV(上收,21),1),5),COLOR00FF00,LINETHICK2;
趋势生命线:MA(CLOSE,55),LINETHICK0,COLORFF0000;
FF:=EMA(CLOSE,2);
MA15:=EMA(CLOSE,21);
AA:=(CLOSE-MA15);
STICKLINE((MA15 REF(MA15,1)),MA15,MA15,3.5,5),LINETHICK2,COLORRED;
STICKLINE((MA15 REF(MA15,1)),MA15,MA15,3.5,5),LINETHICK2,COLOR00FF00;
STICKLINE(C 下箱底ANDC =O,C,O,3.5,0),COLOR00FFFF;
STICKLINE(C 下箱底ANDC O,C,O,3.5,0),COLOR00FFFF;
STICKLINE(C 下箱底ANDC =O,C,O,1.5,0),COLOR00FFFF;
STICKLINE(C 下箱底ANDC =O,H,L,0,0),COLOR00FFFF;
STICKLINE(C 下箱底ANDC O,C,H,0,0),COLOR00FFFF;
STICKLINE(C 下箱底ANDC O,O,L,0,0),COLORRED;
精灵:=(上开+上高+上低)/3;
遍地黄金:=EMA(短线精灵,2);
黄金遍地:遍地黄金,COLOR808088,LINETHICK0;
买进价:=((C-REF(MA(C,6),1))/6+MA(C,6))*1.03;
买进条件:=crOSS(C,买进价)AND买进价 REF(买进价,1);
STICKLINE(买进条件ANDFF 下箱底ANDC REF(下箱底,1),L,L*0.998,5,0),COLOR00FFFF,LINETHICK2;
STICKLINE(C =买进价ANDC =O,C,O,3.5,0),COLORRED;
STICKLINE(C =买进价ANDC =O,C,O,0.2,0),COLOR00FFFF;
STICKLINE(C =买进价ANDC =O,C,O,0.2,0),COLOR00FFFF;
STICKLINE(C =买进价ANDC =O,H,L,0,0),COLOR00FFFF;
STICKLINE(C 买进价ANDC =O,H,L,0,0),COLOR00FF00;
VAR1:=(上收-LLV(上低,27))/(HHV(上高,27)-LLV(上低,27))*100;
VAR2:=SMA(VAR1,3,1);
VAR3:=SMA(VAR2,3,1);
VAR4:=SMA(VAR3,3,1);
DRAWTEXT(FILTER((CROSS(VAR3,VAR4)ANDVAR3 40),34),下箱底,'买进'),COLORF00FF0;
DRAWTEXT(FILTER((CROSS(VAR4,VAR3)ANDVAR4 75),34),上箱顶*1.02,'卖岀'),COLORF0F000;
VAR1:=(H+L)/2;
ao:=SMA(VAR1,5,1)-Sma(VAR1,34,1),COLOR6699CC;
ac:=SMA((AO-SMA(AO,5,1)),5,1),COLOR6699CC;
X1:=AO REF(AO,1)ANDAC REF(AC,1);
X2:=AO REF(AO,1)ANDAC REF(AC,1);
Y:=(H+L)/2;
RED:=SMA(Y,8,1);
R2:=REF(RED,5);
KU1:=IF(H=HHV(H,3),1,0);
kd1:=IF(L=LLV(L,3),1,0);
UL:=IF(REF(KU1,2)=1ANDREF(KU1,1)=0ANDKU1=0,REF(H,2),REF(H,2+BArslAst(REF(KU1,2)=1ANDREF(KU1,1)=0ANDKU1=0)));
DL:=IF(REF(KD1,2)=1ANDREF(KD1,1)=0ANDKD1=0,REF(L,2),REF(L,2+BARSLAST(REF(KD1,2)=1ANDREF(KD1,1)=0ANDKD1=0)));
蓝:SMA(Y,13,1),COLORBLUE;
红:SMA(Y,5,1),COLORRED;
绿:SMA(Y,3,1),COLORGREEN;
上张:=蓝 =REF(蓝,1)AND红 =REF(红,1)AND绿 =REF(绿,1);
下张:=蓝 REF(蓝,1)AND红 REF(红,1)AND绿 REF(绿,1);
上碎:=IF(H =R2,UL,REF(UL,BARSLAST(H R2)));
下碎:=IF(L =R2,DL,REF(DL,BARSLAST(L =R2)));
STICKLINE(BARSLAST(Abs(上碎-REF(上碎,1))) BARSLAST(C 上碎ANDREF(C,1) REF(上碎,1)),上碎,上碎,3,1),COLORMAGENTA;
STICKLINE(BARSLAST(ABS(下碎-REF(下碎,1))) BARSLAST(C 下碎ANDREF(C,1) REF(下碎,1)),下碎,下碎,3,1),COLORCYAN;
LC:=REF(C,4);
RMI:=SMA(MAX(C-LC,0),7,1)/SMA(ABS(C-LC),7,1)*100;
QS:=HHV(MA(RMI,3),13),COLOR00ADFF;
RMIMA:=SMA(RMI,3,1),COLOR009C00;
DRAWTEXT(C 上碎 ISLASTBAR=1,H+0,'向上突破有效上碎型'),COLOR0000FF;
DRAWTEXT(C 下碎 ISLASTBAR=1,L-0,'向下有效碎型被突破'),COLORFFFF00;
DRAWTEXT(X1 0 ISLASTBAR=1,H+0.3,'AO与AC为多方趋势'),COLORFF00FF;
DRAWTEXT(X2 0 ISLASTBAR=1,L-0.3,'AO与AC为空方趋势'),COLOR00FF00;
DRAWTEXT(上张 ISLASTBAR=1,H+0.6,'鳄鱼向上张嘴'),COLOR999999;
DRAWTEXT(下张 ISLASTBAR=1,L-0.6,'鳄鱼向下张嘴'),COLOR999999;
DRAWTEXT(上张 X1 0 ISLASTBAR=1,H+0.8,'怀疑中期多头'),COLORFF00FF;
DRAWTEXT(下张 X2 0 ISLASTBAR=1,L-0.8,'怀疑中期空头'),COLOR00FF00;
DRAWTEXT((RMI RMIMA RMI QS) ISLASTBAR=1,H+1,'小心做多'),COLOR00FFFF;
DRAWTEXT((RMI RMIMA RMI QS) ISLASTBAR=1,H+1,'坚决做多'),COLOR0000FF;
DRAWTEXT((RMI RMIMA RMI 20) ISLASTBAR=1,L-1,'坚决做空'),COLORFF0000;
DRAWTEXT((RMI RMIMA RMI 20) ISLASTBAR=1,L-1,'小心做空'),COLORFF00FF;
通达信趋势箱体主图指标公式截图