{看平滑异同平均线MACD值:SHORT=12;LONG=26;MID=9; 也可8,13,5; 也可10,20,7};
SHORT:=8;
LONG:=13;
MID:=5;
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIF,MID);
MACD:=(DIF-DEA)*2;
MACDLINE:=IF(CROSS(DIF,DEA),1+1,IF(CROSS(DEA,DIF),1-0.5,1+0));
A1:=DIF
DRAWICON(DIF DEA,1,1); {当MACD为红柱,画红箭头};
DRAWICON(DIF DEA,1,2); {当MACD为绿柱,画绿箭头};
{看随机指标KDJ值:N=9,M1=3,M2=3; 也有人用8,3,3};
N:=9;
M1:=3;
M2:=3;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,M1,1);
D:=SMA(K,M2,1);
J:=3*K-2*D;
KDJLINE:=IF(CROSS(K,D) AND CROSS(J,K),1,IF(CROSS(D,K) AND CROSS(K,J),0-0.5,0));
A2:=K
DRAWICON(K D,2,1); {当KDJ向好,画红箭头};
DRAWICON(K D,2,2); {当KDJ向坏,画绿箭头};
{看相对强弱指标RSI值:N1=6; N2=12; N3=24; 也有人用5,13,};
N1:=6; N2:=12; N3:=24;
LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100;
RSI3:=SMA(MAX(CLOSE-LC,0),N3,1)/SMA(ABS(CLOSE-LC),N3,1)*100;
A3:=RSI1 RSI2;
DRAWICON(RSI1 RSI2,3,1); {当RSI向好,画红箭头};
DRAWICON(RSI1 RSI2,3,2); {当RSI向坏,画绿箭头};
{看威廉指标LWR:WN:=9; WM1:=3; WM2:=3; 也有人用WN:=13; WM1:=3; WM2:=3; 威廉指标采用反向,所以加 负号 };
WN:=9; WM1:=3; WM2:=3;
WRSV:=-(HHV(HIGH,WN)-CLOSE)/(HHV(HIGH,WN)-LLV(LOW,WN))*100; {威廉指标采用反向,所以加 负号 };
LWR1:=SMA(WRSV,WM1,1);
LWR2:=SMA(LWR1,WM2,1);
A4:=LWR1 LWR2;
DRAWICON(LWR1 LWR2,4,1); {当LWR向好,画红箭头};
DRAWICON(LWR1 LWR2,4,2); {当LWR向坏,画绿箭头};
{看多空均线BBI:BM1:=3; BM2:=6; BM3:=12; BM4:=24; };
BM1:=3; BM2:=6; BM3:=12; BM4:=24;
BBI:=(MA(CLOSE,BM1)+MA(CLOSE,BM2)+MA(CLOSE,BM3)+MA(CLOSE,BM4))/4;
A5:=CLOSE {九毛八公式指标网www.9m8.cn}
DRAWICON(CLOSE BBI,5,1); {当BBI向好,画红箭头};
DRAWICON(CLOSE BBI,5,2); {当BBI向坏,画绿箭头};
{看动量线MTM: 不采用原来的公式,采用改造的MTM};
{MN:=12; MM:=6;
MTM:CLOSE-REF(CLOSE,MN);
MTMMA:MA(MTM,M)};
MTM:=CLOSE-REF(CLOSE,1);
MMS:=100*EMA(EMA(MTM,5),3)/EMA(EMA(ABS(MTM),5),3);
MMM:=100*EMA(EMA(MTM,13),8)/EMA(EMA(ABS(MTM),13),8);
A6:=MMS
DRAWICON(MMS MMM,6,1); {当MTM向好,画红箭头};
DRAWICON(MMS MMM,6,2); {当MTM向坏,画绿箭头};
MACD红:=IF(A1,1,0),COLORRED;
KDJ红 :=IF(A2,2,1),COLORMAGENTA;
RSI红 :=IF(A3,3,2),COLORLIRED;
LWR红 :=IF(A4,4,3),COLORYELLOW;
BBI红 :=IF(A5,5,4),COLORCYAN;
MTM红 :=IF(A6,6,5),COLORFF4700;
红数:A1+A2+A3+A4+A5+A6, COLORYELLOW,NODRAW;
买入:(红数=6 AND REF(红数,1) 6)*3, COLORYELLOW;
卖出:红数 4 AND REF(红数,1) =4, COLORCYAN;
{DRAWTEXT(买入, 6.3, '买'),COLORYELLOW;
DRAWTEXT(卖出, 6.3, '卖'),COLORCYAN;};