股票选股公式编写教程 飞狐发一个自己用的MACD指标公式
2016-09-18 10:56 股票知识 zhishi.southmoney.com
DIFF : EMA(CLOSE,S) - EMA(CLOSE,P);
DEA : EMA(DIFF,M);
MACD : 2*(DIFF-DEA), COLORSTICK;
VAR6:=((CLOSE)/(REF(CLOSE,3))>=1.05);
VAR7:=BACKSET(VAR6,3);
STICKLINE(VAR7 AND (COUNT(VAR7,5)=1),0.09,0,4,0),CoLor0000FF,LINETHICK3;
DRAWTEXT(VAR7 AND (COUNT(VAR7,5)=1),0.02,'买入 '),CoLorFF00FF;
VAR10:=HHV(DEA,53);
VAR20:=LLV(DEA,55);
VAR30:=DEA-(DIFF-DEA);
UP:IF(DIFF>VAR10 AND DEA=VAR10,MAX(LLV(VAR10,10),VAR30),VAR10),COLORbb0000,LINETHICK1;
DN:IF(DIFF<VAR20 AND DEA=VAR20,MIN(HHV(VAR20,10),VAR30),VAR20),COLORRED,LINETHICK1;
UU:=HHV(MACD,55);
LL:=LLV(MACD,55);
STICKLINE(((MACD<REF(MACD,1)) AND (MACD>0)),0,MACD,1,0),COLOR00cfff,LINETHICK2;
STICKLINE(((MACD>REF(MACD,1)) AND (MACD<0)),0,MACD,1,0),COLORFF00FF,LINETHICK2;
PARTLINE(DIFF>REF(DIFF,1),DIFF),colorred;
PARTLINE(DIFF<REF(DIFF,1),DIFF),colorgreen;
PARTLINE(DIFF>REF(DIFF,1)AND REF(DIFF,1)>0,DIFF),colorred;
PARTLINE(DIFF<REF(DEA,1),DIFF),COLORGRAY;
VAR6:=((CLOSE)/(REF(CLOSE,3))>=1.05);
VAR7:=BACKSET(VAR6,3);
STICKLINE(VAR7 AND (COUNT(VAR7,5)=1),0.09,0,4,0),CoLor0000FF,LINETHICK3;
DRAWTEXT(VAR7 AND (COUNT(VAR7,5)=1),0.02,'买入 '),CoLorFF00FF;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
STICKLINE(底背离,0,0.01,6,0),COLOR00FF00;
底背:=DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;
DRAWTEXT(底背离,DIFF*0.98,'↑\n底背离'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(顶背离,DIFF*0.98,'↓顶背离'),COLORFF00FF;
顶背:=DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK2;
强:=EMA((CLOSE-REF(CLOSE,1))/CLOSE*10,2),LINETHICK0;
差A:=3*EMA(EMA(EMA(EMA(强,2),2),2),2),LINETHICK0;
净流:=3*EMA(EMA(EMA(EMA(差A,1),2),2),2), COLORRED,LINETHICK0;
DRAWTEXT(CROSS(0,净流),0+0,'空'),COLORGREEN;
DRAWTEXT(CROSS(REF(净流,1),净流),DIFF,'注意'),COLORFFFF00;
DRAWTEXT(CROSS(净流,0),0,'关注 资金介入'),COLOR00FFFF;
DEA : EMA(DIFF,M);
MACD : 2*(DIFF-DEA), COLORSTICK;
VAR6:=((CLOSE)/(REF(CLOSE,3))>=1.05);
VAR7:=BACKSET(VAR6,3);
STICKLINE(VAR7 AND (COUNT(VAR7,5)=1),0.09,0,4,0),CoLor0000FF,LINETHICK3;
DRAWTEXT(VAR7 AND (COUNT(VAR7,5)=1),0.02,'买入 '),CoLorFF00FF;
VAR10:=HHV(DEA,53);
VAR20:=LLV(DEA,55);
VAR30:=DEA-(DIFF-DEA);
UP:IF(DIFF>VAR10 AND DEA=VAR10,MAX(LLV(VAR10,10),VAR30),VAR10),COLORbb0000,LINETHICK1;
DN:IF(DIFF<VAR20 AND DEA=VAR20,MIN(HHV(VAR20,10),VAR30),VAR20),COLORRED,LINETHICK1;
UU:=HHV(MACD,55);
LL:=LLV(MACD,55);
STICKLINE(((MACD<REF(MACD,1)) AND (MACD>0)),0,MACD,1,0),COLOR00cfff,LINETHICK2;
STICKLINE(((MACD>REF(MACD,1)) AND (MACD<0)),0,MACD,1,0),COLORFF00FF,LINETHICK2;
PARTLINE(DIFF>REF(DIFF,1),DIFF),colorred;
PARTLINE(DIFF<REF(DIFF,1),DIFF),colorgreen;
PARTLINE(DIFF>REF(DIFF,1)AND REF(DIFF,1)>0,DIFF),colorred;
PARTLINE(DIFF<REF(DEA,1),DIFF),COLORGRAY;
VAR6:=((CLOSE)/(REF(CLOSE,3))>=1.05);
VAR7:=BACKSET(VAR6,3);
STICKLINE(VAR7 AND (COUNT(VAR7,5)=1),0.09,0,4,0),CoLor0000FF,LINETHICK3;
DRAWTEXT(VAR7 AND (COUNT(VAR7,5)=1),0.02,'买入 '),CoLorFF00FF;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
STICKLINE(底背离,0,0.01,6,0),COLOR00FF00;
底背:=DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;
DRAWTEXT(底背离,DIFF*0.98,'↑\n底背离'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(顶背离,DIFF*0.98,'↓顶背离'),COLORFF00FF;
顶背:=DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK2;
强:=EMA((CLOSE-REF(CLOSE,1))/CLOSE*10,2),LINETHICK0;
差A:=3*EMA(EMA(EMA(EMA(强,2),2),2),2),LINETHICK0;
净流:=3*EMA(EMA(EMA(EMA(差A,1),2),2),2), COLORRED,LINETHICK0;
DRAWTEXT(CROSS(0,净流),0+0,'空'),COLORGREEN;
DRAWTEXT(CROSS(REF(净流,1),净流),DIFF,'注意'),COLORFFFF00;
DRAWTEXT(CROSS(净流,0),0,'关注 资金介入'),COLOR00FFFF;
更多股票公式相关资讯请关注南方财富网
股票知识网声明:资讯来源于合作媒体及机构,属作者个人观点,仅供投资者参考,并不构成投资建议。投资者据此操作,风险自担。