通达信持股规则主图指标公式

[复制链接]
查看101 | 回复0 | 2021-8-20 20:01:35 | 显示全部楼层 |阅读模式
本文指标含有选股公式如下:

持股规则主图之B选股指标公式

MTM:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
卖:=IF(HHV(DX,2)=HHV(DX,7) AND COUNT(DX > 50,2) AND CROSS(MA(DX,2),DX),1,0);
买入:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4,COLOR0000FF;
DRAWICON(FILTER(卖=1,1),HIGH*1.02,8);
DRAWICON(CROSS(SMA(C,3,1),买入),L*0.96,7);
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;
{牛熊变线}变线:=EMA(MA(CLOSE,30),5),LINETHICK0;{20 或 30 或 35}STICKLINE(C>=变线
AND C>=O,H,L,0,0),COLORRED;STICKLINE(C>=变线
AND C>=O,C,O,2.7,1),COLORRED;STICKLINE(C>变线
AND C<=O,H,L,0,1),COLORCYAN;STICKLINE(C>变线
AND C<=O,C,O,3,0),COLORCYAN;STICKLINE(C<变线
AND C<=O,H,L,0,1),COLORCYAN;STICKLINE(C<变线
AND C<=O,C,O,3,0),COLORCYAN;STICKLINE(C<变线
AND C<=O,H,L,0,1),COLORGRAY;STICKLINE(C<变线
AND C>O,H,L,0,1),COLORGRAY;STICKLINE(C<变线
AND C>O,C,O,3,1),COLORGRAY;STICKLINE(C<变线
AND C<=O,C,O,3,1),COLORGRAY;
{分水岭操作线}PM:MA(C,5),COLORBLUE,LINETHICK2;
{可用13}IF(PM<REF(PM,1),PM,DRAWNULL),COLORBLUE,LINETHICK0;
IF(PM>=REF(PM,1),PM,DRAWNULL),COLORYELLOW,LINETHICK2;
IF(PM=REF(PM,1),PM,DRAWNULL),COLORYELLOW,LINETHICK2;
A:=MA(CLOSE,12)+ABS(MA(CLOSE,12)-REF(MA(CLOSE,12),1));
{原指标为17,最终确定为12}B:=MA(CLOSE,12)+MA(CLOSE,12)-REF(MA(CLOSE,12),1);
分水岭:=IF(MA(CLOSE,12)<B,B,MA(CLOSE,12));
操作线:=分水岭-(EMA(C,3)-分水岭);
AA:=CROSS(分水岭,操作线); STICKLINE(AA,C,O,3,0),COLOR0000AA;
STICKLINE(AA,C,O,2,0),COLOR0033CC;STICKLINE(AA,C,O,1,0),COLOR0055EE;
STICKLINE(AA,C,O,0.3,0),COLOR0099FF;STICKLINE(AA,H,L,0,1),COLOR0099FF;
RR:=CROSS((MA(VOL,5)),(MA(VOL,10))) AND MA(C,2)>=MA(C,4);
{AND VOL>=REF(VOL,1)}STICKLINE(RR,C,O,3,0),COLOR0000AA;
STICKLINE(RR,C,O,2,0),COLOR0033CC;STICKLINE(RR,C,O,1,0),COLOR0055EE;
STICKLINE(RR,C,O,0.3,0),COLOR0099EE;STICKLINE(RR,H,L,0,1),COLOR0099FF;
C2:=REF(C,1);
涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);
STICKLINE(涨停,OPEN,CLOSE,2,0),COLORYELLOW;{黄色涨停}
STICKLINE(涨停,H,L,0,0),COLORRED;
跌停:=IF((C2-C)*100/C2>=(10-0.01*100/C2),1,0);
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;{跌停}
STICKLINE(跌停,H,L,0,1),COLORGREEN;

202108201210.jpg

202108201210.jpg

 

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则