投股票网 www.tou18.cn [今日股市行情 股市在线查询 股票大盘行情] 股市有风险 投资需谨慎 手机APP下载 | 手机访问 | 加入收藏 | 保存到桌面
投股票网
今日股市行情 股市在线查询 股票大盘行情
个股查询: 资金行情 DDX查询 大智慧超赢 同花顺DDE 千股千评 最新提示 股票公告 投资要点 评级查询 大小非 股东 增发配股 股权 高管 股票概况
当前位置: 投股票网 > 股市公式下载 > 公式问题
股市公式查询:

《macd背离指标》改成预警公式

2020/4/27 18:25:32

公式编写说明:

要求:将公式中的“买”做个选股公式。源码如下:RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1),COLORWHITE;D:=SMA(K,3,1),COLORYELLOW;J:=3*K-2*D,COLORFF00FF;A:=250;DIFF:=(EMA(CLOSE,12) - EMA(CLOSE,26));DEA:=EMA(DIFF,9),COLORBLUE,LINETHICK0;MACD:=2*(DIFF-DEA);MM:=IF(MACD< 0,MACD,0); JJ:=MM> REF(MM,1); ZZ:=REF(JJ,1)=1; 准备:=(JJ AND ZZ)*DEA; STICKLINE(准备=DEA,1,-1,2,1),COLORFFFF00;JH:=HHV(MAX(K,MAX(D,J)),A);DH:=HHV(MAX(DIFF,DEA),A);SH:=INTPART(JH/DH)/2;DIFF50:=SH*DIFF+50,COLORFFFF00;DEA50:=SH*DEA+50,COLORBLUE;STICKLINE(DIFF50>DEA50,0,1.5*(DIFF50-DEA50),0,0),COLORRED; STICKLINE(DIFF50<DEA50,0,1.5*(DIFF50-DEA50),0,0),COLORFFFF00;红柱:IF(1.5*(DIFF50-DEA50)>REF(1.5*(DIFF50-DEA50),1),1.5*(DIFF50-DEA50),0),STICK,COLORLICYAN;绿柱:IF(1.5*(DIFF50-DEA50)<REF(1.5*(DIFF50-DEA50),1),1.5*(DIFF50-DEA50),0),STICK,COLORGREEN;缩头:=IF(1.5*(DIFF50-DEA50)>0 AND REF(1.5*(DIFF50-DEA50),1)>REF(1.5*(DIFF50-DEA50),2) AND 1.5*(DIFF50-DEA50)< REF(1.5*(DIFF50-DEA50),1),1,0);缩脚:=IF(1.5*(DIFF50-DEA50)<0 AND REF(1.5*(DIFF50-DEA50),1)< REF(1.5*(DIFF50-DEA50),2) AND 1.5*(DIFF50-DEA50)>REF(1.5*(DIFF50-DEA50),1),1,0);杀多:=IF(1.5*(DIFF50-DEA50)<0 AND REF(1.5*(DIFF50-DEA50),1)> REF(1.5*(DIFF50-DEA50),2) AND 1.5*(DIFF50-DEA50)<REF(1.5*(DIFF50-DEA50),1),1,0);诱空:=IF(1.5*(DIFF50-DEA50)>0 AND REF(1.5*(DIFF50-DEA50),1)< REF(1.5*(DIFF50-DEA50),2) AND 1.5*(DIFF50-DEA50)>REF(1.5*(DIFF50-DEA50),1),1,0);阻力:=IF(CROSS(C,MA(C,20)) OR CROSS(C,MA(C,60)),1,0);DRAWTEXT(FILTER(杀多,3) AND 杀多,1.5*(DIFF50-DEA50),'杀多'),COLORFF00FF;DRAWTEXT(FILTER(缩头,3) AND 缩头,1.5*(DIFF50-DEA50)+0.2,'卖'),COLORFF00FF;DRAWTEXT(FILTER(诱空,3) AND 诱空,1.5*(DIFF50-DEA50),'?洗盘'),COLOR00FF00;DRAWTEXT(FILTER(缩脚,3) AND 缩脚,1.5*(DIFF50-DEA50)-0.2,'买'),COLOR00FF00;DRAWTEXT(FILTER(阻力,16) AND 1.5*(DIFF50-DEA50)>=0,1.5*(DIFF50-DEA50)+0.01,'阻力'),COLOR00FFFF;VRA:=REF(CLOSE,1); VRB:=SMA(MAX(CLOSE-VRA,0),6,1)/SMA(ABS(CLOSE-VRA),6,1)*100; VRC:=(2*CLOSE+HIGH+LOW)/4; VR0:=LLV(LOW,34); VR1:=HHV(HIGH,34); VR2:=EMA((VRC-VR0)/(VR1-VR0)*100,6); VR3:=EMA(0.667*REF(VR2,1)+0.333*VR2,4); VA1:=(REF(HIGH,1)+REF(LOW,1))/2; VA2:=MA(CLOSE,20)+2*STD(CLOSE,20); VA3:=REF(CLOSE,1); VA4:=SMA(MAX(CLOSE-VA3,0),7,1)/SMA(ABS(CLOSE-VA3),7,1)*100; VA5:=CROSS(79,VA4); VA6:=FILTER(VA5,4); VVD:=MA(CLOSE,80)-MA(CLOSE,10)/3; VA7:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1); X1:=CROSS(VA1,VA2) OR VA6; X2:=CROSS(84,VRB); STICKLINE(X1 OR X2,1.5*(DIFF50-DEA50)*1.05,1.5*(DIFF50-DEA50)*1.08,3,0); Y1:=IF(COUNT(CLOSE<REF(CLOSE,1),8)/8>0.3 AND COUNT(VA2>VA3,3) AND REF(LOW,1)=LLV(LOW,120) AND CLOSE>OPEN,1,0); Y2:=IF(CLOSE<VVD AND VOL/240>MA(VOL,5)/240 AND CLOSE>REF(CLOSE,1)*1.08 AND CLOSE<MA(CLOSE,13)*1.3,1,0); Y3:=CROSS(VA7,10); Y4:=IF(COUNT(CLOSE<REF(CLOSE,1),8)/8>0.3 AND COUNT(VR2>VR3,3) AND REF(LOW,1)=LLV(LOW,120) AND CLOSE>OPEN,1,0); STICKLINE(Y1 OR Y2 OR Y3 OR Y4,1.5*(DIFF50-DEA50)*0.90,1.5*(DIFF50-DEA50)*0.99,3,0);DD:=C=HHV(C,180); EE:=DEA< REF(DEA,1) AND REF(DEA< REF(DEA,1),1)=1; CC:=C> REF(C,1) AND REF(C> REF(C,1),1)=1; 上升背离:(CC AND EE)*1.5*(DIFF50-DEA50),LINETHICK2,COLORWHITE; 顶背离:(DD AND EE AND DEA< HHV(DEA,180))*3*ABS(DIFF50-DEA50),STICK,LINETHICK3,COLORGREEN; FF:=C=LLV(C,180); GG:= DEA> REF(DEA,1) AND REF(DEA> REF(DEA,1),1)=1; LL:=C< REF(C,1) AND REF(C< REF(C,1),1)=1; 下降背离:(LL AND GG)*1.5*(DIFF50-DEA50),LINETHICK2,COLORYELLOW; 底背离:(FF AND GG AND DEA> LLV(DEA,180))*3*(DIFF50-DEA50),STICK,LINETHICK3,COLORRED;YY:=IF(准备=DEA,1,0),COLORCYAN,NODRAW;长方形方块:IF(REF(YY,1)=0 AND YY=1 AND 上升背离<0 AND REF(上升背离,1)=0,1,0),COLORCYAN,NODRAW;

公式源码回答:

 RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;

K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
A:=250;
DIFF:=(EMA(CLOSE,12) - EMA(CLOSE,26));
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
JH:=HHV(MAX(K,MAX(D,J)),A);
DH:=HHV(MAX(DIFF,DEA),A);
SH:=INTPART(JH/DH)/2;
DIFF50:=SH*DIFF+50;
DEA50:=SH*DEA+50;
缩脚:=IF(1.5*(DIFF50-DEA50)<0 AND REF(1.5*(DIFF50-DEA50),1)< REF(1.5*(DIFF50-DEA50),2) AND 1.5*(DIFF50-DEA50)>REF(1.5*(DIFF50-DEA50),1),1,0);
FILTER(缩脚,3) AND 缩脚;

投 股票网 www.t ou18.cn

股市公式下载推荐
投股票网股市查询:资金行情查询 实时DDX查询 大智慧超赢 千股千评 最新提示 股票公告 投资要点 评级查询 股东查询 增发配股查询 股权结构查询
浙江新能 600032+10.05% 评股 实时DDX 大智慧 最新消息 题材分析 股权
得润电子 002055+10.03% 评股 实时DDX 大智慧 最新消息 题材分析 股权
大湖股份 600257+10.03% 评股 实时DDX 大智慧 最新消息 题材分析 股权
大港股份 002077+10.03% 评股 实时DDX 大智慧 最新消息 题材分析 股权
鼎胜新材 603876+10.02% 评股 实时DDX 大智慧 最新消息 题材分析 股权
松霖科技 603992+10.02% 评股 实时DDX 大智慧 最新消息 题材分析 股权
千方科技 002373+10.02% 评股 实时DDX 大智慧 最新消息 题材分析 股权
铭普光磁 002902+10.02% 评股 实时DDX 大智慧 最新消息 题材分析 股权
新通联 603022+10.02% 评股 实时DDX 大智慧 最新消息 题材分析 股权
京城股份 600860+10.02% 评股 实时DDX 大智慧 最新消息 题材分析 股权
联系我们:nmsy8@hotmail.com 友情链接 要求相关的财经股票网站 今日股市行情在线查询
本站不推荐任何股票,站内广告不代表投股票网的观点,由此引起的一切法律责任均与本站无关,请网民自行判断真假,谨防网上股票预测诈骗!
本站所有内容仅供参考,不构成投资建议,据此操作,风险自担。本站不为所提供数据的错误或因依此信息所采取的任何行为负责。
手机版(手机访问当前页面) | 手机APP下载 | 电脑端(适合电脑或大屏用户) | 备案号:沪ICP备2024045114号-120