股票论坛

 找回密码
 免费注册
搜索
热搜: 活动 交友 discuz
查看: 2692|回复: 2
打印 上一主题 下一主题

请老师将macd源码副图指标改一个选股公式

[复制链接]

指标研习组

Rank: 11Rank: 11Rank: 11Rank: 11

听众
4
跳转到指定楼层
楼主
发表于 2015-8-8 18:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
10爱心果
请老师将macd源码副图指标中macd量柱超前高变黄时第一个黄量柱改一个选股公式,谢谢!
MACD源码:
DIF:EMA(C,12)-EMA(C,26);
DEA:EMA(DIF,9);
MACD:DIF-DEA)*2,COLORSTICK;  
VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);
VA2:=CROSS(BACKSET(CROSS(0,MACD),REF(VA1,1)+2),0.5);
前高:RAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1),COLORMAGENTA,DOTLINE ;
STICKLINE(MACD>前高,MACD,前高,1,0),COLORYELLOW;

QG:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(VA1,1)+2),0.5);
终点:=IF(ISLASTBAR AND MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD<0)),1,IF(FILTERX(QG,BARSCOUNT(C)),2,DRAWNULL));
UU:=(终点=1 OR 终点=2) AND MACD>0;
ZZ:=FILTERX(UU,BARSCOUNT(C));
横线:=CONST(REF(MACD,BARSLAST(ZZ)));
WW:=MACD>横线;
起始点:=FILTERX(REFX(BARSLAST(WW),1)=1,BARSCOUNT(C));
上线:RAWLINE(起始点,横线,ZZ,横线,0),COLORGREEN;

DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);
强度:IF(DIFF>=DEA,DIFF,DRAWNULL),COLORRED;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;

JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;


FH1:=REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4);
FH2:=MACD>=0 AND COUNT(MACD>REF(MACD,1),1)=1;
FH3:=FH1 AND FH2 AND EMA(C,13)>REF(EMA(C,13),1);
FH4:=FH1 AND FH2 AND ABS((DIF-DEA)/C)<0.018;
FH5:=FH1 AND FH2 AND MACD<0.10;
VV:=CLOSE>OPEN AND MA(CLOSE,5)>MA(CLOSE,10) AND MA(CLOSE,10)>MA(CLOSE,30)
AND DIFF>DEA AND MACD>REF(MACD,1) AND DIFF>0 AND DEA>0 AND
MA(VOL,5)>MA(VOL,34) AND MA(CLOSE,30)>=REF(MA(CLOSE,30),1);
佛手:=IF(VV,1,0);

二次翻红:=(FH3 OR FH4 OR FH5);
低买:=CROSS(DIF,DEA) AND DIF<0;
加油:=CROSS(DIF,DEA) AND DIF>0;

DRAWTEXT(二次翻红,-0.15,'↖翻红'),COLORRED;
DRAWTEXT(CROSS(DIF,DEA) AND DIF<0,DEA-0.02,'↖低买'),COLORFF00FF;
DRAWTEXT(CROSS(DIF,DEA) AND DIF>0,DEA-0.05,'↖加油'),COLORRED;

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.13,2,0),COLOR00FF00;
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;
DRAWTEXT(底背离,0.1,' 底背离'),COLOR00FF00;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;

爵府★★★●

Rank: 21Rank: 21Rank: 21Rank: 21Rank: 21Rank: 21

听众
5

爵★★★爵★★★爵★★★

沙发
发表于 2016-8-26 22:37 | 只看该作者
也没人回答啊
回复

使用道具 举报

爵府★★★●

Rank: 21Rank: 21Rank: 21Rank: 21Rank: 21Rank: 21

听众
5

爵★★★爵★★★爵★★★

板凳
发表于 2016-11-1 09:44 | 只看该作者
学习
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

QQ|站点首页|手机版|小黑屋|帮助中心|桂ICP备14001964号

GMT+8, 2024-11-24 03:50 , Processed in 0.152421 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表