不多说,有经验的人一看就明白。 MACD实站
{SHORT:1,999,12}
{LONG:1,999,26}
{MID:1,999,9}
DIFF:EMA(C,SHORT)-EMA(C,LONG);
DEA:EMA(DIFF,MID);
MACD:(DIFF-DEA)*2,COLORFFFF00,COLORSTICK;
A1:=BARSLAST(REF(CROSS(0, DEA),1));
A2:= BARSLAST(REF(COUNT(DEA<=0,A1+1)=A1+1 AND LLV(DIFF,5)=LLV(DIFF,A1+1) AND CROSS(DIFF,DEA),1));
A3:= BARSLAST(REF(CROSS(DIFF,DEA),1));
DIBL1:=LLV(C,A3+1)=LLV(C,A1+1) AND NOT(LLV(DIFF,A3+1)=LLV(DIFF,A1+1)) AND COUNT(DEA<=0,A2+1)=A2+1 AND CROSS(DIFF,DEA);
金叉:IF(CROSS(DIFF,DEA) AND DEA<=0 AND DIBL1=0,0,DEA),COLORYELLOW;
底背离:IF(DIBL1,0,DEA),COLORRED;
B1:=BARSLAST(REF(CROSS(DEA,0),1));
B2:=BARSLAST(REF(COUNT(DEA>=0,B1+1)=B1+1 AND HHV(DIFF,5)=HHV(DIFF,A1+1) AND CROSS(DEA,DIFF),1));
B3:=BARSLAST(REF(CROSS(DEA,DIFF),1));
DINGBL1:= HHV(C,B3+1)=HHV(C,B1+1) AND NOT(HHV(DIFF,B3+1)=HHV(DIFF,B1+1)) AND COUNT(DEA>=0,B2+1)=B2+1 AND CROSS(DEA,DIFF);
死叉:IF(CROSS(DEA,DIFF) AND DEA>=0 AND DINGBL1=0,0,DEA),COLORFFFF00;
顶背离:IF(DINGBL1,0,DEA),COLORGREEN;
DIBJG:=LLV(C,A3+1)=LLV(C,A1+1) AND NOT(LLV(DIFF,A3+1)=LLV(DIFF,A1+1)) AND DIFF>REF(DIFF,1) AND COUNT(DEA<=0,A2+1)=A2+1 AND DIFF<DEA ;
DINGBJG:=HHV(C,B3+1)=HHV(C,B1+1) AND NOT(HHV(DIFF,B3+1)=HHV(DIFF,B1+1)) AND REF(DIFF,1)>DIFF AND COUNT(DEA>=0,B2+1)=B2+1 AND DIFF>DEA ;
STICKLINE(DIBJG =1 ,DEA,DIFF,2,0),COLORRED;
STICKLINE(DINGBJG =1 ,DEA,DIFF,2,0),COLORGREEN;
MB:=EMA(DIFF,20);
UB:=MB+1.9104*STD(DIFF,20);
LB:=MB-1.9104*STD(DIFF,20);
ZJS:=HHV(DEA,B1+1)/2;
ZJX:=LLV(DEA,A1+1)/2;
STICKLINE(DEA>DIFF AND DEA>0 AND DEA>ZJS, ZJS,REF(ZJS,1),1,0), COLORRED;
STICKLINE(DEA<DIFF AND DEA<0 AND DEA<ZJX,ZJX, REF(ZJX,1),1,0),COLORGREEN;
{MACD自定周期}
{SHORT:1,999,12}
{LONNG:1,999,26}
{MID:1,999,9}
{M:2,999,4}
DIFF:EMA(C,SHORT*M)-EMA(C,LONG*M);
DEA:EMA(DIFF,MID*M);
MACD:(DIFF-DEA)*2,COLORFFFF00,COLORSTICK;
A1:=BARSLAST(REF(CROSS(0, DEA),M));
A2:=BARSLAST(REF(DEA<0 AND CROSS(DIFF,DEA),M));
A3:=BARSLAST(REF(COUNT(DEA<0,A2+M)=A2+M AND CROSS(DIFF,DEA),M));
A4:=LLV(C,A3+M)<REF(LLV(C,A2+M),A3+M) AND LLV(DIFF,A3+M)>=REF(LLV(DIFF,A2+M),A3+M);
A5:=LLV(C,A2+M)<REF(LLV(C,A1+M),A2+M) AND LLV(DIFF,A2+M)>=REF(LLV(DIFF,A1+M),A2+M);
DIBL1:=(A4=1 OR A5=1) AND COUNT(DEA<0,A2+M)=A2+M AND DEA<0 AND CROSS(DIFF,DEA);
金叉:IF(CROSS(DIFF,DEA) AND DEA<=0 AND DIBL1=0,0,DEA),COLORYELLOW;
底背离:IF(DIBL1=1,0,DEA),COLORRED;
B1:=BARSLAST(REF(CROSS(DEA,0),M));
B2:=BARSLAST(REF(DEA>0 AND CROSS(DEA,DIFF),M));
B3:=BARSLAST(REF(COUNT(DEA>0,B2+M)=B2+M AND CROSS(DEA,DIFF),M));
B4:=HHV(C,B3+M)>REF(HHV(C,B2+M),B3+M) AND HHV(DIFF,B3+M)<=REF(HHV(DIFF,B2+M),B3+M);
B5:=HHV(C,B2+M)>REF(HHV(C,B1+M),B2+M) AND HHV(DIFF,B2+M)<=REF(HHV(DIFF,B1+M),B2+M);
DINGBL1:=(B4=1 OR B5=1) AND COUNT(DEA>=0,B2+M)=B2+M AND DEA>=0 AND CROSS(DEA,DIFF);
死叉:IF(CROSS(DEA,DIFF) AND DEA>=0 AND DINGBL1=0,0,DEA),COLORWHITE;
顶背离:IF(DINGBL1=1,0,DEA),COLORGREEN;
DIBJG:=(A4=1 OR A5=1) AND COUNT(DEA<0,A2+M)=A2+M AND DEA<0 AND DIFF>REF(DIFF,M) AND
DIFF>REF(DIFF,8) AND DIFF<DEA ;
DINGBJG:=(B4=1 OR B5=1) AND COUNT(DEA>=0,B2+M)=B2+M AND DEA>=0 AND REF(DIFF,M)>DIFF AND
REF(DIFF,8)>DIFF AND DIFF>DEA ;
STICKLINE(DIBJG =1 ,DEA,DIFF,2,0),COLORRED;
STICKLINE(DINGBJG =1 ,DEA,DIFF,2,0),COLORGREEN;
MB:=EMA(DIFF,20*M);
UB:=MB+1.9104*STD(DIFF,20*M);
LB:=MB-1.9104*STD(DIFF,20*M);
ZJS:=HHV(DEA,B1+M)/2;
ZJX:=LLV(DEA,A1+M)/2;
STICKLINE(DEA>DIFF AND DEA>0 AND DEA>ZJS,ZJS,REF(ZJS,M),1,0),COLORRED;
STICKLINE(DEA<DIFF AND DEA<0 AND DEA<ZJX,ZJX,REF(ZJX,M),1,0),COLORGREEN;
|
评论内容只代表网友观点,与本站立场无关!
本网提供的公式文件说明:
* alg格式飞狐股票公式,可以用飞狐交易师或者交易师软件导入;
* fnc格式大智慧新一代公式指标,可以用大智慧股票软件使用,少部分可以用分析家股票软件引入使用;
* exp格式大智慧经典版股票公式,仅可以用大智慧经典版股票软件引入使用;
* tni和tnc格式通达信股票公式,仅可以用通达信新引入使用,例如可以用通达信股票软件引入使用;
* tne,tn6格式通达信公式,可以用通达信公式编辑器5.0版导入,推荐通达信金融终端版本;
* hxf格式同花顺股票公式,仅可以用同花顺股票软件引入使用。
以上的各种软件都可以在本网股票软件栏目找到!
* 关于股票公式时间限制,如果在引入大智慧公式,交易师公式或者飞狐公式的时候,发现公式名称栏是空白的,这时候调整电脑时间到1997年,又能出现公式名称,并且能正常显示,可能是公式使用期限已过。
* 关于还原公式源码如果你忘记了自己编写的大智慧公式,通达信公式,同花顺公式,操盘手公式,飞狐公式,博易大师公式,金字塔公式,文华公式和交易师公式等等公式的密码,本网可帮恢复源码,有.偿.服.务无意勿扰,点击在线咨询联系我。
* 关于股票公式源码编辑
本网提供的源码,一般都可以编辑成公式,如果不明白公式的编辑,在本页右侧教程录像可参考,或者找公式教程资料学习,请搜索:教程
* 如果您发现软件内容或者链接错误,请点击报告错误谢谢!
* 站内提供的所有软件包含源码均是由网上搜集,若侵犯了你的版权利益,请联系通知我们!