大跌过后还是研究点传统指标吧。变色MACD源码
-
相关简介:C/C++ Code 复制内容到剪贴板 DIFF:=(EMA(CLOSE,12)-EMA(CLOSE,26)); DEA:=EMA(DIFF,9); MACD2:=(2*(DIFF-DEA)); DU0:=CROSS(DIFF,0); UD0:=CROSS(0,DIFF); TDU0:=BARSLAST(DU0); TUD0:=BARSLAST(UD0); DU3:=REF(DU0,1); UD3:=REF(UD0,1); TDU3:=BARSLAST
-
文章来源:择股网作者:股海网发布时间:2009-09-02浏览次数:
C/C++ Code复制内容到剪贴板
- DIFF:=(EMA(CLOSE,12) - EMA(CLOSE,26));
- DEA:=EMA(DIFF,9);
- MACD2:=(2 * (DIFF - DEA));
- DU0:=CROSS(DIFF,0);
- UD0:=CROSS(0,DIFF);
- TDU0:=BARSLAST(DU0);
- TUD0:=BARSLAST(UD0);
- DU3:=REF(DU0,1);
- UD3:=REF(UD0,1);
- TDU3:=BARSLAST(DU3);
- TUD3:=BARSLAST(UD3);
- UDGLINE:=IF((TDU3 < TUD3),REF(HHV(HIGH,2),TDU3),REF(LLV(LOW,2),TUD3));
- JDU0:=(((REF(CLOSE,1) <= REF(UDGLINE,1)) AND (CLOSE > UDGLINE)) AND (TDU0 < TUD0));
- JUD0:=(((REF(CLOSE,1) >= REF(UDGLINE,1)) AND (CLOSE < UDGLINE)) AND (TUD0 < TDU0));
- JDU1:=(JDU0 AND (COUNT(JDU0,TDU0) = 1));
- JUD1:=(JUD0 AND (COUNT(JUD0,TUD0) = 1));
- JDU2:=(JDU1 AND (REF(BARSLAST(JUD1),1) < REF(BARSLAST(JDU1),1)));
- JUD2:=(JUD1 AND (REF(BARSLAST(JUD1),1) > REF(BARSLAST(JDU1),1)));
- JDU3:=(JDU1 AND (REF(BARSLAST(JUD1),1) > REF(BARSLAST(JDU1),1)));
- JUD3:=(JUD1 AND (REF(BARSLAST(JUD1),1) < REF(BARSLAST(JDU1),1)));
- BSLINE:=IF((BARSLAST(JDU2) < BARSLAST(JUD2)),IF(REF(CROSS(0,MACD2),1),LLV(LOW,2),REF(LLV(LOW,2),BARSLAST(REF(CROSS(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,5,0),COLOR0000FF;
- STICKLINE(((MACD2>=0) AND (MACD2 < REF(MACD2,1))),0,MACD2,5,0),COLORWHITE;
- STICKLINE((MACD2<0),0,MACD2,5,0),COLORFFFF00;
- STICKLINE(((MACD2<0) AND (MACD2 > REF(MACD2,1))),0,MACD2,5,0),COLORYELLOW;
- DIF:DIFF,COLORMAGENTA,LINETHICK1;
- DEF:DEA,COLORYELLOW;
- MACD:MACD2,LINETHICK0,COLORFFFF00;
- {BIAS指标}
- BIAS :(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*4,COLORGRAY;
- LC:=REF(CLOSE,1);
- RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
- 顶部:=(CROSS(80,RSI)*30);
- 下成立:=cross(DEF,DIF) and DEF>0;
- DRAWTEXT(下成立,0.2,' 清仓'),COLORRED;
- DRAWTEXT(顶部,0.10,' 减仓'),COLORGREEN;
- JCCOUNT:=COUNT(CROSS(DIF,DEF),BARSLAST(DEF>=0));
- 二次金叉:=IF(CROSS(DIF,DEF) AND DEF<0 AND COUNT(JCCOUNT=2,21)=1,0.2,0);
- {STICKLINE(二次金叉,.03,.04,5,0),COLORYELLOW;}
- KK:=COUNT(CROSS(DIF,DEF) AND DEF<0,20)=2 AND CROSS(DIF,DEF) AND DEF<0;
- {STICKLINE(KK,.03,.04,5,0),COLORYELLOW;}
- DRAWTEXT(二次金叉,0.2,' 二金'),COLORWHITE;
- DRAWTEXT(KK,0.2,' 二金'),COLORWHITE;
- {低位金叉:=CROSS(DIF,DEF) AND DIF<-0.1;}
- {DRAWTEXT(低位金叉,0.10,' 低金'),COLORWHITE;}
- A1:=BARSLAST(REF(CROSS(DIF,DEF),1));
- 底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEF);
- DRAWTEXT(底背离,0.10,' 底背'),COLORFF00FF;
下载链接:( 说明:股海资源如需解压密码的请输入本站域名:www.guhai.com.cn请仔细输入!)
|
上一篇:自用主图源码(操盘线)
下一篇:寻找大底和选股。超短线2%--5%