{参数:LONG(26,1,100),SHORT(12,1,100),M(9,1,100);}
DIF:EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA:EMA(DIF,M),COLORBLUE,LINETHICK3;
MACD:2*(DIF-DEA),COLORSTICK;
A4:=BARSLAST(ref(cross(dif,dea),1));
B1:=ref(c,A4+1)>c and ref(dif,A4+1)
DRAWTEXT(FILTER(B1>0,5),dif+0.2,'背离'),COLORyellow;
VAR1C:=(HIGH - MIN(OPEN,CLOSE));
VAR2C:=(CLOSE - OPEN);
VAR3C:=(MIN(OPEN,CLOSE) - LOW);
VAR4C:=(HIGH - LOW);
VAR5C:=((VOL * VAR1C) / VAR4C);
VAR6C:=((VOL * VAR2C) / VAR4C);
VAR7C:=((VOL * VAR3C) / VAR4C);
VAR8C:=((VAR5C - VAR6C) - VAR7C);
VAR4:=MA(CLOSE,5);
VAR5:=MA(CLOSE,10);
VAR6:=MA(CLOSE,30);
VAR7:=MA(CLOSE,60);
VAR8:=EMA(COST(85),7);
VAR9:=EMA(COST(15),7);
VARA:=(SUM(((CLOSE * VOL) * 10),4) / SUM((VOL * 200),4));
VARB:=(INTPART((VARA * 10)) / 10);
VARC:=(SUM(((CLOSE * VOL) * 10),7) / SUM((VOL * 200),7));
VARD:=(INTPART((VARC * 10)) / 10);
VARE:=(SUM(((CLOSE * VOL) * 10),28) / SUM((VOL * 200),28));
VARF:=(INTPART((VARE * 10)) / 10);
短线趋势:(EMA(CLOSE,5) - EMA(CLOSE,10)),COLORMAGENTA,LINETHICK2;
中线趋势:EMA(短线趋势,9),COLORMAGENTA,LINETHICK3;
VAR10:=((0 - ((10 * (HHV(CLOSE,5) - CLOSE)) / (HHV(CLOSE,5) - LLV(LOW,5)))) + 10);
VAR11:=((0 - ((10 * (HHV(CLOSE,10) - CLOSE)) / (HHV(CLOSE,10) - LLV(LOW,10)))) + 10);
VAR12:=((0 - ((10 * (HHV(CLOSE,20) - CLOSE)) / (HHV(CLOSE,20) - LLV(LOW,20)))) + 10);
VAR13:=((0 - ((10 * (HHV(CLOSE,30) - CLOSE)) / (HHV(CLOSE,30) - LLV(LOW,30)))) + 10);
VAR14:=REF(中线趋势,1);
VAR15:=中线趋势;
VAR16:=(VAR15 - VAR14);
VAR17:=REF(短线趋势,1);
VAR18:=短线趋势;
VAR19:=(VAR18 - VAR17);
VAR1A:=OPEN;
VAR1B:=CLOSE;
短线指标:IF(((((CROSS(短线趋势,中线趋势) AND (短线趋势 < 0)) AND (中线趋势 < (0 - 0.2))) AND (VAR11 > 45)) AND (VAR16 > 0)),0.3,0.1),COLOR66FF00;