请老师帮忙给下列指标设一个预警公式(买入的,即继续底背离)和选股公式,不胜感谢
STICKLINE(C>O,C,O,8,0),colormagenta;
STICKLINE(C>O,H,L,0,0),colormagenta;
STICKLINE(C<=O,C,O,8,0),colorcyan;
STICKLINE(C<=O,H,L,0,0),colorcyan;
HA:=LLV(L,500);
HB:=HHV(H,500);
HC:=EMA(EMA(EMA(LLV(L,2),2),2),2),
HD:=EMA(EMA(EMA(HHV(H,2),2),2),2);
H1:=H>HC;O1:=O>HC;L1:=L>HC;C1:=C>HC;
H2:=H>HD;O2:=O>HD;L2:=L>HD;C2:=C>HD;
继续底背离:IF(H1+O1+L1+C1<=1,(L+HA)/2,HA),colorgreen;
继续顶背离:IF(H2+O2+L2+C2>=3,(HB+H)/2,HB),colormagenta;
解答如下:
HA:=LLV(L,500);
HB:=HHV(H,500);
HC:=EMA(EMA(EMA(LLV(L,2),2),2),2);
HD:=EMA(EMA(EMA(HHV(H,2),2),2),2);
H1:=H>HC;O1:=O>HC;L1:=L>HC;C1:=C>HC;
H2:=H>HD;O2:=O>HD;L2:=L>HD;C2:=C>HD;
继续底背离:IF(H1+O1+L1+C1<=1,(L+HA)/2,HA);