编写要求:
解答:
?网友求助:
牛熊背离指标源码: 请老师帮忙修改成一个选股公式,条件设置:牛熊绿线在下跌趋势中,首次大于或等于昨天数值。并且股价在之前66个交易日内有过大于等于百分之5.18的涨幅的股票。
N1:=5;
N2:=10;
N3:=21;
N4:=60;
牛熊:EMA(CLOSE,N4),COLORGREEN,LINETHICK3;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,8);
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
A2:=BARSLAST(REF(CROSS(K,D),1));
B2:=REF(C,A2+1)>C AND REF(K,A2+1)
LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));
B3:=REF(C,A3+1)>C AND REF(RSI1,A3+1)
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)
DRAWTEXT(IF(D1>0,1,0),H+0.1,'MACD顶背'),COLORWHITE;
C2:=BARSLAST(REF(CROSS(D,K),1));
D2:=REF(C,C2+1)
DRAWTEXT(IF(D2>0,1,0),H+0.25,'KDJ顶背'),COLORWHITE;
C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));
D3:=REF(C,C3+1)
DRAWTEXT(IF(D3>0,1,0),H+0.4,'RSI顶背'),COLORYELLOW;
SG:EMA(HHV(H,1),8),COLORGRAY;
X1:EMA(CLOSE,N1),COLORYELLOW;
JJ:=(H+L+3*C)/5;
这个公式可能麻烦点,多谢老师帮忙了。
Copyright 2018- www.dyjian.com/ 大宇股票知识网 海口美兰韩哲棚百货商行 版权所有 琼ICP备2023001966号
免责声名:本站所发表的内容仅用于学术交流和学习,内容所带来的一切后果均与本站无关。若您发现本站存在您非授权的原创作品,请第一时间联系本站删除!