手机版 理想小程序
理想小程序
RSS 论坛APP
返回列表

请大师把下面大智慧公式改成通达信公式及选股公式及选股条件

6527 1
设置
1742789 Lv.1

专栏

复制 显示全部楼层 倒序浏览 |
跳转到指定楼层

通达信和同花顺哪个好指标编写_技术互助答疑论坛股票软件指标公式技术理想股票技术论坛

请大师帮忙,把下面大智慧公式改成通达信公式: 下面公式是MACD KDJ RSI日周月线选股副图公式,我觉得不错,准确率高,很适合抓中长线的底部及顶部,请改成通达信能 ...指标编写_技术互助答疑论坛股票软件指标公式技术

请大师帮忙,把下面大智慧公式改成通达信公式:

    下面公式是MACD KDJ RSI日周月线选股副图公式,我觉得不错,准确率高,很适合抓中长线的底部及顶部,请改成通达信能用的公式,并请改成选股公式寄选股条件怎麽设定?
   input:n1(6),n2(12),n3(24);
DRAWGBK(close>0,STRIP(RGB(25,25,112),RGB(47,79,79),0));
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1),LINETHICK3,COLORWHITE;
D:SMA(K,3,1),LINETHICK3,COLORyellow;
J:3*K-2*D,LINETHICK3,COLORred;
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),linethick2,COLORgreen;
DEA :EMA(DIFF,9),linethick2,COLORblue;
MACD:2*(DIFF-DEA),linethick2,COLORred;
YLZC:=if(close=INDEXC,(INDEXC+INDEXh+INDEXl+INDEXO)/4,AMOUNT/(vol+0.01)/100);
阻价:=if(close=INDEXC,YLZC+INDEXC-INDEXl,YLZC+(close-low));
支价:=if(close=INDEXC,INDEXl+INDEXC-YLZC,low+(close-YLZC));
今压:REF(阻价,1);
今撑:REF(支价,1);
明压:阻价;
明撑:支价;
rsv1:=(hhv(h,9.8)-c)/(hhv(h,9.8)-llv(l,9.8))*101;
kk:=sma(rsv1,3,1);
dd:=sma(kk,3,1);
jj:=3*kk-2*dd;
买卖:=if(jj>=100,100,if(jj<=0,0,jj));
明天买:if(买卖=100,0-10,0),color00cccc;
明天卖:if(买卖=0,90,100),color00ff00;

LC := REF(CLOSE,1);
SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100,LINETHICK1,Colorred;
SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100,LINETHICK1,COLORgreen;
SMA(MAX(CLOSE-LC,0),N3,1)/SMA(ABS(CLOSE-LC),N3,1)*100,LINETHICK1,COLORblue;
KX:=250;
KH:=HHV(K,KX);
DH:=HHV(D,KX);
JH:=HHV(J,KX);
KL:=LLV(K,KX);
DL:=LLV(D,KX);
JL:=LLV(J,KX);
HKMAX:=MAX(KH,MAX(DH,JH));
LKMIN:=MIN(KL,MIN(DL,JL));
KHLB:=(HKMAX+LKMIN)/2;
KHLC:=HKMAX-LKMIN;
MHF:=HHV(DIFF,KX);
MHD:=HHV(DEA,KX);
MHM:=HHV(MACD,KX);
MLF:=LLV(DIFF,KX);
MLD:=LLV(DEA,KX);
MLM:=LLV(MACD,KX);
HMAX:=MAX(MHF,MAX(MHD,MHM));
LMIN:=MIN(MLF,MIN(MLD,MLM));
FHLB:=(HMAX-LMIN)/100;
FHLC:=HMAX-LMIN;
SH:=(0-FHLB)*(KHLC/FHLC)+KHLB;
DIFFA:=(DIFF-FHLB)*(KHLC/FHLC)+KHLB;
DEAA:=(DEA-FHLB)*(KHLC/FHLC)+KHLB;
MACDA:=(macd-FHLB)*(KHLC/FHLC)+KHLB;
CDA:=MACD<ref(MACD,1) and MACD>0;
CDB:=MACD>=ref(MACD,1) and MACD>0;
CDC:=MACD>ref(MACD,1) and MACD<0;
CDD:=MACD<=ref(MACD,1) and MACD<0;
STICKLINE(CDA,SH,macda,6,0),COLOR00AAFF;{黄色段}
STICKLINE(CDA,SH,macda,6.6,0),COLOR00BBFF;
STICKLINE(CDA,SH,macda,4.4,0),COLOR00CCFF;
STICKLINE(CDA,SH,macda,3.3,0),COLOR00DDFF;
STICKLINE(CDA,SH,macda,2.2,0),COLOR00EEFF;
STICKLINE(CDA,SH,macda,1.1,0),COLOR00FFFF;
STICKLINE(CDB,SH,macda,6,0),COLOR0000AA; {红色段}
STICKLINE(CDB,SH,macda,6.6,0),COLOR0011BB;
STICKLINE(CDB,SH,macda,4.4,0),COLOr0022CC;
STICKLINE(CDB,SH,macda,3.3,0),COLOR0033DD;
STICKLINE(CDB,SH,macda,2.2,0),COLOR0044EE;
STICKLINE(CDB,SH,macda,1.1,0),COLOR0055FF;
STICKLINE(CDC,SH,macda,6,0),COLORAA00BB;{向上粉红}
STICKLINE(CDC,SH,macda,6.6,0),COLORBB11BB;
STICKLINE(CDC,SH,macda,4.4,0),COLORCC22BB;
STICKLINE(CDC,SH,macda,3.3,0),COLORDD33BB;
STICKLINE(CDC,SH,macda,2.2,0),COLOREE44BB;
STICKLINE(CDC,SH,macda,1.1,0),COLORFF55BB;
STICKLINE(CDD,SH,macda,6,0),COLORFF7700;
STICKLINE(CDD,SH,macda,6.6,0),COLORFF8811;
STICKLINE(CDD,SH,macda,4.4,0),COLORFFAA22;
STICKLINE(CDD,SH,macda,3.3,0),COLORFFBB33;
STICKLINE(CDD,SH,macda,2.2,0),COLORFFDD44;
STICKLINE(CDD,SH,macda,1.1,0),COLORFFDD55;
PARTLINE(DIFFA,DIFF>0,RGB(255,153,153),DIFF<0,RGB(255,153,153));
PARTLINE(DEAA,DEA>0,RGB(65,105,225),DEA<0,RGB(65,105,225));
DRAWTEXT(BARSTATUS=2,SH,'~~0'),color00aaaa;
TYP:=(HIGH+LOW+CLOSE)/3;
STICKLINE(diff>ref(diff,1),20,20,2,0),COLORRED;
STICKLINE(diff<ref(diff,1),20,20,2,0),COLORGREEN;
STICKLINE(K>=ref(K,1) or k>d and diff>ref(diff,1),80,80,2,1),COLORRED;
STICKLINE(K<ref(K,1),80,80,2,1),COLORGREEN;
MACD金叉:=CROSS(MACD,DIFF) AND MACD>=(0-0.05) AND MACD<=0.02;
DRAWTEXT(MACD金叉,40,'▲MACD金叉'),colorRED;
XX:=ema(MA(LOW,3)*0.96,30);
DIFF金叉:=if(CROSS(DIFF,DEA) AND XX-REF(XX,1)>0 AND MACD>=REF(MACD,1) AND DIFF<=0,1,0);
DRAWTEXT(DIFF金叉=1,35,'▲DIFF金叉'),colorRED;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
DRAWTEXT(低位金叉,25,'▲低位金叉'),colorRED;
DIFDEA:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(DIFDEA=2,21)=1;
DRAWTEXT(二次金叉,20,'▲二次金叉'),colorRED;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
MACD底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
DRAWTEXT(MACD底背离,30,'▲MACD底背离'),colorRED;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
MACD顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(FILTER(MACD顶背离,5),100,'▼MACD顶背离'),COLORBLUE;
{周金叉,死叉}
周DIFF:="MACD.DIFF#WEEK";
周DEA:="MACD.DEA#WEEK";
周MACD:="MACD.MACD#WEEK";
DIF周金叉:=CROSS(周DIFF,周DEA);
DRAWTEXT(DIF周金叉,45,'▲DIFF周金叉'),colorRED;
DRAWTEXT(CROSS(周DEA,周DIFF),110,'▼DIFF周死叉'),align0,colorBLUE;
MACD周金叉:=CROSS(周MACD,周DIFF) AND 周MACD>=(0-0.05) AND 周MACD<=0.02;
DRAWTEXT(MACD周金叉,50,'▲MACD周金叉'),colorRED;
{月金叉,死叉}
月DIFF:="MACD.DIFF#MONTH";
月DEA:="MACD.DEA#MONTH";
月MACD:="MACD.MACD#MONTH";
DIF月金叉:=CROSS(月DIFF,月DEA);
DRAWTEXT(DIF月金叉,55,'▲DIFF月金叉'),colorRED;
DRAWTEXT(CROSS(月DEA,月DIFF),105,'▼DIFF月死叉'),align0,colorBLUE;
MACD月金叉:=CROSS(月MACD,月DIFF) AND 月MACD>=(0-0.05) AND 月MACD<=0.02;
DRAWTEXT(MACD月金叉,60,'▲MACD月金叉'),colorRED;
周K:="KDJ.K#WEEK"(9,3,3);
周D:="KDJ.D#WEEK"(9,3,3);
周J:="KDJ.J#WEEK"(9,3,3);
月K:="KDJ.K#MONTH"(9,3,3);
月D:="KDJ.D#MONTH"(9,3,3);
月J:="KDJ.J#MONTH"(9,3,3);
KD月金叉:=cross(月K,月D);
KD周金叉:=cross(周K,周D);
KD日金叉:=FILTER(cross(K,D) and D<50,4);
KD低位金叉:=FILTER(cross(K,D) and D<20,4);
DRAWTEXT(KD月金叉,0,'▲KD月金叉'),colorRED;
DRAWTEXT(KD周金叉,-5,'▲KD周金叉'),colorRED;
DRAWTEXT(KD日金叉,-10,'▲KD日金叉'),colorRED;
DRAWTEXT(KD低位金叉,5,'▲KD低位金叉'),colorRED;
KD1:=COUNT(CROSS(K,D),BARSLAST(D>=50));
KD二次金叉:=CROSS(K,D) AND D<50 AND COUNT(KD1=2,21)=1;
DRAWTEXT(KD二次金叉,10,'▲KD二次金叉'),colorRED;
KD2:=COUNT(CROSS(D,K),BARSLAST(D<=50));
KD二次死叉:=CROSS(D,K) AND D>50 AND COUNT(KD2=2,21)=1;
DRAWTEXT(KD二次死叉,95,'▼KD二次死叉'),ColorBLUE;

KD日死叉:=FILTER(cross(D,K) and D>80,4);
DRAWTEXT(KD日死叉,80,'▼KD日死叉'),COLORBLUE;
DRAWTEXT(CROSS(周D,周K),85,'KD周死叉'),COLORDDDDDD;
DRAWTEXT(CROSS(月D,月K),90,'KD月死叉'),COLORDDDDDD;
KDB:=BARSLAST(ref(cross(k,d),1));
KDDB:=ref(close,KDB+1)>close and ref(k,KDB+1)<k and cross(k,d);
KDJ底背离:=if(FILTER(KDDB>0,5),1,0);
DRAWTEXT(KDJ底背离=1,15,'▲KDJ底背离'),colorRED;
KDD:=BARSLAST(ref(cross(d,k),1));
KDJ顶背离:=ref(close,KDD+1)<close and ref(k,KDD+1)>k and cross(d,k);
DRAWTEXT(FILTER(KDJ顶背离>0,5),120,'▼kDJ顶背离'),COLORBLUE;
MD1:=MA(CLOSE,80)-MA(CLOSE,13)/3;
MD2:=MA((CLOSE-MD1)/MD1,3);
买点1:=CROSS(MD2,0) AND LOW/REF(HIGH,1)<1.012 AND J<75 AND J>REF(J,1);
ma12:=MA(CLOSE,12);
佳点:=if(FILTER(MACD>=REF(MACD,5) AND open<=ref(close,1) and XX-REF(XX,1)>0 AND MACD<=0 AND ma12-REF(ma12,1)>=0,3) and J<80 and J>ref(J,1) and D>ref(D,1) and (diff>=ref(diff,1) or dea>=ref(dea,1)),1,0);
DRAWTEXT(佳点=1,macda*0.98,'佳点'),color00CC00;
DX0:=EMA(CLOSE,2)-EMA(OPEN,5);
DX1:=if(CROSS(DX0,MACD) AND LOW<=XX AND MACD<=(0-0.11) and (J<20 or K<20),1,0);
DRAWTEXT(FILTER(DX1,3),0,'短10%'),color00CC00;{短线}
MA10:=MA(CLOSE,10);
SS:=EMA(MA(HIGH,3)*1.05,30);
LQS:=if(FILTER(0.7*(CROSS(DIFF,DEA) AND CLOSE<SS AND XX-REF(XX,1)>0 AND CROSS(MACD,0) AND MACD>=0 AND DIFF>0 AND ma10-REF(ma10,1)>0 AND VOL>REF(VOL,1))>=0.7 AND (CLOSE<SS AND XX-REF(XX,1)>0),5) AND J<80,1,0);
DRAWTEXT(LQS=1,macda*0.98,'量价齐上'),color00CC00;{量价齐上}
最佳点:=IF(COUNT(MD2>REF(MD2,1),3)=3 AND COUNT(MD2<0,10)=10 AND REF(MD2,3)=LLV(MD2,10) and J<80 and J>ref(J,1),1,0);
DRAWTEXT(最佳点=1,J,'最佳点'),color00CC00;
买点2:=REF(MD2,2)=LLV(MD2,20) AND REF(MD2,2)<0.071 AND REF(MD2,2)<REF(MD2,1) AND
NOT(REF(LOW,1)>REF(HIGH,2) AND LOW>REF(HIGH,1)) AND CLOSE>REF(CLOSE,1) AND J<75 AND J>REF(J,1);
DRAWTEXT(买点1 or 买点2,D-1,'买'),color00CC00;
{预涨}
AZ:=DYNAINFO(7);
AC1:=REF(C,1);
ZF1:=(AZ-AC1)/AC1*100;
BZ:=DYNAINFO(8);
BV1:=REF(VOL,1);
ZF2:=BZ/BV1*100;
DZ:=REF(CLOSE,1)-REF(OPEN,1);
EZ:=DYNAINFO(23)-DYNAINFO(22);
FZ:=REF(VOL,1)-REF(VOL,2);
预涨:=ZF1>1 AND ZF1<5 AND ZF2>30 AND DZ>0 AND EZ>0 AND FZ>0 AND D>REF(D,1);
DRAWTEXT(预涨,d*0.6,'预\n涨'),color00CC00;


RSI周金:DRAWTEXT(CROSS("rsi.rsi1#WEEK"(n1,n2,n3),"rsi.rsi2#WEEK"(n1,n2,n3)) ,65,'▲RSI周金'),COLORRED;
RSI周死:DRAWTEXT(CROSS("rsi.rsi2#WEEK"(n1,n2,n3),"rsi.rsi1#WEEK"(n1,n2,n3)) ,130,'▼RSI周死'),COLORBLUE;
RSI月金:DRAWTEXT(CROSS("rsi.rsi1#MONTH"(n1,n2,n3),"rsi.rsi2#MONTH"(n1,n2,n3)) ,70,'▲RSI月金'),COLORRED;
RSI月死:DRAWTEXT(CROSS("rsi.rsi2#MONTH"(n1,n2,n3),"rsi.rsi1#MONTH"(n1,n2,n3)) ,115,'▼RSI月死'),COLORBLUE;
A3:=BARSLAST(ref(cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=ref(c,A3+1)>c and ref("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) and cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
RSI底背离:=FILTER(B3>0,5);
DRAWTEXT(RSI底背离,75,'▲RSI底背离'),COLORRED;
C3:=BARSLAST(ref(cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=ref(c,C3+1)<c and ref("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) and cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
RSI顶背离:=FILTER(D3>0,5);
DRAWTEXT(RSI顶背离,125,'▼RSI顶背离'),COLORBLUE;

牛股1:二次金叉 and MACD底背离  and  低位金叉  and  kd周金叉  and  月D<20;
牛股2:二次金叉 and MACD底背离  and  低位金叉  and  kd月金叉  and  周D<20;
牛股3:KD日金叉 and KD周金叉 and KD月金叉  and  DIF周金叉;
牛股6:KD周金叉  and KD月金叉  and  DIF周金叉;
大牛股:FILTER(牛股1  and 牛股2   and 牛股3,18);

底背离三合一:MACD底背离 and KDJ底背离 and RSI底背离;
二合一1:MACD底背离 and KDJ底背离 ;
二合一2:MACD底背离 and RSI底背离;
二合一3:KDJ底背离 and RSI底背离;
顶背离:MACD顶背离 or KDJ顶背离 or RSI顶背离;

DRAWTEXT(牛股3 OR 大牛股  OR 牛股6  OR 底背离三合一,D-8,'▲▲▲全仓买'),COLORred;
牛股1:二次金叉 and MACD底背离  and  低位金叉  and  kd周金叉  and  月D<20;
牛股2:二次金叉 and MACD底背离  and  低位金叉  and  kd月金叉  and  周D<20;
牛股3:KD日金叉 and KD周金叉 and KD月金叉  and  DIF周金叉;
牛股6:KD周金叉  and KD月金叉  and  DIF周金叉;
大牛股:FILTER(牛股1  and 牛股2   and 牛股3,18);

底背离三合一:MACD底背离 and KDJ底背离 and RSI底背离;
二合一1:MACD底背离 and KDJ底背离 ;
二合一2:MACD底背离 and RSI底背离;
二合一3:KDJ底背离 and RSI底背离;
顶背离:MACD顶背离 or KDJ顶背离 or RSI顶背离;

DRAWTEXT(牛股3 OR 大牛股  OR 牛股6  OR 底背离三合一,D-8,'▲▲▲全仓买'),COLORred;
慎重声明:
      指标内含有#MONTH和#WEEK两个周期函数,在操作使用中如出现“周金(死叉)叉或月金(死叉)”不能作为买或加仓或卖的参考依据。
      关于周、月的线值,由于在日线下是日的周期,周线下是周的周期,月线下是月的周期,比如KDJ的RSV参数日线是9天,周线是9周,月线则是9月,计算周线和月线不使用#WEEK和#MONTH函数在日线状态下其走势的准确度也很难达到目的。按照RSV以9的参数为例,计算公式为9日RSV=(C-L9)÷(H9-L9)×100,式中C为第9日的收盘价,L9为9日内的最低价,H9为9日内的最高价。KD的计算应是:当日K值=2/3×前一日K值+1/3×当日RSV,当日D值=2/3×前一日D值+1/3×当日K值。那么在日线下计算周线就是
RSVZ:=(CLOSE-LLV(LOW,45))/(HHV(HIGH,45)-LLV(LOW,45))*100;
周K:=SMA(RSVZ,15,1);
周D:=SMA(周K,15,1);
周J:=3*周K-2*周D;
742.middle
410742
Lv.2

专栏

发表于 2010-4-15 11:46 复制 查看全部楼层 屏蔽
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
您需要登录后才可以回帖 登录

本版积分规则 《理想财富服务协议》《免责声明》

楼主
2楼
131943xjzjpcd6s1hvja2p
160828rrwbe8b2ijeeae8w
站长推荐 /1

最新主题

回顶部 到页底