P:=5;
VA:=IF(CLOSE REF(CLOSE,1),VOL,-VOL);
OBV:SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);
MAOBV5:MA(OBV,5);
MAOBV20:MA(OBV,20);
AA1:=REF(OBV,P)=HHV(OBV,2*P+1);
BB1:=FILTER(AA1,P);
CC1:=(BB1,P+1);
DD1:=FILTER(CC1,P); AA2:=REF(OBV,P)=LLV(OBV,2*P+1);
BB2:=FILTER(AA2,P);
CC2:=(BB2,P+1);
DD2:=FILTER(CC2,P); 前期高点:REF(OBV,BARSLAST(DD1)),COLORFF00FF,NODRAW;
前期低点:REF(OBV,BARSLAST(DD2)),COLOR00FF00,NODRAW;
相对能量:(OBV-前期低点)/(前期高点-前期低点)*100,COLORYELLOW,NODRAW;
R11:=(ISLASTBAR,BARSLAST(DD1)+1);
S11:=R11 REF(R11,1);{www.9m8.cn 九毛八公式指标网}
DRAWLINE(DD1,OBV,S11,OBV,1),COLORYELLOW;
T11:=(ISLASTBAR,BARSLAST(DD2)+1);
U11:=T11 REF(T11,1);
DRAWLINE(DD2,OBV,U11,OBV,1),COLOR00FF00;
STICKLINE(C 0,前期低点,前期低点,1,0),COLOR00FF00;
STICKLINE(C 0,前期高点,前期高点,1,0),COLORFF00FF;
DRAWICON(CROSS(OBV,前期高点),OBV,1);