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

CCI指标修改成通达信

2020/2/1 18:30:58

公式编写说明:

{ccI-J}DRAWGBKlast(DATE>900101,strip(RGB(0,0,150),RGB(0,0,40),0));TYB:= (HIGH + LOW + 2*CLOSE)/4;CCIA:=(TYB-MA(TYB,14))/(0.015*AVEDEV(TYB,14));CCIB:=(TYB-MA(TYB,28))/(0.015*AVEDEV(TYB,28));CCIC:=(TYB-MA(TYB,42))/(0.015*AVEDEV(TYB,42));CCI:WMA((CCIA+CCIB+CCIC)/3,3);IF(CROSS(REF(CCI,1),CCI) AND CCI>100,60,100),COLOR0077ff;IF(CROSS(CCI,REF(CCI,1)) AND CCI<-150,-60,-100),COLOR00ffff;XG: IF(CROSS(CCI,REF(CCI,1)) AND CCI<-150 AND "KDJ.J"(9,3,3)<10 ,-80,-100),COLOR0000ff;PARTLINE(cci,cci>REF(cci,1),rgb(255,0,0),cci<=REF(cci,1),rgb(0,255,0) ),LINETHICK2;A1:=cci>REF(cci,1) and REF(cci,1)<REF(cci,2); C1:=BACKSET(A1>0,2); D1:=(C1>0 AND REF(C1,1)<1);A2:=cci<REF(cci,1) and REF(cci,1)>REF(cci,2);C2:=BACKSET(A2>0,2);D2:=(C2>0 AND REF(C2,1)<1);R1:=BACKSET(DISPSTATUS=2,BARSLAST(D1)+1); S1:=R1>REF(R1,1); T1:=BACKSET(DISPSTATUS=2,BARSLAST(D2)+1); U1:=T1>REF(T1,1); R2:=BACKSET(S1,REF(BARSLAST(D1),1)+2); S2:=R2>REF(R2,1); T2:=BACKSET(U1,REF(BARSLAST(D2),1)+2);U2:=T2>REF(T2,1); DRAWLINE(S2,cci,S1,cci,1),COLOR00ff00,linethick4; DRAWLINE(U2,cci,U1,cci,1),POINTDOT,COLORBLUE,linethick4;Var12:=(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34))*100;能量线:SMA(Var12,3,1)*(-1)+100,colorRED,linethick0;KNX:=SMA(Var12,3,1);MK:=MA(KNX,18);XG买:IF(KNX>45 AND CROSS(MK , KNX),-50,-100),COLOR00ff00;{顶底背离}{1.MACD}A1:=BARSLAST(REF(CROSS("MACD.DIFF","MACD.DEA"),1));B1:=REF(C,A1+1)>C AND REF("MACD.DIFF",A1+1)<"MACD.DIFF" AND CROSS("MACD.DIFF","MACD.DEA");DRAWTEXT(B1>0,-100,'M底背'),COLOR00FFFF,LINETHICK1;{MACD底背离};C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIFf"),1));D1:=REF(C,C1+1)<C AND REF("MACD.DIFf",C1+1)>"MACD.DIFf" AND CROSS("MACD.DEA","MACD.DIFf");DRAWTEXT(D1>0,95,'M顶背'),COLOR0077FF,LINETHICK1;{MACD顶背离};{2.KDJ}A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");DRAWTEXT(B2,-50,'J9底背'),COLOR00FFFF,LINETHICK1;{KDJ底背离};C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K");DRAWTEXT(D2>0,80,'J9顶背'),COLOR0077FF,LINETHICK1;{KDJ顶背离};{3.RSI}A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");DRAWTEXT(B3>0,-80,'R底背'),COLOR00FFFF,LINETHICK1;{RSI底背离}C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1");DRAWTEXT(D3>0,65,'R顶背'),COLOR0077FF,LINETHICK1;{RSI顶背离};{4.CCI}TYB:= (HIGH + LOW + 2*CLOSE)/4;CCI4:=(TYB-MA(TYB,28))/(0.015*AVEDEV(TYB,28));B4:=LAST(MA(C,5)<MA(C,10)<=5) AND CCI4>REF(CCI4,1) AND CROSS(CCI4,-100); { CCI底背离'}XG:=((B1 AND B2) OR (B2 AND B3) OR (B1 AND B3) OR ( B4 AND CCI4<-90) ) AND "KDJ.D"<30;{转向选股}转向:=TROUGHBARS(3,15,1)<10; {3--收盘.15--转向幅度.前【1个】的ZIG转向波谷值}DDX10红天:=count("DDX.DDX">0,10)>5;if(转向>ref(转向,1) AND "DDX.DDX">0 AND DDX10红天,0,-100),COLORff00ff,linethick1;DRAWTEXT(LAST(MA(C,5)<MA(C,10)<=5) AND CCI>REF(CCI,1) AND CROSS(CCI,-100),-100,'CCI底背离'),COLOR00ff00;

公式源码回答:

 
DRAWGBK(O>C,RGB(0,0,150),RGB(0,0,40),0,'1',0);
{CCI-J}
TYB:= (HIGH + LOW + 2*CLOSE)/4;
CCIA:=(TYB-MA(TYB,14))/(0.015*AVEDEV(TYB,14));
CCIB:=(TYB-MA(TYB,28))/(0.015*AVEDEV(TYB,28));
CCIC:=(TYB-MA(TYB,42))/(0.015*AVEDEV(TYB,42));
CCI:WMA((CCIA+CCIB+CCIC)/3,3);
IF(CROSS(REF(CCI,1),CCI) AND CCI>100,60,100),COLOR0077FF;
IF(CROSS(CCI,REF(CCI,1)) AND CCI<-150,-60,-100),COLOR00FFFF;
XG: IF(CROSS(CCI,REF(CCI,1)) AND CCI<-150  AND "KDJ.J"(9,3,3)<10 ,-80,-100),COLOR0000FF;
IF(CCI>REF(CCI,1),CCI,DRAWNULL),COLORRED,LINETHICK2;
IF(CCI<=REF(CCI,1),CCI,DRAWNULL),COLORGREEN,LINETHICK2;
A1:=CCI>REF(CCI,1) AND REF(CCI,1)<REF(CCI,2); 
C1:=BACKSET(A1>0,2); 
D1:=(C1>0 AND REF(C1,1)<1);
A2:=CCI<REF(CCI,1) AND REF(CCI,1)>REF(CCI,2);
C2:=BACKSET(A2>0,2);
D2:=(C2>0 AND REF(C2,1)<1);
R1:=BACKSET(ISLASTBAR,BARSLAST(D1)+1); 
S1:=R1>REF(R1,1); 
T1:=BACKSET(ISLASTBAR,BARSLAST(D2)+1); 
U1:=T1>REF(T1,1); 
R2:=BACKSET(S1,REF(BARSLAST(D1),1)+2); 
S2:=R2>REF(R2,1); 
T2:=BACKSET(U1,REF(BARSLAST(D2),1)+2);
U2:=T2>REF(T2,1); 
DRAWLINE(S2,CCI,S1,CCI,1),COLOR00FF00,LINETHICK2; 
DRAWLINE(U2,CCI,U1,CCI,1),POINTDOT,COLORFFFF00,LINETHICK3;
VAR12:=(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34))*100;
能量线:SMA(VAR12,3,1)*(-1)+100,COLORRED,LINETHICK0;
KNX:=SMA(VAR12,3,1);
MK:=MA(KNX,18);
XG买:IF(KNX>45 AND CROSS(MK , KNX),-50,-100),COLOR00FF00;
{顶底背离}
{1.MACD}
A1Q:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));
B1:=REF(C,A1Q+1)>C AND REF("MACD.DIF",A1Q+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");
DRAWTEXT(B1>0,-100,'M底背'),COLOR00FFFF,LINETHICK1;{MACD底背离};
C1Q:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
D1Q:=REF(C,C1Q+1)<C AND REF("MACD.DIF",C1Q+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF");
DRAWTEXT(D1>0,95,'M顶背'),COLOR0077FF,LINETHICK1;{MACD顶背离};
{2.KDJ}
A2Q:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
B2Q:=REF(C,A2Q+1)>C AND REF("KDJ.K",A2Q+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");
DRAWTEXT(B2Q,-50,'J9底背'),COLOR00FFFF,LINETHICK1;{KDJ底背离};
C2Q:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
D2Q:=REF(C,C2Q+1)<C AND REF("KDJ.K",C2Q+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K");
DRAWTEXT(D2Q>0,80,'J9顶背'),COLOR0077FF,LINETHICK1;{KDJ顶背离};
{3.RSI}
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");
DRAWTEXT(B3>0,-80,'R底背'),COLOR00FFFF,LINETHICK1;{RSI底背离}
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1");
DRAWTEXT(D3>0,65,'R顶背'),COLOR0077FF,LINETHICK1;{RSI顶背离};
{4.CCI}
CCI4:=(TYB-MA(TYB,28))/(0.015*AVEDEV(TYB,28));
B4Q:=COUNT(MA(C,5)<MA(C,10),5)<=5 AND CCI4>REF(CCI4,1) AND CROSS(CCI4,-100);
{转向选股}
转向:=TROUGHBARS(3,15,1)<10; 
IF(转向>REF(转向,1)  ,0,-100),COLORFF00FF,LINETHICK1;
DRAWTEXT(COUNT(MA(C,5)<MA(C,10),5)<=5 AND CCI>REF(CCI,1) AND CROSS(CCI,-100),-100,'CCI底背离'),COLOR00FF00;

投股 票网 www.tou1 8.cn

股市公式下载推荐
投股票网股市查询:资金行情查询 实时DDX查询 大智慧超赢 千股千评 最新提示 股票公告 投资要点 评级查询 股东查询 增发配股查询 股权结构查询
利扬芯片 688135+4.76% 评股 实时DDX 大智慧 最新消息 题材分析 股权
广信材料 300537+4.76% 评股 实时DDX 大智慧 最新消息 题材分析 股权
游族网络 002174+4.70% 评股 实时DDX 大智慧 最新消息 题材分析 股权
动力源 600405+4.69% 评股 实时DDX 大智慧 最新消息 题材分析 股权
中航电测 300114+4.66% 评股 实时DDX 大智慧 最新消息 题材分析 股权
*ST西水 600291+4.60% 评股 实时DDX 大智慧 最新消息 题材分析 股权
森麒麟 002984+4.59% 评股 实时DDX 大智慧 最新消息 题材分析 股权
ST信通 600289+4.59% 评股 实时DDX 大智慧 最新消息 题材分析 股权
祥鑫科技 002965+4.58% 评股 实时DDX 大智慧 最新消息 题材分析 股权
天能股份 688819+4.57% 评股 实时DDX 大智慧 最新消息 题材分析 股权
联系我们:nmsy8@hotmail.com 友情链接 要求相关的财经股票网站 今日股市行情在线查询
本站不推荐任何股票,站内广告不代表投股票网的观点,由此引起的一切法律责任均与本站无关,请网民自行判断真假,谨防网上股票预测诈骗!
本站所有内容仅供参考,不构成投资建议,据此操作,风险自担。本站不为所提供数据的错误或因依此信息所采取的任何行为负责。
手机版(手机访问当前页面) | 手机APP下载 | 电脑端(适合电脑或大屏用户) | 备案号:沪ICP备2024045114号-120