期货指标公式源码下载:
boll主图:
MID:MA(CLOSE,144);
TMP2:=STD(CLOSE,144);
TOP:MID+2*TMP2;
BOTTOM:MID-2*TMP2;
DIFF : =EMA(CLOSE,40) - EMA(CLOSE,100);
DEA :=EMA(DIFF,10);
MACD:= 2*(DIFF-DEA),COLORSTICK;
JC1:=CROSS(C,TOP) AND COUNT(CROSS(C,TOP),BARSLAST(CROSS(L,MID))+1);
SC1:=CROSSDOWN(C,TOP) AND BACKSET(CROSSDOWN(L,MID),BARSLAST(CROSSDOWN(C,TOP))+1);
JC2:=CROSS(C,BOTTOM) AND BACKSET(CROSS(C,TOP),BARSLAST(CROSS(C,BOTTOM))+1);
SC2:=CROSSDOWN(C,BOTTOM) AND COUNT(CROSSDOWN(C,BOTTOM),BARSLAST(CROSSDOWN(C,MID))+1);
JC0:=CROSS(DIFF,DEA);
SC0:=CROSSDOWN(DIFF,DEA);
HH:=CROSS(BACKSET(SC1,HHVBARS(IF(MACD REF(MACD,1) AND EVERY(MACD 0,2) AND C TOP,H,0),BARSLAST(JC1)+1)+1),0.5);
LL:=CROSS(BACKSET(JC2,LLVBARS(IF(MACD REF(MACD,1) AND EVERY(MACD 0,2) AND C BOTTOM,L,9999999),BARSLAST(SC2)+1)+1),0.5);
DRAWTEXT(HH,H, ↓ ),COLORGREEN,FONTSIZE50;
DRAWTEXT(LL,L, ↑ ),COLORRED,FONTSIZE50,VALIGN0;
DRAWHORIZONTALLINE(HH,H,COLORGREEN);
DRAWHORIZONTALLINE(LL,L,COLORRED);
macd副图:
MID:=MA(CLOSE,144);
TMP2:=STD(CLOSE,144);
TOP:=MID+2*TMP2;
BOTTOM:=MID-2*TMP2;
DIFF : EMA(CLOSE,40) - EMA(CLOSE,100);
DEA :EMA(DIFF,10);
MACD:2*(DIFF-DEA),COLORSTICK;
JC1:=CROSS(C,TOP) AND COUNT(CROSS(C,TOP),BARSLAST(CROSS(L,MID))+1);
SC1:=CROSSDOWN(C,TOP) AND BACKSET(CROSSDOWN(L,MID),BARSLAST(CROSSDOWN(C,TOP))+1);
JC2:=CROSS(C,BOTTOM) AND BACKSET(CROSS(C,TOP),BARSLAST(CROSS(C,BOTTOM))+1);
SC2:=CROSSDOWN(C,BOTTOM) AND COUNT(CROSSDOWN(C,BOTTOM),BARSLAST(CROSSDOWN(C,MID))+1);
JC0:=CROSS(DIFF,DEA);
SC0:=CROSSDOWN(DIFF,DEA);
HH:=CROSS(BACKSET(SC1,HHVBARS(IF(MACD REF(MACD,1) AND EVERY(MACD 0,2) AND C TOP,H,0),BARSLAST(JC1)+1)+1),0.5);
LL:=CROSS(BACKSET(JC2,LLVBARS(IF(MACD REF(MACD,1) AND EVERY(MACD 0,2) AND C BOTTOM,L,9999999),BARSLAST(SC2)+1)+1),0.5);
DRAWTEXT(HH,MACD, ↓ ),COLORGREEN,FONTSIZE50;
DRAWTEXT(LL,MACD, ↑ ),COLORRED,FONTSIZE50,VALIGN0;
DRAWHORIZONTALLINE(HH,MACD,COLORGREEN);
DRAWHORIZONTALLINE(LL,MACD,COLORRED);