通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
N:=5;M:=3;
H1:=EMA(DCLOSE,5);
A1:=LLV(DCLOSE,5);
A2:=A1+1/CURRBARSCOUNT*N;
A3:=IF(CURRBARSCOUNT 20ANDA1 REF(A1,1),CONST(REF(A2,10)),A1);
A4:=MA(A3,10);
A5:=H1+1/CURRBARSCOUNT*M;
A6:=IF(CURRBARSCOUNT 20ANDA1 REF(A1,1),CONST(REF(A5,10)),A3);
A7:MA(A6,10);
L1:=LLV(L,10);
DRAWBAND(A4,90,L1,RGB(35,135,35));
DRAWBAND(A7,90,A4,90);
敢死队操作线:MA(C,24),LINETHICK2,COLORLIMAGENTA;
操作线2:MA(C,26),LINETHICK1,COLORLICYAN;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
火箭起爆点:=(DCLOSE-REF(C,1))/REF(C,1)*100;
XG:=CROSS(火箭起爆点,20)ORCROSS(火箭起爆点,18);
L3:IF(XG,O,L1*0.999),COLORYELLOW;
STICKLINE(XG,L3,L3,100,0);
DRAWTEXT(XG,L3, 火箭起爆点 ),COLORMAGENTA;
MV5:=EMA(V,5);
MA5:=EMA(C,5);
MV5角度:=ATAN((MV5/REF(MV5,1)-1)*100)*180/3.1416;
MA5角度:=ATAN((MA5/REF(MA5,1)-1)*100)*180/3.1416;
量角:IF(MV5角度 30,MV5角度,0),COLOR0000FF,LINETHICK0;
价角:IF(MA5角度 0,MA5角度,MA5角度),COLORFFFFFF,LINETHICK2;
PARTLINE(价角,价角 REF(价角,1)AND价角 =0,RGB(255,0,0),价角 REF(价角,1)AND价角 0,RGB(0,255,0)),LINETHICK2;
QSXS:=MA5角度 REF(MA5角度,1)ANDMV5角度
∠45↑:IF(CROSS(MA5角度,30),1,0),COLORFFFFFF,POINTDOT,LINETHICK0;
买强:IF(MA5角度 45ANDQSXS,10,0),COLOR00FFFF,POINTDOT,LINETHICK0;
防火:IF(MA5角度 70ANDMV5角度 80,20,0),COLORFF00FF,POINTDOT,LINETHICK0;
卖疯:IF(MA5角度 80ANDMV5角度 80,30,0),COLOR0000FF,POINTDOT,LINETHICK0;
WK:=MA5角度=LLV(MA5角度,3)ANDMA5角度-HHV(MA5角度,4) =0-50;
挖坑:IF(WKANDCOUNT(买强OR防火,6),0-30,0),COLOR00FF00;
海底:IF(MA5角度 0-75,0-50,0-75),COLORFF8800;
{以下设置副图显示方式}
STICKLINE(MV5角度 30,MV5角度,30,0.1,0),COLOR0000FF;
STICKLINE(买强,0,10,4,0),COLOR00FFFF;
STICKLINE(防火,10,20,4,0),COLORFF00FF;
STICKLINE(卖疯,20,30,4,0),COLOR0000FF;
DRAWTEXT(∠45↑,30, ↑ ),COLORFFFFFF;
VERTLINE(∠45↑,2),COLOR00FFFF;
30,COLORFFFFFF;
M3:=MA(C,3);
M5:=MA(C,5);
N1:=BARSLAST(CROSS(M3,M5));
N2:=BARSLAST(CROSS(M5,M3));
N:=IF(N1 N2,N1+1,0-N2-1);
STICKLINE(N 0,0-75,0-75+N*2,8,0),COLOR0000FF;
STICKLINE(N 0,0-75,0-75+N*2,8,0),COLORFFFF00;
DRAWGBKlast(DATE 900101,strip(RGB(40,0,40),RGB(0,0,0),0));0,ColorFF9900;
JV:=(V-REF(V,1))/REF(V,1)*100;
JVH:=EMA(SUM(JV,k),k);
PARTLINE(JVH,(JVH REF(JVH,1))-1,rgb(0,255,0),1,rgb(255,0,0)),LINETHICK2,LAYER4;
DRAWTEXT(BARSTATUS=2,0, 换手: ),ALIGN0,COLOR00ffFF,LINETHICK2,LAYER0;
X:=BARSLAST(DISPSTATUS=1)+1;
ahx:=hhvall(hhv(JVH,X));
VERTLINE(JVH=ahx,4),COLOR00FFFF,LAYER0;
STICKLINE(JV 0,JV,0,5,0),Color000055,LAYER7;
STICKLINE(JV 0,JV,0,4,0),Color000077,LAYER7;
STICKLINE(JV 0,JV,0,3,0),Color000099,LAYER7;
STICKLINE(JV 0,JV,0,2,0),Color0000CC,LAYER7;
STICKLINE(JV 0,JV,0,1,0),Color0000FF,LAYER7;
STICKLINE(JV 0,JV,0,5,0),Color005500,LAYER7;
STICKLINE(JV 0,JV,0,4,0),Color007700,LAYER7;
STICKLINE(JV 0,JV,0,3,0),Color009900,LAYER7;
STICKLINE(JV 0,JV,0,2,0),Color00CC00,LAYER7;
HS:=/capital*100;
DRAWTEXT(JVandHS 2,-10, +NUMTOSTRN(HS,0)+ ),ALIGN1,color00FFff,linethick1,LAYER5;
IF(BARSTATUS=2andc 200andHS)THEN
DRAWTEXTABS(450,5, ■可视 +NUMTOSTRN(X,0)+ 天累计换手 +NUMTOSTRN(SUM(HS,X),1)+ %,平均换手 +NUMTOSTRN(SUM(HS,X)/X,1)+ %: ),COLOR00ffFF,LINETHICK3;
DRAWRECTABS(3,0,315,150,rgb(0,0,80)),color00FFFF,LINETHICK2,LAYER0;
W1:=IF((V-REF(V,1)) 0ANDABS(C-REF(C,1))/REF(C,1)*100 0.1,1,0);
IF(BARSTATUS=2andc 200andW1)THEN
DRAWTEXTABS(0,5, ◢ +W1+ ◣ ),color0000FF,LINETHICK2,LAYER0;
DRAWTEXTABS(0,5, 【加仓】:--1.量增价平,转阳信号。 ),color0000FF,LINETHICK2,LAYER0;
W2:=IF((V-REF(V,1)) 0and(C-REF(C,1)) 0,2,0);
IF(BARSTATUS=2andc 200andW2)THEN
DRAWTEXTABS(0,22, ◢ +W2+ ◣ ),color0055FF,LINETHICK2,LAYER0;
DRAWTEXTABS(0,22, 【买入】:--2.量增价升,买入信号。 ),color0055FF,LINETHICK2,LAYER0;
W3:=IF(ABS(V-REF(V,1))/REF(V,1)*100 0.1and(C-REF(C,1)) 0,3,0);
IF(BARSTATUS=2andc 200andW3)THEN
DRAWTEXTABS(0,39, ◢ +W3+ ◣ ),color0077FF,LINETHICK2;
DRAWTEXTABS(0,39, 【加仓】:--3.量平价升,持续买入。 ),color0077FF,LINETHICK2,LAYER0;
W4:=IF((V-REF(V,1)) 0and(C-REF(C,1)) 0,4,0);
IF(BARSTATUS=2andc 200andW4)THEN
DRAWTEXTABS(0,56, ◢ +W4+ ◣ ),color0099FF,LINETHICK2;
DRAWTEXTABS(0,56, 【持有】:--4.量减价升,继续持有。 ),color0099FF,LINETHICK2,LAYER0;
W5:=IF((V-REF(V,1)) 0ANDABS(C-REF(C,1))/REF(C,1)*100 0.1,5,0);
IF(BARSTATUS=2andc 200andW5)THEN
DRAWTEXTABS(0,76, ◢ +W5+ ◣ ),color00FF00,LINETHICK2,LAYER0;
DRAWTEXTABS(0,76, 【警戒】:--5.量减价平,警戒信号。 ),color00FF00,LINETHICK2,LAYER0;
W6:=IF((V-REF(V,1)) 0and(C-REF(C,1)) 0,6,0);
IF(BARSTATUS=2andc 200andW6)THEN
DRAWTEXTABS(0,93, ◢ +W6+ ◣ ),colorFFDD00,LINETHICK2,LAYER0;
DRAWTEXTABS(0,93, 【卖出】:--6.量减价跌,卖出信号。 ),colorFFDD00,LINETHICK2,LAYER0;
W7:=IF(ABS(V-REF(V,1))/REF(V,1)*100 0.1and(C-REF(C,1)) 0,7,0);
IF(BARSTATUS=2andc 200andW7)THEN
DRAWTEXTABS(0,110, ◢ +W7+ ◣ ),colorFFCC00,LINETHICK2,LAYER0;
DRAWTEXTABS(0,110, 【卖出】:--7.量平价跌,继续卖出。 ),colorFFCC00,LINETHICK2,LAYER0;
W8:=IF((V-REF(V,1)) 0and(C-REF(C,1)) 0,8,0);
IF(BARSTATUS=2andc 200andW8)THEN
DRAWTEXTABS(0,127, ◢ +W8+ ◣ ),colorFF9900,LINETHICK2,LAYER0;
DRAWTEXTABS(0,127, 【观望】:--8.量增价跌,弃卖观望。 ),colorFF9900,LINETHICK2,LAYER0;
X_1:=ABS(((3.48*CLOSE+HIGH+LOW)/4-EMA(CLOSE,23))/EMA(CLOSE,23));
X_2:=DMA((2.15*CLOSE+LOW+HIGH)/4,X_1);
X_3:=EMA(X_2,200)*1.118;
X_4:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100 8;
XG:CROSS(CLOSE,X_3)ANDX_4;
公式解读:
[源码注释]通达信公式动态公式解读上升下,每次回踩或上升趋势线的下跌都是买点;
下降趋势下,每次反抽均线或下降趋势线的冲高都是卖点;
震荡趋势下:每次碰箱体上沿是卖点,每次踩箱体下沿是买点。
编写条件:
5日均线刚过30日均线且10日均线上扬的公式。
编写方法:
XG:crOSS(ma(C,5),MA(C,30))ANDMA(C,10) REF(MA(C,10),1);