DIFF1: EMA(C,12) - EMA(C,26),COLOR0000FF,LINETHICK2;
DEA1: EMA(DIFF1,9),COLORC08000,LINETHICK2;
MDIFF : EMA(CLOSE,12) - EMA(CLOSE,26),COLOR0000BD,LINETHICK2;
MACD :2*(DIFF1-DEA1), COLORSTICK;
A11:=REF(DIFF1,N)=HHV(DIFF1,2*N+1);
B21:=FILTER(A11,N);
C11:=BACKSET(B21,N+1);
D11:=FILTER(C11,N);
T线:REF(DIFF1,BARSLAST(D11)),COLORFF00FF,NODRAW;
STICKLINE(C<0,T线,T线,6,0),COLOR00FFFF;
STICKLINE(C>0,T线,T线,6,0),COLOR00FFFF0;
A12:=REF(DIFF1,N)=LLV(DIFF1,2*N+1);
B22:=FILTER(A12,N);
C12:=BACKSET(B22,N+1);
D12:=FILTER(C12,N);
T1线:REF(DIFF1,BARSLAST(D12)),COLORFF00FF,NODRAW;
STICKLINE(C<0,T1线,T1线,6,0),COLORMAGENTA;
STICKLINE(C>0,T1线,T1线,6,0),COLORMAGENTA;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,5,0),COLORD500D5;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORAA5500;
DIFF1上穿T线及DIFF1下穿T1线发出预警
预警一般是用后台程序化预警,触发条件时候会自动出弹窗。如果不用后台只能在图表的K线图上输出一些信号之类的。或者做个标记的这种。
以后台预警为例子:
只需要加2句代码
cd1:cross(diff1,T1线);//上穿
cd2:cross(T1线,diff1);//下穿
后台程序化里面把cd1或者cd2设成预警条件即可。
或者直接新建2个后台预警,一个以cd1作为预警条件 一个以cd2作为预警条件。
关于后台程序化:
http://www.weistock.com/WeisoftHelp/kaishihoutaichengshihuajiaoyi.htm