//多空信号主图指标
//主图红色区域,配合副图买多,主图青色区域,配合副图买空
图片
图片
T1:=IF(DATE1<20990701,1,1);
ZZ:=450;
SHORT:=12;
LONG:=26;
M:=9;
DIFF := EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA := EMA(DIFF,M);
MACD := 2*(DIFF-DEA), COLORSTICK;
MA5:=MA(C,5);
MA10:=MA(C,10);
MA30:=MA(C,30);
MA60:=MA(C,60);
D1:=CROSS(C>MA60 AND MACD>0 AND MA10>MA60 AND C>MA10,0.5);
D2:=BARSLAST(D1);
K1:=CROSS(C<MA30 AND MACD<0,0.5);
K2:=BARSLAST(K1);
K3:=CROSS(C<MA60 AND MACD<0 AND MA10<MA60 AND C<MA10,0.5);
K4:=BARSLAST(K3);
D3:=CROSS(C>MA30 AND MACD>0,0.5);
D4:=BARSLAST(D3);
DRAWTEXT(CROSS(D2<K4,0.5) AND T1,L,'多'),COLORYELLOW,ALIGN0;
DRAWTEXT(CROSS(C<MA5 AND (C-MA60)>=ZZ,0.5) AND COUNT(CROSS(C<MA5 AND ABS(C-MA60)>=ZZ,0.5),BARSLAST(CROSS(D2<K4,0.5)))=1 AND T1,H*1.005,'盈利分批离场'),COLORYELLOW,ALIGN0;
DRAWTEXT(CROSS(K4<D2,0.5) AND T1,H,'空'),COLORYELLOW,ALIGN0;
DRAWTEXT(CROSS(C>MA5 AND (MA60-C)>=ZZ,0.5) AND COUNT(CROSS(C>MA5 AND ABS(C-MA60)>=ZZ,0.5),BARSLAST(CROSS(D2>K4,0.5)))=1 AND T1,L*0.995,'盈利分批离场'),COLORYELLOW,ALIGN0;
STICKLINE1(D2<K4 AND T1,C,O,3,0),COLORRED;
STICKLINE1(D2<K4 AND T1,H,L,0,0),COLORRED;
STICKLINE1(D2>K4 AND T1,C,O,3,0),COLORCYAN;
STICKLINE1(D2>K4 AND T1,H,L,0,0),COLORCYAN;
Z1:=BACKSET(ISLASTBAR,40);
//趋势指标副图
图片
图片
EMA1攻击线:MA(C,5),COLORBLACK,LINETHICK1;
EMA2回档线:MA(C,15),COLORBLUE,LINETHICK1;
EMA3生命线:MA(C,30),COLORMAGENTA,LINETHICK2;
DD:EMA1攻击线>EMA2回档线&&EMA2回档线>EMA3生命线,NODRAW;
KK:EMA1攻击线<EMA2回档线&&EMA2回档线<EMA3生命线,NODRAW;
DRAWLINE(EMA1攻击线>EMA2回档线,EMA1攻击线,1,EMA2回档线,COLORRED),LINETHICK2;
DRAWLINE(EMA1攻击线<EMA2回档线,EMA1攻击线,1,EMA2回档线,COLORLIGHTGREEN),LINETHICK2;
高:=REF(HHV(H,80),3),COLORWHITE,LINETHICK1;
低:=REF(LLV(L,80),3),COLORWHITE,LINETHICK1;
TJ:=VOL>=REF(V,1)*1.91 AND C>REF(C,1)*1.01;
STICKLINE1(TJ,OPEN,CLOSE,1.5,0),COLORGRAY,LINETHICK2;
K1:=SUMBARS(TJ,1);
CROSSDOWN(C,REF(C,K1-1)),SOUND('A');
H19:=高-(高-低)*0.191,COLORWHITE;
H23:=高-(高-低)*0.236,COLORWHITE;
H38:=高-(高-低)*0.382,COLORCYAN;
H中:=高-(高-低)*0.5,COLORGREEN;
H61:=高-(高-低)*0.618,COLORYELLOW;
H76:=高-(高-低)*0.764,COLORYELLOW;
H80:=高-(高-低)*0.809,COLORWHITE;
GD:=HHV(H,240);
DD1:=LLV(L,240);
CZ:=GD-DD1;
G11:=ZIGZAG(C,1,1)>REF(ZIGZAG(C,1,1),1) AND REF(ZIGZAG(C,1,1),1)<=REF(ZIGZAG(C,1,1),2) /*AND REF(ZIGZAG(C,1,1),2)<=REF(ZIGZAG(C,1,1),3) AND REF(ZIGZAG(C,1,1),3)<=REF(ZIGZAG(C,1,1),4) AND REF(ZIGZAG(C,1,1),4)<=REF(ZIGZAG(C,1,1),5)*/;
X11:=ZIGZAG(C,1,1)<REF(ZIGZAG(C,1,1),1) AND REF(ZIGZAG(C,1,1),1)>=REF(ZIGZAG(C,1,1),2) /*AND REF(ZIGZAG(C,1,1),2)>=REF(ZIGZAG(C,1,1),3) AND REF(ZIGZAG(C,1,1),3)>=REF(ZIGZAG(C,1,1),4) AND REF(ZIGZAG(C,1,1),4)>=REF(ZIGZAG(C,1,1),5)*/;
DRAWCOLORKLINE(G11>0 AND G11>X11,COLORMAGENTA,0);
DRAWTEXT(G11>0 AND G11>X11,L,'买多'),COLORMAGENTA,FONTSIZE15,VALIGN2;
DRAWCOLORKLINE(X11>0 AND X11>G11,COLORGREEN,0);
DRAWTEXT(X11>0 AND X11>G11,H,'开空'),COLORBLACK,FONTSIZE15,VALIGN0;
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报。