编写要求:
请老师从MACD的红色起点和紫线上穿白线和趋势为先白线上穿黄线时做一个选股源码 MACD源码如下: CD:="MACD.MACD"(6,13,4); CD1:="MACD.MACD"(12,26,9); 标准MACD:CD1,LINESTICK; 综合MACD:CD+CD1; 红34天统计:SUM(IF(CD >0 ,CD,0),34),COLORRED,NODRAW; 绿34天统计:SUM(IF(CD <=0 ,CD,0),34),COLORGREEN,NODRAW; STICKLINE(CD1 > REF(CD1,1),0,CD1,0,0),COLORRED; STICKLINE(CD1 < REF(CD1,1),0,CD1,0,0),COLORGREEN; STICKLINE(CD > 0,CD1,CD+CD1,2.3,0),COLORRED; STICKLINE(CD <=0,CD1,CD+CD1,2.3,0),COLORGREEN; DIF标准:"MACD.DIF"(12,26,9),COLORMAGENTA,LINETHICK3,NODRAW; DEA标准:"MACD.DEA"(12,26,9),COLORWHITE,LINETHICK2,NODRAW; DIF6_13短:="MACD.DIF"(6,13,4); DEA6_13短:="MACD.DEA"(6,13,4); BL1:=0.618; DIF综合:(DIF标准+DIF6_13短)*BL1,COLORMAGENTA,LINETHICK3{NODRAW}; DEA综合:(DEA标准+DEA6_13短)*BL1,COLORWHITE,LINETHICK2{NODRAW}; BL2:=HHV(ABS(综合MACD),250); STICKLINE(CD > 0,0,0.02*BL2,4,0),COLORRED; STICKLINE(CD <=0,0,0.02*BL2,4,0),COLORGREEN; {以下属附加的,可去掉}; TYP:= AMOUNT/VOL/100; V1:=SUM(IF(TYP>REF(TYP,1),TYP*VOL,0),21)/SUM(IF(TYP"MACD.DEA" AND "MACD.DEA"<0; QJ7:="KDJ.K">"KDJ.D" AND "KDJ.D"<30; QJ8:="MACD.DIF"<"MACD.DEA"; QJ9:="KDJ.K"<"KDJ.D" AND "KDJ.K">80; 特大:QJ4*QJ5,NODRAW;大单:QJ3*QJ5,NODRAW; 中单:QJ1*QJ5,NODRAW;小单:QJ2*QJ5,NODRAW; W1:=SUM(大单,N)+SUM(特大,N);W2:=SUM(小单,N)+SUM(中单,N); 量振1:=特大>大单 AND 大单>小单; 量振2:=特大<小单 AND 大单<小单; 标振1:=QJ6 AND QJ7; 标振2:=QJ8 AND QJ9; A:=W1-W2;A0:=IF(A>0,A,0);B0:=IF(A<0,A,0); STICKLINE(A0,0,A0,3,0),COLOR000044; STICKLINE(A0,0,A0,2.5,0),COLOR000088; STICKLINE(A0,0,A0,1.5,0),COLOR0000AA; STICKLINE(A0,0,A0,1,0),COLOR0000CC; STICKLINE(B0,0,-B0,3,0),COLOR004400; STICKLINE(B0,0,-B0,2.5,0),COLOR008800; STICKLINE(B0,0,-B0,1.5,0),COLOR00AA00; STICKLINE(B0,0,-B0,1,0),COLOR00CC00; 周趋势:MA(A,5),COLORFFFFFF; 平滑值:EMA(周趋势,5),COLOR00FFFF; STICKLINE(标振1 AND 量振1 AND 周趋势>平滑值,0,A0,3,0),COLORYELLOW; DRAWTEXT(标振1 AND 量振1 AND 周趋势>平滑值,A0,'振'),COLORYELLOW;
解答:
?红柱在0位置, 这个没看懂楼主的意思, 是否指第一根跨越0轴的红柱子? 或者楼主用图来指示
CD:="MACD.MACD"(6,13,4);
CD1:="MACD.MACD"(12,26,9);
CD>0 and max(cd1,cd+cd1)>0;
紫上穿白
DIF标准:="MACD.DIF"(12,26,9);
DEA标准:="MACD.DEA"(12,26,9);
DIF6_13短:="MACD.DIF"(6,13,4);
DEA6_13短:="MACD.DEA"(6,13,4);
DIF综合:=(DIF标准+DIF6_13短)*0.618;
DEA综合:=(DEA标准+DEA6_13短)*0.618;
cross(DIF综合,DEA综合);
白上穿黄
cross(MA(A,5),EMA(MA(A,5),5));
Copyright 2018- www.dyjian.com/ 大宇股票知识网 海口美兰韩哲棚百货商行 版权所有 琼ICP备2023001966号
免责声名:本站所发表的内容仅用于学术交流和学习,内容所带来的一切后果均与本站无关。若您发现本站存在您非授权的原创作品,请第一时间联系本站删除!