咱们得给KDJ.CCI找个柺棍【ZIG】使他们的信号能够去伪存真.(TXT.副图解释)
============================================================================================= INPUT:ZF(10,0,50); DRAWGBKlast(DATE>900101,strip(RGB(0,0,100),RGB(0,0,40),0));0,COLORff9900; var9:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100; K:SMA(var9,3,1),COLOR00FFFF,DOTLINE; D:SMA(K,3,1),COLOR00FF00,DOTLINE; J:(3*K-2*D),COLOR0000FF,LINETHICK2; High1:=PEAK(4,ZF,1); Low1:=TROUGH(4,ZF,1); DRAWTEXT(CROSS(REF(High1,1),High1),100,''+NUMTOSTRN(High1 ,2)+''),ALIGN1,Color00ffFF,linethick1; DRAWTEXT(CROSS(Low1,REF(Low1,1)),20,''+NUMTOSTRN(Low1 ,2)+''),ALIGN1,Color00FFff,linethick1; VERTLINE(CROSS(REF(High1,1),High1),2),Color0000FF,LAYER0; VERTLINE(CROSS(Low1,REF(Low1,1)),2),Color00FF00,LAYER0; 持有:LAST(ZIG(4,ZF)>ref(ZIG(4,ZF),1)),COLOR0000FF ,STICK,LINETHICK2; 空仓:LAST(ZIG(4,ZF)<ref(ZIG(4,ZF),1)),COLOR00FF00,STICK,LINETHICK2; {大盘KDJ} DRSV:=(INDEXC-LLV(INDEXL,9))/(HHV(INDEXH,9)-LLV(INDEXL,9))*100; DK:=SMA(DRSV,3,1); DD:=SMA(DK,3,1); DJ:(3*DK-2*DD),COLOR00FFFF; PARTLINE(DJ,(DJ>REF(DJ,1))-1,rgb(0,255,0),1,rgb(255,0,0) ),POINTDOT,LINETHICK6,LAYER1; =============================================================================================== {ZIG-CCI} INPUT:ZF(10,0,50); DRAWGBKlast(DATE>900101,strip(RGB(0,0,100),RGB(0,0,40),0));100;-100;0,COLORFF9900; 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); PARTLINE(cci,cci>REF(cci,1),rgb(255,0,0),cci<=REF(cci,1),rgb(0,255,0) ),LINETHICK2; {顶底背离} {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; DRAWTEXT(LAST(MA(C,5)<MA(C,10)<=5) AND CCI>REF(CCI,1) AND CROSS(CCI,-100),-100,'CCI底背离'),COLOR00ff00; High1:=PEAK(4,ZF,1); Low1:=TROUGH(4,ZF,1); DRAWTEXT(CROSS(REF(High1,1),High1),150,''+NUMTOSTRN(High1 ,2)+''),ALIGN1,Color00ffFF,linethick1; DRAWTEXT(CROSS(Low1,REF(Low1,1)),-50,''+NUMTOSTRN(Low1 ,2)+''),ALIGN1,Color00FFff,linethick1; VERTLINE(CROSS(REF(High1,1),High1),2),Color0000FF,LAYER0; VERTLINE(CROSS(Low1,REF(Low1,1)),2),Color00FF00,LAYER0; 持有:LAST(ZIG(4,ZF)>ref(ZIG(4,ZF),1))*3,COLOR0000FF ,STICK,LINETHICK2; 空仓:LAST(ZIG(4,ZF)<ref(ZIG(4,ZF),1))*3,COLOR00FF00,STICK,LINETHICK2; ======================================================================================= |
评论内容只代表网友观点,与本站立场无关!
本网提供的公式文件说明:
* alg格式飞狐股票公式,可以用飞狐交易师或者交易师软件导入;
* fnc格式大智慧新一代公式指标,可以用大智慧股票软件使用,少部分可以用分析家股票软件引入使用;
* exp格式大智慧经典版股票公式,仅可以用大智慧经典版股票软件引入使用;
* tni和tnc格式通达信股票公式,仅可以用通达信新引入使用,例如可以用通达信股票软件引入使用;
* tne,tn6格式通达信公式,可以用通达信公式编辑器5.0版导入,推荐通达信金融终端版本;
* hxf格式同花顺股票公式,仅可以用同花顺股票软件引入使用。
以上的各种软件都可以在本网股票软件栏目找到!
* 关于股票公式时间限制,如果在引入大智慧公式,交易师公式或者飞狐公式的时候,发现公式名称栏是空白的,这时候调整电脑时间到1997年,又能出现公式名称,并且能正常显示,可能是公式使用期限已过。
* 关于还原公式源码如果你忘记了自己编写的大智慧公式,通达信公式,同花顺公式,操盘手公式,飞狐公式,博易大师公式,金字塔公式,文华公式和交易师公式等等公式的密码,本网可帮恢复源码,有.偿.服.务无意勿扰,点击在线咨询联系我。
* 关于股票公式源码编辑
本网提供的源码,一般都可以编辑成公式,如果不明白公式的编辑,在本页右侧教程录像可参考,或者找公式教程资料学习,请搜索:教程
* 如果您发现软件内容或者链接错误,请点击报告错误谢谢!
* 站内提供的所有软件包含源码均是由网上搜集,若侵犯了你的版权利益,请联系通知我们!