P:=5;
VA:=IF(CLOSE>REF(CLOSE,1),vol,-VOL);
obv:SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);
AA1:=REF(OBV,P)=HHV(OBV,2*P+1);
BB1:=FILTER(AA1,P);
CC1:=BacKSET(BB1,P+1);
DD1:=FILTER(CC1,P);{高点}
AA2:=REF(OBV,P)=LLV(OBV,2*P+1);
BB2:=FILTER(AA2,P);
CC2:=BACKSET(BB2,P+1);
DD2:=FILTER(CC2,P);{低点}
{ _通达信指标公式}
前期高点:=REF(OBV,BArslAST(DD1)),COLORFF00FF,NODRAW;
前期低点:=REF(OBV,BARSLAST(DD2)),COLOR00FF00,NODRAW;
STICKLINE(C>0,前期低点,前期低点,1,0),COLOR00FF00;
STICKLINE(C>0,前期高点,前期高点,1,0),COLORFF00FF;
DRAWICON(crOSS(OBV,前期高点),OBV,1);