以下是通达信心态主图指标
通达信心态主图指标
源码
{思路:将常用的KDJ与MACD相互配合,分为四个状态:简述如下:
做多区域为红色K线,代表KDJ金叉,MACD金叉====双金叉看多区域。
做空区域为绿色K线,代表KDJ死叉,MACD死叉====双死叉看空区域。}
{强洗区域为黄色K线,代表KDJ死叉,MACD金叉====短空中多洗盘区域。
初升区域为蓝色K线,代表KDJ金叉,MACD死叉====短多中空反弹区域。
四种颜色,四种状态,一目了然,成竹在胸。}
{配合均线粘合突破提示信号。红色箭头向上突破,绿色箭头向下突破。
再配合CCI指标,把握波段高低极限提示。
笑脸代表低位。哭脸代表高位。
如此配合,K线功能更加完备,实战心态极佳。多空随意,进退自如!
指标仅供参考,决策在自己。}
DD:=(H+L+2*C)/4;
M3:EMA(DD,3);
M8:=EMA(DD,8);
M21:=EMA(DD,21);
M55:=EMA(DD,55),LINETHICK2,COLOR00FF00;
TT:=BARSCOUNT(C);
PT:=IF(TT<55,TT,55);
上:M55+2.1*STD(C,PT),COLOR00FF00;
下:M55-2.1*STD(C,PT),COLOR0000FF;
月涨幅:=(C-LLV(C,20))/LLV(C,20)*100;
月跌幅:=(HHV(H,20)-C)/HHV(H,20)*100;
DRAWTEXT(CROSS(上,M3),上,'抛'),COLORYELLOW;
DRAWTEXT(CROSS(M3,下),下,'抄'),COLORYELLOW;
HH:=MAX(MAX(MAX(M3,M8),M21),M55);
LL:=MIN(MIN(MIN(M3,M8),M21),M55);
SXZH:=HH/LL<=1.03 AND M3>REF(M3,1)
AND M8>REF(M8,1) AND M21>REF(M21,1) AND M55>REF(M55,1);
SXZL:=HH/LL<=1.03 AND M3
AND M8
向上:SXZH AND LHH AND 月涨幅>月跌幅,NODRAW;
向下:SXZL AND H>LL AND C<月跌幅,NODRAW;
DRAWICON(向上,MIN(L,LL)*0.97,1);
DRAWICON(向下,MAX(H,HH)*1.03,2);
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
DIFF:= EMA(CLOSE,12) - EMA(CLOSE,26);
DEA :=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
做多:=IF(K>D AND MACD>0 AND V>1,2,0),COLORRED;
做空:=IF(K<0 AND V>1,-2,0),COLOR00FF00;
强洗:=IF(MACD>0 AND K1,1,0),COLOR0099FF;
弱升:=IF(MACD<0 AND K>D AND V>1,-1,0),COLORFFFF00;
CCI:="CCI.CCI";
DRAWICON(CCI>185 AND H>上,H*1.02,6);
DRAWICON(CCI<-185,L*0.98,5);
STICKLINE(做多,L,H,0.5,0),COLORRED;
STICKLINE(做多 AND C>=O,C,O,3,1),COLORRED;
STICKLINE(做多 AND C
STICKLINE(做空,L,H,0.5,0),COLOR00FF00;
STICKLINE(做空 AND C>=O,C,O,3,1),COLOR00FF00;
STICKLINE(做空 AND C
STICKLINE(强洗,L,H,0.5,0),COLOR0099FF;
STICKLINE(强洗 AND C>=O,C,O,3,1),COLOR0099FF;
STICKLINE(强洗 AND C
STICKLINE(弱升,L,H,0.5,0),COLORFFFF00;
STICKLINE(弱升 AND C>=O,C,O,3,1),COLORFFFF00;
STICKLINE(弱升 AND C
ZDF:=(C-REF(C,1))/REF(C,1)*100;
STICKLINE(ZDF>9.8,O,C,2,0),COLORRED;
STICKLINE(ZDF<-9.8,O,C,2,0),COLORBLUE;
IF(M3>M8,M3,DRAWNULL),COLORFFFF00;
IF(M8>M21,M8,DRAWNULL),COLORFFFF00;
IF(M21>M55,M21,DRAWNULL),COLORFFFF00;
IF(M55>REF(M55,1),M55,DRAWNULL),COLORRED,LINETHICK2;
Y01:=REF(C,1)/LLV(L,21)>1.38;
Y03:=ABS(C-O)/C<0.008;
Y04:=(H-L)/C>0.025;
S0:=Y01 AND Y03 AND Y04;
DRAWTEXT(S0,H*1.03,'星'),COLOR00FF00;
X01:=REF(C,1)/HHV(H,21)<0.77;
X03:=ABS(C-O)/C<0.008;
X04:=(H-L)/C>0.025;
XG0:=X01 AND X03 AND X04;
DRAWTEXT(XG0,L*0.97,'星'),COLOR00FFFF;