通达信史上最牛趋势线获利盘主图指标公式源码[通达信公式]
这个指标的思路理念是基于多种技术指标来判断股票的趋势、支撑、阻力、超买超卖等情况,并给出相应的操作建议。具体来说,这个代码包含以下几个部分:
上、中、下三条指数移动平均线(EMA),用来显示股票的短期、中期和长期趋势2。
超买和超卖两条点状线(POINTDOT),用来显示股票的过度波动区间2。
获利盘百分比(WINNER),用来计算持有该股票的投资者有多少比例是盈利的2。
趋势线(EMA),用来显示股票的整体走势2。
支撑和阻力两条点状线(POINTDOT),用来显示股票的上下界限2。
5日和13日两条简单移动平均线(MA),用来显示股票的近期变化3。
MA1和MA2两个变量,用来计算5日简单移动平均线的斜率和角度1。
N:=5;
M:=13;
上:EMA(CLOSE,3),COLORRED,LINETHICK1;
中:EMA(CLOSE,5),COLOR00FF00,LINETHICK1;
下:EMA(中,5),COLORWHITE,LINETHICK1;
超买:MA(CLOSE,10)*IF(CAPITAL=0,1.04,1.1),POINTDOT,COLORGREEN,LINETHICK2;
超卖:MA(CLOSE,10)*IF(CAPITAL=0,0.95,0.9),POINTDOT,COLORRED,LINETHICK2;
获利盘%:WINNER(C)*100,NODRAW,COLORWHITE;
{此句为计算获利盘比例,不需要可以不要}
趋势线:EMA(((SLOPE(C,21) * 20) + C),42),POINTDOT,COLORFF00FF,LINETHICK4;
V1:=ABS((2*C+H+L)/4-MA(C,20))/MA(C,20);
V2:=(1-7/100)*(DMA(C,V1));
V3:=(1+7/100)*(DMA(C,V1));
V5:=MA((L+H+C)/3,5);
支撑:=REFDATE(V2,DATE),POINTDOT,LINETHICK3,COLORCC66FF;
阻力:=REFDATE(V3,DATE),POINTDOT,LINETHICK3,COLORGREEN;
MA1:=MEMA(C,5);
MA2:=ATAN((MA1/REF(MA1,1)-1)*100)*180/3.1416;
MA3:=IF(MA2>0,MA2,MA2);
MA5:=MA(C,N),COLOR888899;
MA13:=MA(C,M),COLORFF00F0,LINETHICK2;
cxh1:=C=HHV(CLOSE,4) AND (REF(CLOSE,1)>=REF(CLOSE,2) OR REF(CLOSE,1)>=REF(CLOSE,3))
OR REF(CLOSE,1)=HHV(CLOSE,4) AND C>=REF(CLOSE,2) OR REF(CLOSE,2)=HHV(CLOSE,4) AND
REF(CLOSE,3)=LLV(CLOSE,4) AND C>=REF(CLOSE,1) OR REF(CLOSE,3)=HHV(CLOSE,4) AND
C>=REF(CLOSE,1) AND C>=REF(CLOSE,2);
cxh2:=C=HHV(CLOSE,4) AND REF(CLOSE,1)=LLV(CLOSE,4);
cxh3:=C=LLV(CLOSE,4) AND (REF(CLOSE,1)<REF(CLOSE,2) OR REF(CLOSE,1)<REF(CLOSE,3)) OR
REF(CLOSE,1)=LLV(CLOSE,4) AND C<REF(CLOSE,2) OR REF(CLOSE,2)=LLV(CLOSE,4) AND
REF(CLOSE,1)=HHV(CLOSE,4) AND C<REF(CLOSE,1) OR REF(CLOSE,3)=LLV(CLOSE,4) AND
C<REF(CLOSE,1) AND C<REF(CLOSE,2);
cxh4:=REF(CLOSE,1)=LLV(CLOSE,4) AND C>=REF(CLOSE,2) OR REF(CLOSE,2)=LLV(CLOSE,4) AND
REF(CLOSE,1)<=REF(CLOSE,3) AND REF(CLOSE,2)<REF(CLOSE,4) AND C>=REF(CLOSE,1);
cxh5:=REF(CLOSE,1)=HHV(CLOSE,4) AND C<REF(CLOSE,2) OR (REF(CLOSE,2)=HHV(CLOSE,4) AND
REF(CLOSE,1)>REF(CLOSE,3) OR REF(CLOSE,3)=HHV(CLOSE,4) AND REF(CLOSE,1)>REF(CLOSE,2)) AND
REF(CLOSE,2)>=REF(CLOSE,4) AND C<REF(CLOSE,1);
cxh6:=V5>REF(V5,1) AND REF(V5,1)<REF(V5,2);
cxh7:=L<HHV(V5,13) AND H>HHV(V5,13) AND C>REF(CLOSE,1) AND C>O;
cxh8:=cxh7 AND COUNT(cxh6,2);
cxh9:=100*EMA(EMA(CLOSE-REF(CLOSE,1),6),6)/EMA(EMA(ABS(CLOSE-REF(CLOSE,1)),6),6);
cxh10:=EMA(MA(CLOSE,13),13);
cxh11:=FILTER((LLV(cxh9,2)=LLV(cxh9,7) AND COUNT(cxh9<0,2) AND
CROSS(cxh9,MA(cxh9,2)))=1,5);
cxh12:=FILTER((HHV(cxh9,2)=HHV(cxh9,7) AND COUNT(cxh9>50,2) AND
CROSS(MA(cxh9,2),cxh9))=1,1);
cxh13:=SMA(EMA((CLOSE-REF(CLOSE,1))/REF(CLOSE,1),5)*100,3,1)*10;
cxh14:=FILTER(((CROSS(cxh13,0) OR CROSS(CLOSE,cxh10)) AND cxh11)=1,3);
cxh15:=MA(CLOSE,18)>=REF(MA(CLOSE,18),3) AND CROSS(CLOSE,MA(CLOSE,18));
cxh16:=cxh8 AND NOT(REF(cxh8,1));
强攻:=IF(MA3>REF(MA3,1) AND MA3>=0,MA13,DRAWNULL),COLORYELLOW,LINETHICK2;
回调:=IF(MA3<REF(MA3,1) AND MA3>0,MA13,DRAWNULL),COLORGREEN,LINETHICK2;
{KDJ}
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
金叉:=CROSS(J,D);
死叉:=CROSS(D,J);
买1:=(cxh14 OR cxh15) AND cxh11;
买2:=(cxh14 OR cxh15) AND cxh4;
买3:=(cxh14 OR cxh15) AND cxh2;
买4:=(cxh2 AND cxh11) OR (cxh4 AND cxh11);
买5:=(金叉 AND cxh4) OR (金叉 AND cxh2) OR (金叉 AND cxh11);
{涨停}
STICKLINE(C>REF(C,1)*1.0985 AND C=H,C,O,4,-1),
COLOR00FFFF;
{跌停}
STICKLINE(C<REF(C,1)*0.9015 AND C=L,C,O,4,-1),
COLORGREEN;
{蓝}
STICKLINE(O>=C,C,O,3.3,0),COLORFF7700;
STICKLINE(O>=C,C,O,2.4,0),COLORFF9900;
STICKLINE(O>=C,C,O,1.3,0),COLORFFBB00;
STICKLINE(O>=C,C,O,0.8,0),COLORCYAN;
{红}
STICKLINE(C>O,C,O,3.3,0),COLOR000099;
STICKLINE(C>O,C,O,2.4,0),COLOR0000CC;
STICKLINE(C>O,C,O,1.3,0),COLOR0000FF;
STICKLINE(C>O,C,O,0.8,0),COLORCC66FF;
{绿}
STICKLINE(cxh3,O,(O+C)/2,3.3,0),COLOR009900;
STICKLINE(cxh3,O,(O+C)/2,2.4,0),COLOR00BB00;
STICKLINE(cxh3,O,(O+C)/2,1.3,0),COLOR00DD00;
STICKLINE(cxh3,O,(O+C)/2,0.8,0),COLOR00FF00;
{灰}
STICKLINE(cxh4,O,(O+C)/2,3.3,0),COLOR999999;
STICKLINE(cxh4,O,(O+C)/2,2.2,0),COLORBBBBBB;
STICKLINE(cxh4,O,(O+C)/2,1.3,0),COLORDDDDDD;
STICKLINE(cxh4,O,(O+C)/2,0.8,0),COLORFFFFFF;
STICKLINE(金叉,O,C,1,0),COLORYELLOW;
STICKLINE(死叉,O,C,1,0),COLOR000099;
DRAWICON(cxh16,L-0.02,7);
DRAWICON(买1 OR 买2 OR 买3 OR 买4 OR 买5,L-0.01,1);
DRAWICON(死叉 OR cxh12 OR CROSS(40,cxh9),H+0.01,2);
X1:=(CLOSE+LOW+H)/3;
BB13:=ATAN(EMA(X1,13)-REF(EMA(X1,13),1))*3.1416*10;
EMA8:=EMA(CLOSE,8);
DRAWTEXT(FILTER(BB13>1 AND EMA(X1,13)>REF(EMA(X1,8),1),10),
EMA8,'∠45升'),COLORWHITE;
cxh81:=1;
cxh82:=((((2*C)+H)+L) / 4);
低金叉进:=20,COLORYELLOW,LINETHICK2;
高死叉出:=90,COLORGREEN,LINETHICK3;
cxh84:=LLV(L,5);
cxh85:=HHV(H,4);
C1:=(EMA((((cxh82-cxh84)/(cxh85-cxh84))*100),4)*cxh81),COLORFF00FF,LINETHICK2;
C2:=(EMA(((0.667*REF(C1,1))+(0.333*C1)),2)*cxh81),COLORFFFFFF,LINETHICK2;
条件:=CROSS(C1,C2) AND C1<40;
条件0:=CROSS(C2,C1) AND C1>90;
TJ1:=CROSS(C1,C2);
TJ2:=CROSS(C2,C1);
TJ3:=CROSS(C1,C2) AND REF(C1,1)<20;
TJ4:=CROSS(C2,C1) AND REF(C1,1)>80;
DRAWTEXT(条件0,H*1.02,'S'),COLORBLUE;
{DRAWTEXT(CROSS(C1,75),H*1.013,'险区'),COLORGREEN;}
DRAWTEXT(TJ3,L*0.98,'买底'),COLORFF00FF;
DRAWTEXT(TJ4,H*1.02,'逃顶'),COLORGREEN;
E1:=BARSCOUNT(C);
AH:=HHV(HIGH,200);
AL:=LLV(LOW,200);
B0:=(AH-AL)/40;
KB1:=H+B0;
KB2:=L-B0;
STICKLINE((E1+0)/34=FLOOR((E1+0)/34),KB2,KB2-0.8*B0,1,0),COLORYELLOW,LINETHICK3;
DRAWTEXT((E1+0)/34=FLOOR((E1+0)/34),KB2-B0,'时窗'),COLORYELLOW;
水平面:=EMA(C,89),COLOR3399FF;
AAA:=(3*C+HIGH+LOW+O)/6;
短趋:=(8*AAA+7*REF(AAA,1)+6*REF(AAA,2)+5*REF(AAA,3)+4*REF(AAA,4)+3*REF(AAA,5)+2*REF(AAA,6)+REF(AAA,8))/36;
中趋:=(LLV(短趋,2)+LLV(短趋,4)+LLV(短趋,6))/3;
{STICKLINE(C>中趋,短趋,中趋,0,0),COLORYELLOW;}
TTJ1:=V=HHV(V,10) AND V>2*REF(V,1) AND C>短趋;
立桩量:=FILTER(TTJ1,5);
TTJ2:=IF(BARSLAST(立桩量)=1 AND C>REF(H,1),1,IF(BARSLAST(立桩量)=2 AND C>REF(H,2),1,IF(BARSLAST(立桩量)=3 AND C>REF(H,3),1,0)));
突破:=TTJ2=1;
TTJ3:=IF(BARSLAST(立桩量)=1 AND C>REF(L,1),1,IF(BARSLAST(立桩量)=2 AND C>REF(L,2),1,IF(BARSLAST(立桩量)=3 AND C>REF(L,3),1,0)));
三天法则:=TTJ3=1;
成立:=三天法则 AND 突破;
条件成立:=FILTER(成立,3);
DRAWICON(条件成立,L*0.91,1);
DRAWTEXT(条件成立,L*0.91,'立桩'),COLORFF26FF;
MA(CLOSE,9),LINETHICK0,COLORYELLOW;
MA(CLOSE,21),LINETHICK0,COLORRED;
IF(MA(CLOSE,9)<REF(MA(CLOSE,9),1),MA(CLOSE,9),DRAWNULL),LINETHICK0,COLORBLUE;
IF(MA(CLOSE,21)<REF(MA(CLOSE,21),1),MA(CLOSE,21),DRAWNULL),LINETHICK0,COLORGREEN;
cxh90:=((((HHV((((EMA(DC,12)-EMA(DC,26))-(EMA((EMA(DC,12)-EMA(DC,26)),9)))*2),4)<0) AND ((((EMA(DC,12)-EMA(DC,26))-(EMA((EMA(DC,12)-EMA(DC,26)),9)))*2)>REF((((EMA(DC,12)-EMA(DC,26))-(EMA((EMA(DC,12)-EMA(DC,26)),9)))*2),1))) AND (REF((((EMA(DC,12)-EMA(DC,26))-(EMA((EMA(DC,12)-EMA(DC,26)),9)))*2),1)<REF((((EMA(DC,12)-EMA(DC,26))-(EMA((EMA(DC,12)-EMA(DC,26)),9)))*2),2))) AND (REF((((EMA(DC,12)-EMA(DC,26))-(EMA((EMA(DC,12)-EMA(DC,26)),9)))*2),2)<REF((((EMA(DC,12)-EMA(DC,26))-(EMA((EMA(DC,12)-EMA(DC,26)),9)))*2),3)));
DRAWTEXT(cxh90,L*0.98,'短买'),COLORRED;
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容