通达信多空趋势A副图指标
通达信多空趋势A副图指标
源码
VAR1:=EMA(MA(IF(C>O,(C-O)*V,IF(C<O,(C-O)*V,0)),5),1);
VAR2:=EMA(MA(IF(C>REF(C,1),(C-REF(C,1))*V,IF(C<REF(C,1),(C-REF(C,1))*V,0)),5),1);
VAR3:=EMA(MA(IF(O>REF(C,1),(O-REF(C,1))*V,IF(O<REF(C,1),(O-REF(C,1))*V,0)),5),1);
VAR4:=EMA(MA(IF(C<O,(O-C)*V,IF(C>O,(O-C)*V,0)),10),1);
VAR5:=EMA(MA(IF(C<REF(C,1),(REF(C,1)-C)*V,IF(C>REF(C,1),(REF(C,1)-C)*V,0)),10),1);
VAR6:=EMA(MA(IF(O<REF(C,1),(REF(C,1)-O)*V,IF(O>REF(C,1),(REF(C,1)-O)*VOL,0)),10),1);
VAR7:=C>O;
VAR8:=C>REF(C,1);
VAR9:=O>REF(C,1);
多头:(VAR1+VAR2+VAR3)/3/100,COLORWHITE;
空头:(VAR4+VAR5+VAR6)/3/100,COLORYELLOW ;
一次警报:EMA(EMA((VAR1+VAR2+VAR3)/3-(VAR4+VAR5+VAR6)/3,5),5)*1/100,COLORMAGENTA;
二次警报:EMA((COUNT(VAR8,12)/12+COUNT(VAR7,12)/12+COUNT(VAR9,12)/12)/3*MA(多头,5)*2*1.1,2),COLORGREEN;
STICKLINE(空头>0,0,空头,1,0),COLORCYAN;
STICKLINE(空头<0,0,空头,1,0),COLORRED;
X1:=EMA(EMA((VAR1+VAR2+VAR3)/3-(VAR4+VAR5+VAR6)/3,5),5)*1/100;
X2:=EMA((COUNT(VAR8,12)/12+COUNT(VAR7,12)/12+COUNT(VAR9,12)/12)/5*MA(多头,5.3)*2*6.8,5);
X3:=EMA((COUNT(VAR8,22)/22+COUNT(VAR7,22)/22+COUNT(VAR9,22)/22)/18*MA(多头,8)*5*1.8,5);
DRAWTEXT(CROSS(X1,0),0,'★'),COLORFF9999,LINETHICK2;
DRAWTEXT(CROSS(X2,0),0,'★'),COLORFF99FF,LINETHICK2;
DRAWTEXT(CROSS(X3,0),0,'★<'),COLORGREEN,LINETHICK2;
- 上一篇公式:通达信看图解势副图指标
- 下一篇公式:通达信多空趋势B副图指标