通达信自用多年自用多年指标公式源码

2016-03-01 21:07:00来源:本站整理浏览:902

 (0,MACD2),1)))),IF(REF(CROSS(MACD2,0),1),HHV(HIGH,2),REF(HHV(HIGH,2),BARSLAST(REF(CROSS(MACD2,0),1)))));
 STICKLINE(MACD2>=0,0,MACD2,2,1),COLOR0000FF;
 STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,2,0),COLOR0000FF;
 STICKLINE(MACD2<0,0,MACD2,2,0),COLORFFFF00;
 STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,2,1),COLORFFFF00;
 DIF:DIFF,LINETHICK2,COLOR0000FF;
 MACD:DEA,COLORFF0000;
 DEF:MACD2,LINETHICK0,COLORFFFF00;
 STICKLINE(CLOSE>0,0,0,2,0),COLOR808080;
 DEFUT:=BARSLAST(CROSS(MACD2,0));
 DEFDT:=BARSLAST(CROSS(0,MACD2));
 DEFUL:=IF(MACD2>=0,HHV(MACD2,DEFUT+1),REF(HHV(MACD2,DEFUT+1),DEFDT+1));
 DEFDL:=IF(MACD2<0,LLV(MACD2,DEFDT+1),REF(LLV(MACD2,DEFDT+1),DEFUT+1));
 DEFU2L:=REF(DEFUL,DEFUT+1);
 DEFD2L:=REF(DEFDL,DEFDT+1);
 DRAWICON(LLV(MACD2,4)>0 AND MACD2<REF(MACD2,1) AND REF(MACD2,1)>REF(MACD2,2) AND REF(MACD2,2)>REF(MACD2,3),MACD2,2);
 DRAWICON(HHV(MACD2,4)<0 AND MACD2>REF(MACD2,1) AND REF(MACD2,1)<REF(MACD2,2) AND REF(MACD2,2)<REF(MACD2,3),MACD2,1);
 DRAWICON((JUD1 OR BARSLAST(JDU1)>BARSLAST(JUD1)) AND MACD2>=0 AND REF(MACD2,1)<REF(DEFU2L,1) AND MACD2>DEFU2L,MACD2,5);
 DRAWICON((JDU1 OR BARSLAST(JDU1)<BARSLAST(JUD1)) AND MACD2<0 AND REF(MACD2,1)>REF(DEFD2L,1) AND MACD2<DEFD2L,MACD2,3);
 VAR111:=JDU1 OR BARSLAST(JDU1)<BARSLAST(JUD1);
 VAR112:=HHV(MACD2,4)<0 AND MACD2>REF(MACD2,1) AND REF(MACD2,1)<REF(MACD2,2) AND REF(MACD2,2)<REF(MACD2,3);
 3. 变色MACD
(1)
DIFIF1:=EMA(CLOSE,12) - EMA(CLOSE,26);
 DEAEA1:=EMA(DIFIF1,9);
 MACD1:=2*(DIFIF1-DEAEA1),STICK;
 MACD2:=EMA(MACD1,3);
 STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED;
 STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORGREEN;
 STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORCBCBC0;
 STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;
 DIFIF1,COLOR33FF33,LINETHICK2;
 DEAEA1,COLORYELLOW,LINETHICK2;
 MACD:MACD1,NODRAW,COLORMAGENTA;
强:IF(DIFIF1>=DEAEA1,DIFIF1,DRAWNULL),COLORRED,LINETHICK2;
弱:IF(DEAEA1>=DIFIF1,DEAEA1,DRAWNULL),COLORFF9900,LINETHICK2;
 DRAWICON(CROSS(DIFIF1,DEAEA1),DIFIF1+0.1,1);
 DRAWICON(CROSS(DEAEA1,DIFIF1),-0.5,2);
 DRAWTEXT(CROSS(DIFIF1,DEAEA1),DIFIF1,"○"),LINETHICK2, COLORYELLOW;
(2)
DIFIF1:=EMA(CLOSE,12) - EMA(CLOSE,26);
 DEAEA1:=EMA(DIFIF1,9);
 MACD1:=2*(DIFIF1-DEAEA1),STICK;
 MACD2:=EMA(MACD1,3);
 STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED;
 STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORGREEN;
 STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORCBCBC0;
 STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;
 DIFIF1,COLOR33FF33,LINETHICK2;
 DEAEA1,COLORYELLOW,LINETHICK2;
 MACD:MACD1,NODRAW,COLORMAGENTA;
强:IF(DIFIF1>=DEAEA1,DIFIF1,DRAWNULL),COLORRED,LINETHICK2;
弱:IF(DEAEA1>=DIFIF1,DEAEA1,DRAWNULL),COLORFF9900,LINETHICK2;
 DRAWICON(CROSS(DIFIF1,DEAEA1),DIFIF1+0.1,1);
 DRAWICON(CROSS(DEAEA1,DIFIF1),-0.5,2);
 DRAWTEXT(CROSS(DIFIF1,DEAEA1),DIFIF1,"○"),LINETHICK2, COLORYELLOW;
 4. 至尊MACD
 DIFF:EMA(DCLOSE,12)-EMA(DCLOSE,26);
 DEA:EMA(DIFF,9),COLORFFFF00;
 MACD:(DIFF-DEA)*2;
 STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORRED;
 STICKLINE(MACD>=0 AND MACD<=REF(MACD,1),0,MACD,1,0),COLORGREEN;
 STICKLINE(MACD<=0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORFF00FF;
 STICKLINE(MACD<=0 AND MACD<=REF(MACD,1),0,MACD,1,0),COLOR00FFFF;
多转空:=((((LLV(MACD,4)>0) AND (MACD<REF(MACD,1))) AND (REF(MACD,1)>REF(MACD,2))) AND (REF(MACD,2)>REF(MACD,3)));
空转多:=((((HHV(MACD,4)<0) AND (MACD>REF(MACD,1))) AND (REF(MACD,1)<REF(MACD,2))) AND (REF(MACD,2)<REF(MACD,3)));
 DRAWICON(多转空,MACD,2);
 DRAWICON(空转多,MACD,1);
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
 DRAWTEXT(低位金叉,DEA," 低位金叉"),COLORFF00FF;
 JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
 STICKLINE(二次金叉,0,0.2,2,0),COLORFF00FF;
 DRAWTEXT(二次金叉,DEA*1.06,"二次金叉"),COLORRED;
 A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
 DRAWTEXT(底背离,-0.2-MACD,"底背离"),COLORWHITE;
 A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
 DRAWTEXT(顶背离,0.2+MACD,"顶背离"),COLORWHITE;

上一页  [1] [2] [3] [4] [5] [6] 

股票公式栏目导航

精品指标推荐

最新热门

本类随机推荐

相关公式