【通达信源码分享】精品指标公式-策马奔腾+黑马红牛

通达信免费指标 02-03 阅读:705 评论:0

幅图指标使用趋势线和生命线交叉确定买入和卖出的操作,并用红色和蓝色台阶辅助确定操作时间。

 指标使用简介:


1,买入:当出现第一根红柱时可少量买入,当趋势线上穿生命线时加仓买入,只要趋势线大于生命线并一路红柱,就一直持有;

2,卖出:当出现第一根蓝柱时可半仓卖出,当趋势线下穿生命线时清仓观望。只要趋势线小于生命线并一路蓝柱,就一直观望。

3,特别强调,指标绿色向下箭头(卖出信号)迟后,当红柱走平时就可以减仓或清仓。指标有不妥的地方,烦请大家改进和优化。


公式源码:


B1:=EMA((2*CLOSE+HIGH+LOW)/4,5);


A1:IF(EMA((2*CLOSE+HIGH+LOW)/4,6)>REF(EMA((2*CLOSE+HIGH+LOW)/4,6),1),B1,DRAWNULL),COLOR0000FF;


A2:IF(EMA((2*CLOSE+HIGH+LOW)/4,6)<REF(EMA((2*CLOSE+HIGH+LOW)/4,6),1),B1,DRAWNULL),COLOR00FF00;


B2:=EMA((2*CLOSE+HIGH+LOW)/4,13);


A3:IF(EMA((2*CLOSE+HIGH+LOW)/4,10)>REF(EMA((2*CLOSE+HIGH+LOW)/4,13),1),B2,DRAWNULL),COLOR0000FF;


A4:IF(EMA((2*CLOSE+HIGH+LOW)/4,10)<REF(EMA((2*CLOSE+HIGH+LOW)/4,13),1),B2,DRAWNULL),LINETHICK2,COLOR00FF00;


B3:=REF(EMA((LOW+CLOSE+OPEN)/3,25),1);


A5:IF(EMA((LOW+CLOSE+OPEN)/3,28)>REF(EMA((LOW+CLOSE+OPEN)/3,28),1),B3,DRAWNULL),LINETHICK3,COLOR0000FF;


A6:IF(EMA((LOW+CLOSE+OPEN)/3,28)<REF(EMA((LOW+CLOSE+OPEN)/3,28),1),B3,DRAWNULL),LINETHICK3,COLOR00FF00;


B4:=(EMA(LOW,125)+EMA((CLOSE+LOW)/2,125))/2;


A7:IF((EMA(LOW,125)+EMA((CLOSE+LOW)/2,250))/2>REF((EMA(LOW,125)+EMA((CLOSE+LOW)/2,250))/2,1),B4,DRAWNULL),POINTDOT,COLOR0000FF;


A8:IF((EMA(LOW,125)+EMA((CLOSE+LOW)/2,250))/2<REF((EMA(LOW,125)+EMA((CLOSE+LOW)/2,250))/2,1),B4,DRAWNULL),POINTDOT,COLOR00FF00;


短高H:=(20*H+19*REF(H,1)+18*REF(H,2)+17*REF(H,3)+16*REF(H,4)+15*REF(H,5)+14*REF(H,6)


+13*REF(H,7)+12*REF(H,8)+11*REF(H,9)+10*REF(H,10)+9*REF(H,11)+8*REF(H,12)


+7*REF(H,13)+6*REF(H,14)+5*REF(H,15)+4*REF(H,16)+3*REF(H,17)+2*REF(H,18)+


REF(H,20))/210,COLORBLUE,LINETHICK1;


短低L:=(20*L+19*REF(L,1)+18*REF(L,2)+17*REF(L,3)+16*REF(L,4)+15*REF(L,5)+14*REF(L,6)


+13*REF(L,7)+12*REF(L,8)+11*REF(L,9)+10*REF(L,10)+9*REF(L,11)+8*REF(L,12)


+7*REF(L,13)+6*REF(L,14)+5*REF(L,15)+4*REF(L,16)+3*REF(L,17)+2*REF(L,18)+


REF(L,20))/210,COLORBLUE,LINETHICK1;


D90H:=EMA(短高H,90)-(EMA(短高H,90)-EMA(短低L,90))*0.2,COLORRED,LINETHICK1;


D90L:=EMA(短低L,90)+(EMA(短高H,90)-EMA(短低L,90))*0.2,COLORRED,LINETHICK1;


高0:=(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1+XMA(XMA(H,25),25),LINETHICK1,COLORWHITE;


低0:=XMA(XMA(L,25),25)-(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1,LINETHICK1,COLORWHITE;


中中中:=((XMA(XMA(H,15),15)+XMA(XMA(H,20),20)+XMA(XMA(H,30),30)+XMA(XMA(H,40),40))/4+(XMA(XMA(L,15),15)+XMA(XMA(L,20),20)+XMA(XMA(L,30),30)+XMA(XMA(L,40),40))/4)/2,LINETHICK0,COLORGREEN;


EMA中中中:=EMA(中中中,10),LINETHICK0,COLORWHITE;


A:=(3*C+L+O+H)/6;


B:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)


+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)


+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+


REF(A,20))/210,COLORRED,LINETHICK1;


D:=MA(B,10),COLORRED,LINETHICK2;


D14:=MA(B,14),COLORRED,LINETHICK2;


D21:=MA(B,21),COLORRED,LINETHICK2;


A9:=MA((3*C+L+O+H)/6,28);


B9:=(20*A9+19*REF(A1,1)+18*REF(A9,2)+17*REF(A9,3)+16*REF(A9,4)+15*REF(A9,5)+14*REF(A9,6)


+13*REF(A9,7)+12*REF(A9,8)+11*REF(A9,9)+10*REF(A9,10)+9*REF(A9,11)+8*REF(A9,12)


+7*REF(A9,13)+6*REF(A9,14)+5*REF(A9,15)+4*REF(A9,16)+3*REF(A9,17)+2*REF(A9,18)+


REF(A9,12))/210,COLORGREEN,LINETHICK1;


D1:=MA(B9,14),COLORGREEN,LINETHICK2;


中中顶:=(XMA(XMA(H,15),15)+XMA(XMA(H,20),20)+XMA(XMA(H,30),30)+XMA(XMA(H,40),40))/4*2-(XMA(XMA(L,15),15)+XMA(XMA(L,20),20)+XMA(XMA(L,30),30)+XMA(XMA(L,40),40))/4,LINETHICK2,COLORGREEN;


中中底:=(XMA(XMA(L,15),15)+XMA(XMA(L,20),20)+XMA(XMA(L,30),30)+XMA(XMA(L,40),40))/4*2-(XMA(XMA(H,15),15)+XMA(XMA(H,20),20)+XMA(XMA(H,30),30)+XMA(XMA(H,40),40))/4,LINETHICK2,COLORGREEN;


短中顶:=(XMA(XMA(H,5),5)+XMA(XMA(H,8),8)+XMA(XMA(H,11),11)+XMA(XMA(H,14),14)+XMA(XMA(H,4),4))/5+((XMA(XMA(H,5),5)+XMA(XMA(H,8),8)+XMA(XMA(H,11),11)+XMA(XMA(H,14),14)+XMA(XMA(H,4),4))/5-(XMA(XMA(L,5),5)+XMA(XMA(L,8),8)+XMA(XMA(L,11),11)+XMA(XMA(L,14),14)+XMA(XMA(L,4),4))/5)/2,LINETHICK0,COLORWHITE;


短中底:=(XMA(XMA(L,5),5)+XMA(XMA(L,8),8)+XMA(XMA(L,11),11)+XMA(XMA(L,14),14))/4-((XMA(XMA(H,5),5)+XMA(XMA(H,8),8)+XMA(XMA(H,11),11)+XMA(XMA(H,14),14)+XMA(XMA(H,4),4))/5-(XMA(XMA(L,5),5)+XMA(XMA(L,8),8)+XMA(XMA(L,11),11)+XMA(XMA(L,14),14)+XMA(XMA(L,4),4))/5)/2,LINETHICK0,COLORWHITE;


中顶:=(XMA(XMA(H,30),30)+XMA(XMA(H,40),40)+XMA(XMA(H,50),50)+XMA(XMA(H,60),60))/4*2.03-(XMA(XMA(L,30),30)+XMA(XMA(L,40),40)+XMA(XMA(L,50),50)+XMA(XMA(L,60),60))/4,LINETHICK2,COLORRED;


中底:=(XMA(XMA(L,30),30)+XMA(XMA(L,40),40)+XMA(XMA(L,50),50)+XMA(XMA(L,60),60))/4*1.97-(XMA(XMA(H,30),30)+XMA(XMA(H,40),40)+XMA(XMA(H,50),50)+XMA(XMA(H,60),60))/4,LINETHICK2,COLORRED;


长顶:=(XMA(XMA(H,90),90)+XMA(XMA(H,120),120)+XMA(XMA(H,150),150))/3*2.08-(XMA(XMA(L,90),90)+XMA(XMA(L,120),120)+XMA(XMA(L,150),150))/3,LINETHICK2,COLORYELLOW;


长底:=(XMA(XMA(L,90),90)+XMA(XMA(L,120),120)+XMA(XMA(L,150),150))/3*1.92-(XMA(XMA(H,90),90)+XMA(XMA(H,120),120)+XMA(XMA(H,150),150))/3,LINETHICK2,COLORYELLOW;


AF长:=EMA((CLOSE+HIGH+LOW)/3,18);


BF长:=REF(AF长,1);


AF中:=EMA((CLOSE+HIGH+LOW)/3,10);


BF中:=REF(AF中,1);


AF5:=EMA((CLOSE+HIGH+LOW)/3,6);


BF5:=REF(AF5,1);


AF3:=EMA((CLOSE+HIGH+LOW)/3,3);


BF3:=REF(AF3,1);


买入定位:=AF长>BF长 OR AF中>BF中 OR AF5>BF5 OR AF3>BF3;


卖出定位:=AF长<BF长 OR AF中<BF中 OR AF5<BF5;


顶底定位:=AF长<BF长 OR AF中<BF中 OR AF5<BF5 OR AF3<BF3;


STICKLINE(买入定位=1,LOW,HIGH,0.0,1),COLORRED;


STICKLINE(买入定位=1,CLOSE,OPEN,3,1),COLORRED;


STICKLINE(AF中<BF中,LOW,HIGH,0.0,0),COLORGREEN;


STICKLINE(AF中<BF中,CLOSE,OPEN,3,1),COLORGREEN;


STICKLINE(卖出定位=1 AND 中中顶>中顶,LOW,HIGH,0.0,1),COLORGREEN;


STICKLINE(卖出定位=1 AND 中中顶>中顶,CLOSE,OPEN,3,1),COLORGREEN;


STICKLINE(顶底定位=1 AND H>中中顶 AND H>中顶,CLOSE,OPEN,3,1),COLORGREEN;


STICKLINE(顶底定位=1 AND H>中中顶 AND H>中顶,LOW,HIGH,0.0,1),COLORGREEN;


加仓定位1:=卖出定位=1 AND 中中顶>中顶;


加仓定位2:=顶底定位=1 AND H>中中顶 AND H>中顶;


DRAWTEXT(中中中<EMA中中中 AND CROSS(AF中,BF中) AND 短中底<中中底 AND 短中底<中底,L*0.97,'↖大牛'),COLORFF00FF;


DRAWTEXT(中中中>=EMA中中中 AND CROSS(AF中,BF中) AND 短中底<中中底,L*0.97,'↖黑马'),COLORFF00FF;


DRAWTEXT(CROSS(BF3,AF3) AND H>中中顶 AND H>中顶,H*1.03,'↙【逃】'),COLORGREEN;


DRAWTEXT(加仓定位1=0 AND 加仓定位2=0 AND CROSS(AF中,BF中) AND 中中中>=EMA中中中,L*0.995,'↖追'),COLORYELLOW;


DRAWTEXT(CROSS(AF长,BF长) AND 中底<长底,L*0.97,'↖【赌】'),COLORRED;


DRAWTEXT(CROSS(AF长,BF长) AND 中底<长底 AND 中底>长底,L*0.97,'↖中底'),COLORYELLOW;


STICKLINE(AF中>BF中 AND 短中底<中底 AND 短中底<中底,CLOSE,OPEN,2,0),COLORRED;


DRAWTEXT(AF3>BF3 AND 短中底<中中底 AND H<中中底,L*0.985,'↖骗'),COLORWHITE;


STICKLINE(AF3>BF3 AND 短中底<中中底 AND H<中中底,CLOSE,OPEN,2,0),COLORRED;


STICKLINE(中中中>=EMA中中中 AND CROSS(AF中,BF中) AND AF中<中中中 AND AF中<(中顶+中底)/2 AND H<短中顶,CLOSE,OPEN,3,0),COLORRED;


DRAWTEXT(中中中>=EMA中中中 AND CROSS(AF中,BF中) AND AF中<中中中 AND AF中<(中顶+中底)/2 AND H<短中顶,L*0.97,'↖【买】'),COLORRED;


DRAWTEXT(CROSS(BF中,AF中) AND 中中中<EMA中中中,H*1.01,'↙卖'),COLORGREEN;


DRAWICON(AF中<中中中 AND AF中<(中顶+中底)/2 AND H<短中顶 AND CROSS(AF中,BF中) AND 中中中<EMA中中中,L*0.99,1);

30-1G02Q30938-50.png

版权声明

本文版权归掌上指标所有。
未经许可,不得转载,转载请注明出处!

服务热线

18020657357

微信客服

微信客服