副图公式源码 :支持手机/电脑
DIFF:EMA(CLOSE,5) - EMA(CLOSE,34),COLORFF00FF;
DEA:EMA(DIFF,5),COLORLIBLUE;
MACD:=2*(DIFF-DEA);
ZERO:0,COLORLIBLUE;
GUP:=MAX(C,O);
STICKLINE(MACD>0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLOR0000FF;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,2,0),COLORFFFF00;
STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLORFF00FF;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,2,0),COLOR00FF00;
L4:=LLV(GUP,4);
JL:=(HHV(DIFF,55)-LLV(DIFF,55))/5;
GT:=DEA>REF(DEA,1) AND REF(DEA,1)<REF(DEA,2);
GUP1:=BARSLAST(REF(GT,1));
底背离:=REF(L4,GUP1+1)>CLOSE AND DIFF>REF(DIFF,GUP1+1) AND GT;
DRAWTEXT(底背离,REF(DEA,GUP1)*1.18,' 底背'),COLORFF00FF;
H4:=HHV(GUP,4);
GT2:=DEA<REF(DEA,1) AND REF(DEA,1)>REF(DEA,2);
GUP2:=BARSLAST(REF(GT2,1));
顶背离:= REF(H4,GUP2+1)<H4 AND DIFF<REF(DIFF,GUP2+1) AND GT2;
DRAWTEXT(顶背离,REF(DEA,GUP2)*1.18,' 顶背'),COLORGREEN;
GUP0:=DIFF<0 AND DEA<0;
GUP11:=GUP0>REF(GUP0,1);
GUP3:=BARSLAST(GUP11);
GUP4:=COUNT(DEA>0 AND DIFF >0,GUP3)=0;
GUP5:=CROSS(DIFF ,DEA);
GUP6:=BARSLAST(GUP5);
GUP7:=REF(GUP6,GUP6+1)+GUP6;
GUP8:=(DIFF+DEA)/2;
GUP9:=(HIGH+LOW)/2;
GUP10:=GUP5 AND GUP7<GUP3 AND GUP4 AND GUP8>REF(GUP8,GUP7) AND GUP9<REF(GUP9,GUP7) AND MACD>0;
DRAWTEXT(GUP10,DIFF*0.95,'↑金叉'),COLORYELLOW;
DRAWICON(CROSS(DIFF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIFF),DIFF,2);
选股公式源码
{选股公式一:金叉}
DIFF:=EMA(CLOSE,5) - EMA(CLOSE,34),COLORFF00FF;
DEA:=EMA(DIFF,5),COLORLIBLUE;
MACD:=2*(DIFF-DEA);
GUP0:=DIFF<0 AND DEA<0;
GUP11:=GUP0>REF(GUP0,1);
GUP3:=BARSLAST(GUP11);
GUP4:=COUNT(DEA>0 AND DIFF >0,GUP3)=0;
GUP5:=CROSS(DIFF ,DEA);
GUP6:=BARSLAST(GUP5);
GUP7:=REF(GUP6,GUP6+1)+GUP6;
GUP8:=(DIFF+DEA)/2;
GUP9:=(HIGH+LOW)/2;
GUP10:=GUP5 AND GUP7<GUP3 AND GUP4 AND GUP8>REF(GUP8,GUP7) AND GUP9<REF(GUP9,GUP7) AND MACD>0;
金叉:GUP10;
{选股公式二:底背}
DIFF:=EMA(CLOSE,5) - EMA(CLOSE,34),COLORFF00FF;
DEA:=EMA(DIFF,5),COLORLIBLUE;
GUP:=MAX(C,O);
L4:=LLV(GUP,4);
JL:=(HHV(DIFF,55)-LLV(DIFF,55))/5;
GT:=DEA>REF(DEA,1) AND REF(DEA,1)<REF(DEA,2);
GUP1:=BARSLAST(REF(GT,1));
底背离:=REF(L4,GUP1+1)>CLOSE AND DIFF>REF(DIFF,GUP1+1) AND GT;
底背:底背离;
{选股公式三:红箭头}
DIFF:=EMA(CLOSE,5) - EMA(CLOSE,34),COLORFF00FF;
DEA:=EMA(DIFF,5),COLORLIBLUE;
红箭头:CROSS(DIFF,DEA);
|