原文地址:CDL1945战法老师很厉害,我把指标整理了一下作者:桩子 CDL1945战法老师很厉害,我把指标整理了一下,不足之处请指教??? 今小昨:=IF(C<REF(O,1) AND f<0,1,0); 如果今天收盘价小于昨天开盘价 同时今天股价以下跌状态收盘 赋值为1 否则为0 p1:=今小昨; 今小前:=IF(C<REF(O,2) AND f<0,1,0); 如果今天收盘价小于前天开盘价 同时今天股价以下跌状态收盘 赋值为1 否则为0 p2:=今小前; stickline(P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1,open,CLOSE,3,0),colormagenta;如果昨天同时符合今小昨和今小前两个条件而今天又都不符合,K线为紫阳线! stickline(P1=1 AND REF(P1,1)=0 AND P2=1 AND REF(P2,1)=0,open,CLOSE,3,0),colorAAAAAA; 会变色的kdj: 分析家公式: RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:SMA(RSV,M1,1),COLORGREEN; D:SMA(K,M2,1),COLORYELLOW; J:=3*K-2*D; PARTLINE(J,J>ref(J,1),RGB(255,50,0),J<ref(J,1),RGB(180,180,180)); 飞狐公式: REFLINE: 0, 20, 50, 80, 100; RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:SMA(RSV,M1,1); D:SMA(K,M2,1); J:3*K-2*D; PARTLINE(j>REF(j,1),j),COLORRED; PARTLINE(j<REF(j,1),j),COLORgreen; 会变色的macd: 分析家公式: DIFF:EMA(CLOSE,12) - EMA(CLOSE,26); DEA:EMA(DIFF,9),LINETHICK2; MACD:=2*(DIFF-DEA); PARTLINE(DIFF,DIFF>ref(DIFF,1),RGB(255,50,0),DIFF<ref(DIFF,1),RGB(255,255,255)); PARTLINE(MACD,MACD>0,RGB(205,100,100),MACD<0,RGB(0,200,0)),COLORSTICK; 飞狐MACD公式中加入一下两句: PARTLINE(DIFF>ref(DIFF,1),DIFF),COLORRED; PARTLINE(DIFF<ref(DIFF,1),DIFF),COLORgreen; 紫阳公式: M3:MA(C,3),COLORGREEN; E10:EMA(C,10),COLORWHITE; E40:EMA(C,40),LINETHICK2,COLOR33AAFF; M80:MA(C,80),LINETHICK2,COLOREE8888; F:=100*(C-REF(C,1))/REF(C,1); 今小昨:=IF(C<REF(O,1) AND f<0,1,0); p1:=今小昨; 今小前:=IF(C<REF(O,2) AND f<0,1,0); p2:=今小前; stickline(P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1,open,CLOSE,3,0),COLORFF88FF; stickline(P1=1 AND REF(P1,1)=0 AND P2=1 AND REF(P2,1)=0,open,CLOSE,3,0),COLORGREEN; 专门观察顶底背离的MACD指标: 分析家原码:参数N1缺省值5 0,COLOR888888; DF:(EMA(C,12)-EMA(C,26)); DE:EMA(DF,9),LINETHICK2,COLORYELLOW; T1:=DF>REF(DF,1) AND REF(DF,1)<REF(DF,2); T2:=DF<REF(DF,1) AND REF(DF,1)>REF(DF,2); RM:=IF(T1 OR T2,REF(DF,1),0); HA:=RM+N1*0.03;HB:=RM-N1*0.03;HC:=RM-N1*0.02;HD:=RM+N1*0.02; PARTLINE(DF,DF>REF(DF,1),RGB(255,50,0),DF<REF(DF,1),RGB(255,255,255)); STICKLINE(T2,HA,HC,8 ,0 ),COLOR0000AA; STICKLINE(T2,HA,HC,6.6,0),COLOR0011BB; STICKLINE(T2,HA,HC,4.4,0),COLOR0022CC; STICKLINE(T2,HA,HC,3.3,0),COLOR0033DD; STICKLINE(T2,HA,HC,2.2,0),COLOR0044EE; STICKLINE(T2,HA,HC,1.1,0),COLOR0055FF; STICKLINE(T1,HB,HD,8,0 ),COLORFFAA00; STICKLINE(T1,HB,HD,6.6,0),COLORFFBB11; STICKLINE(T1,HB,HD,4.4,0),COLORCCCC22; STICKLINE(T1,HB,HD,3.3,0),COLORCCDD33; STICKLINE(T1,HB,HD,2.2,0),COLORCCEE44; STICKLINE(T1,HB,HD,1.1,0),COLORCCFF55; 飞狐原码: {N1: 10, 1, 100} 0,COLOR888888; DF:(EMA(C,12)-EMA(C,26)); DE:EMA(DF,9),LINETHICK2,COLORYELLOW; T1:=DF>REF(DF,1) AND REF(DF,1)<REF(DF,2); T2:=DF<REF(DF,1) AND REF(DF,1)>REF(DF,2); RM:=IF(T1 OR T2,REF(DF,1),0); HA:=RM+N1*0.03;HB:=RM-N1*0.03;HC:=RM-N1*0.02;HD:=RM+N1*0.02; PARTLINE(DF>REF(DF,1),DF),colorRED; PARTLINE(DF<REF(DF,1),DF),colorGREEN; STICKLINE(T2,HA,HC,8 ,0 ),COLOR0000AA; STICKLINE(T2,HA,HC,6.6,0),COLOR0011BB; STICKLINE(T2,HA,HC,4.4,0),COLOR0022CC; STICKLINE(T2,HA,HC,3.3,0),COLOR0033DD; STICKLINE(T2,HA,HC,2.2,0),COLOR0044EE; STICKLINE(T2,HA,HC,1.1,0),COLOR0055FF; STICKLINE(T1,HB,HD,8,0 ),COLORFFAA00; STICKLINE(T1,HB,HD,6.6,0),COLORFFBB11; STICKLINE(T1,HB,HD,4.4,0),COLORCCCC22; STICKLINE(T1,HB,HD,3.3,0),COLORCCDD33; STICKLINE(T1,HB,HD,2.2,0),COLORCCEE44; STICKLINE(T1,HB,HD,1.1,0),COLORCCFF55; [ Last edited by 罡风 on 2005-3-22 at 00:26 ] cdl1954老师的 cdl指标源码 input:s(8,1,20,1); 买:c,colorFFFFFF; 止:买/(1+0.005+2/100-s/1000),color00ff00; 平:买*(1+s/1000),coloryellow; 二:买*(1.02+s/1000),COLORRED; 三:买*(1.03+s/1000),color00ff00; 五:买*(1.05+s/1000),COLORFFFFFF; 十:买*(1.10+s/1000),color00ff00; 最高:H,COLORMAGENTA; E40:=EMA(C,40); E40gl:(C-E40)/E40*100,coloryellow; c1:="1a0001$close"; pn:=(C1/c1)*3; DIff :(10000*( EMA(CLOSE,12) - EMA(CLOSE,26)))*pn,colorred; 逃命:H/1.11,COLORFFFFFF; DEA : EMA(DIfF,9),coloryellow; Macd : 2*(DIfF-DEA),COLORSTICK; STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,2,0),COLORYELLOW; STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,2,0),COLORwhite; partline(DIFF,DIFF>ref(DIFF,1),rgb(255,0,0),DIFF<ref(DIFF,1),rgb(0,255,0)); DI :=5*(EMA(CLOSE,6) - EMA(CLOSE,20)); DE := EMA(DI,5); MD := (DI-DE); L1:=TROUGHBARS( 3,5,1,0 ); L2:=TROUGHBARS( 3,5,2,0 ); L3:=TROUGHBARS( 3,5,3,0 ); L4:=TROUGHBARS( 3,5,4,0 ); M30:=MA(C,30); M40:=MA(C,40); 乖底天数:=BARSLAST(E40gl<= LLV( E40gl,20)); RSVK:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100; KK:=SMA(RSVK,3,1); DK:=SMA(KK,3,1); JK:=3*KK-2*DK; 顶:(JK<120 AND JK>98 AND JK>REF(JK,1))*5000,COLORYELLOW; A1:=(C/MA(C,3)>=(1+0.07) AND C=HHV(C,3) AND MA(V,2)/MA(V,40)>=3 AND MA(V,2)=HHV(MA(V,2),3) AND V>REF(V,1) AND C>REF(C,1)); A9:=MA(C,30); A10:=(C-A9)/A9*100; A11:=MA(A10,3); A15:=BARSLAST(CROSS(-10,A11)=1); DRAWTEXT(FILTER(顶 , 10),顶*1.2 ,'顶' ),colorRED; rr8:=MA(CLOSE,27); rr9:=(CLOSE-rr8)/rr8*100; rrA:=MA(rr9,2); rrB:=BARSLAST(CROSS(-10,rrA)=1); rrD:=rrA<-10 AND rrB>3;{ 黄金坑 黄金坑:( IF(rrD,-2000,0)),coloryellow,stick,LINETHICK3;} ----------------------------------------------------------- 请教 dragonger老兄如何把kdj指标加入macd中的?我试着弄了一下不行,不显示kdj。或者不显示macd了。老兄能告诉一下方法吗?谢谢!! 在CDL原码中加入 J:jk*200-10000; partline(j,j>ref(j,1),rgb(255,0,255),j<ref(j,1),rgb(0,255,180)); kdj变色指标源码 kdj变色: (fxj) 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; partline(j,j>ref(j,1),rgb(255,0,0),j<ref(j,1),rgb(0,255,0)); kdj变色: (fh) 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; partline(j>ref(j,1),j),colorred; partline(j<ref(j,1),j),colorgreen; [ Last edited by th999 on 2005-1-4 at 23:25 ] 再学建一个主图平滑均线指标EXPCDL,还是先从公式管理器中做起,原码如下: EXPCDL 主图叠加 P11 10 1 100 1 P22 40 1 200 1 P3 5 1 300 1 E10:EMA(CLOSE,P11); E40:EMA(CLOSE,P22); M5:MA(CLOSE,p3); M3:MA(CLOSE,3),color00ff00; F:=100*(C-REF(C,1))/REF(C,1); 今小昨:=IF(C<REF(O,1) AND f<0,1,0); p1:=今小昨; 今小前:=IF(C<REF(O,2) AND f<0,1,0); p2:=今小前; stickline(P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1,open,CLOSE,3,0),colormagenta; stickline(P1=1 AND REF(P1,1)=0 AND P2=1 AND REF(P2,1)=0,open,CLOSE,3,0),colorAAAAAA; {DRAWICON(CLOSE>=M3,LOW,7);}; f:=100*(c-ref(c,1))/ref(c,1); a1:=close; a2:=open; stickline(a1<a2 and f<-3 and f>-5,a1+(a2-a1)/3,a1+(a2-a1)/3,6,0),COLORred; stickline(a1<a2 and f<-3 and f>-5,a1+2*(a2-a1)/3,a1+2*(a2-a1)/3,6,0),COLORred; stickline(a1<a2 and f<=-5 and f>-7,a1+(a2-a1)/2,a1+(a2-a1)/2,6,0),COLORred; stickline(a1<a2 and f<=-7 and f>-10,a1+2*(a2-a1)/3,a1+(a2-a1)/3,6,1),COLORred; STICKLINE(A1<A2 AND F<=-9.9,A2,A1,6,0),COLOR00ff00; stickline(a1>a2 and f>3 and f<5,a2+(a1-a2)/3,a2+(a1-a2)/3,6,0),COLORyellow; stickline(a1>a2 and f>3 and f<5,a2+2*(a1-a2)/3,a2+2*(a1-a2)/3,6,0),COLORyellow; stickline(a1>a2 and f>=5 and f<7,a2+(a1-a2)/2,a2+(a1-a2)/2,6,0),COLORyellow; stickline(a1>a2 and f>=7 and f<10,a2+2*(a1-a2)/3,a2+(a1-a2)/3,6,1),COLORyellow; stickline(a1>a2 and f>=9.91,a1,a2,6,0),COLORyellow; 实际上就是EXPMA10,40,一根可调整的均线(一般为5)加一根固定的3MA,没有什么特别的,不喜欢的可以不用。 紫阳选股.FNC 原码: DIFF := (EMA(CLOSE,12) - EMA(CLOSE,26) ); DEA := EMA(DIFF,9); MACD := 2*(DIFF-DEA); p1:=macd>ref(macd,1) and ref(macd,1)<ref(macd,2); F1:=100*(C-REF(C,1))/REF(C,1); p1a:=IF(C<REF(O,1) AND f1<0,1,0); p2a:=IF(C<REF(O,2) AND f1<0,1,0); p2:=P1a=0 AND REF(P1a,1)=1 AND P2a=0 AND REF(P2a,1)=1; p1 and p2; (CDL 法选股)下列条件一起成立: 1 价上姨; 2 紫阳现; 3 姐向上; 4 妹向上; 5 价上妹; 选出后,用CDL法结合 CCI 60分图 选取最佳; 以均线延长定买点 次日竞价挂单 [ Last edited by dragonger on 2005-2-28 at 21:57 ] 根据上述条件,我编了个fjx公式: ZF:=(C/REF(C,1)-1)*100; A1:=ZF>=0;A2:=REF(C,1)<REF(O,2);A3:=REF(C,1)<REF(O,3);A4:=REF(ZF,1)<0; T0:=A1 AND A2 AND A3 AND A4; M3:=MA(C,3); 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; T1:=J>REF(J,1); T2:=C>=EMA(C,40) AND C>=M3; T3:=M3>=REF(M3,1); XG:IF(T0 AND T1 AND T2 AND T3,30,0); 山中泉水:带角度KDJ源码: 参数没变:N 9 1 100 1 M1 3 2 40 1 M2 3 2 40 1 RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:SMA(RSV,M1,1); D:SMA(K,M2,1); J:3*K-2*D; partline(j,j>ref(j,1),rgb(255,0,0),j<ref(j,1),rgb(0,255,0)); jd:=j; 角度:atan(jd-ref(jd,1))*180/3.1416,LINETHICK0; 0;50;98; 泉水兄这一贴的总结,我编了个公式看了看,条件如下: 1〕当日或前一日出紫阳; 2〕J翻红; 3〕DIF翻红或上涨; 4〕DIF>DEA; 5〕C<E40; 不太灵,好像有些默认条件没有给出 附原码: DIF:EMA(CLOSE,12)-EMA(CLOSE,26); DEA:EMA(DIF,9); T1:=DIF>REF(DIF,1) AND DIF>DEA; PARTLINE(DIF,DIF>REF(DIF,1),RGB(255,50,0),DIF<ref(DIF,1),RGB(255,255,255)); 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;T2:=J>REF(J,1);T3:=C<EMA(C,40); F:=100*(C-REF(C,1))/REF(C,1); 今小昨:=IF(C<REF(O,1) AND f<0,1,0); p1:=今小昨; 今小前:=IF(C<REF(O,2) AND f<0,1,0); p2:=今小前; TT4:=P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1; T4:=TT4 OR REF(TT4,1); XG:IF(T1 AND T2 AND T3 AND T4,0.1,0),COLORAAAAAA; 泉水: DRAWICON(XG=0.1,0.1,1); 做了一个专门观察顶底背离的macd: 找底背离比较蓝色柱子,找顶背离比较红色柱子。 参数N1是调整柱子长度的,默认值10。 公式原码: 0,COLOR888888; DF:(EMA(C,12)-EMA(C,26)); DE:EMA(DF,9),LINETHICK2,COLORYELLOW; T1:=DF>REF(DF,1) AND REF(DF,1)<REF(DF,2); T2:=DF<REF(DF,1) AND REF(DF,1)>REF(DF,2); RM:=IF(T1 OR T2,REF(DF,1),0); HA:=RM+N1*0.03;HB:=RM-N1*0.03;HC:=RM-N1*0.02;HD:=RM+N1*0.02; PARTLINE(DF,DF>REF(DF,1),RGB(255,50,0),DF<REF(DF,1),RGB(255,255,255)); STICKLINE(T2,HA,HC,8 ,0 ),COLOR0000AA; STICKLINE(T2,HA,HC,6.6,0),COLOR0011BB; STICKLINE(T2,HA,HC,4.4,0),COLOR0022CC; STICKLINE(T2,HA,HC,3.3,0),COLOR0033DD; STICKLINE(T2,HA,HC,2.2,0),COLOR0044EE; STICKLINE(T2,HA,HC,1.1,0),COLOR0055FF; STICKLINE(T1,HB,HD,8,0 ),COLORFFAA00; STICKLINE(T1,HB,HD,6.6,0),COLORFFBB11; STICKLINE(T1,HB,HD,4.4,0),COLORCCCC22; STICKLINE(T1,HB,HD,3.3,0),COLORCCDD33; STICKLINE(T1,HB,HD,2.2,0),COLORCCEE44; STICKLINE(T1,HB,HD,1.1,0),COLORCCFF55; [ Last edited by 罡风 on 2005-3-13 at 19:54 ] 芳版已经公布MACD DIF: (EMA(CLOSE,12)-EMA(CLOSE,26)),PRECIS2; DEA:=EMA(DIF,9); MACD:=(DIF-DEA)*2;0; PARTLINE(dif,dif>ref(dif,1),RGB(220,20,60),dif<ref(dif,1),RGB(30,144,255),1,RGB(0,0,255)); dn:=c>ref(c,1) and dif<ref(dif,1); di:=c<ref(c,1) and dif>ref(dif,1); stickline(dn,dif,0,0,0),colorred; 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; jj:if(j>ref(j,1),dif+0.03,dif-0.03); F:=100*(C-REF(C,1))/REF(C,1); 今小昨:=IF(C<REF(O,1) AND f<0,1,0); p1:=今小昨; 今小前:=IF(C<REF(O,2) AND f<0,1,0); p2:=今小前; doo:=P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1; stickline(doo,dif,jj,2,0),colormagenta; stickline(di,dif,jj,2,0),colorblue; 神秘短线源码已公布 这个公式实际上可命名为:大阳实体 这就是源码,有人已猜得大差不离了。 (h-l)/l>0.095 and (c-o)/o>0.08 and (o-l)/l<0.05; 第一个语句是说当天的振幅大于9.5%; 第二个语句是说当天的K线实体长度大于8%(不是涨幅,它取决于开盘,开盘很低的话,当天涨幅很小也会合要求。 第三个语句是个限定条件,即K线下影线不能太长超过5%。 [ Last edited by yzswxs on 2004-12-4 at 11:11 ] 再贴一公式,名字就先叫做“神秘短线3“吧! BIAS30:=(CLOSE-MA(CLOSE,30))/MA(CLOSE,30)*100; c/ref(c,1)>=1.09 and c=h and ref(bias30,1)<-5; |
|