做OVB-MACD指标的预警公式 要求在长均上穿0轴时发出预警
做OVB-MACD指标的预警公式 要求在长均上穿0轴时发出预警
指标源码:
OBV0:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),0);
OBV:=OBV0/100000;
MA30:=MA(OBV,21);
OBV1:=OBV-MA30;
长均:EMA(OBV1,100),COLORWHITE;
中均:EMA(OBV1,20)COLORYELLOW;
短均:EMA(OBV1,5),COLORRED;
STICKLINE(中均>长均 AND REF(中均,1)<REF(短均,1) AND 短均<=中均,中均,0,2,0)COLORGREEN,NODRAW;
STICKLINE(REF(中均,1)>REF(短均,1) AND 短均>=中均 AND OBV1>REF(OBV1,1),中均,0,2,0),COLORRED;
TY:=OBV1;
AA1:=REF(TY,10)=HHV(TY,2*10+1); B1:=FILTER(AA1,10); HD:=FILTER(B1,10);
AA2:=REF(TY,10)=LLV(TY,2*10+1); B2:=FILTER(AA2,10); LD:=FILTER(B2,10);
AB:=REF(OBV1,BARSLAST(HD));
T1:=BARSLAST(HD)<BARSLAST(LD) AND NOT(HD) ;
T2:=BARSLAST(HD)>BARSLAST(LD) AND NOT(LD);
峰:=IF(T1,AB,AB),COLORYELLOW,LINETHICK1;
DIFF:=EMA(CLOSE,5)-EMA(CLOSE,13);
DEA:=EMA(DIFF,9),COLORFFFF00;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
MACD底背离:IF(底背离,HHV(OBV1,50)*0.5,0),LINETHICK2,COLORRED;
DRAWTEXT(底背离,HHV(OBV1,50)*0.4,'←底背离'),COLORRED;
OVC1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(C,OVC1+1)<C AND REF(DIFF,OVC1+1)>DIFF AND CROSS(DEA,DIFF),COLORFF00FF,LINETHICK2;
MACD顶背离:IF(顶背离,HHV(OBV1,50)*0.4,0),LINETHICK2,COLORGREEN;
DRAWTEXT(顶背离>0,HHV(OBV1,50)*0.4,'←顶背离'),COLORGREEN;
OOBV:0,LINETHICK2,COLORBLUE;
公式网www.gpxiazai.com解答:
OBV0:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),0);
OBV:=OBV0/100000;
MA30:=MA(OBV,21);
OBV1:=OBV-MA30;
长均:=EMA(OBV1,100),COLORWHITE;
选股:CROSS(长均,0);
- 上一篇公式:股价贯穿观望线(绿线) 【贯穿:开盘价小于观望线 收盘价价大于观望线】
- 下一篇公式:绝顶的选股公式