大智慧多方乖离指标公式

input: N(13),M(55);

REFLINE: 0, 20, 50, 80;

TR:=EMA(MAX(MAX(HIGH-LOW,Abs(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);

HD:=HIGH-REF(HIGH,1);

LD:=REF(LOW,1)-LOW;

DMP:=EMA(IF(HD>0 AND HD>LD,HD,0),N);

DMM:=EMA(IF(LD>0 AND LD>HD,LD,0),N);

多方:DMP*100/TR,COLORRED;

空方:DMM*100/TR,COLORGREEN;

趋势:EMA(ABS(空方-多方)/(空方+多方)*100,M);

多方乖离:(多方-趋势)/趋势*100,LINETHICK0;

空方乖离:(空方-趋势)/趋势*100,LINETHICK0;

当心:if(FILTER(多方乖离>50 or 空方<5,5),65,80);

关注:if(FILTER(多方乖离<-75 or 空方乖离>75,5),15,0);