公式网-网站导航


网站搜索:  

公式在线 发表于2009/9/4 7:32:16

我的KDJ

 

 

C/C++ Code复制内容到剪贴板
  1. {为感谢论坛,我把我常用的KDJ送给大家}   
  2. input:N(9),M1(3),M2(3);   
  3.   
  4. RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;   
  5. K:SMA(RSV,M1,1),colorwhite;   
  6. D:SMA(K,M2,1),coloryellow;   
  7. J:3*K-2*D,colorff00ff;   
  8.   
  9. RSw:=(CLOSE-LLV(LOW,19))/(HHV(HIGH,19)-LLV(LOW,19))*100;   
  10. Kw:=SMA(RSw,4,1);   
  11. Dw:=SMA(Kw,4,1);   
  12. Jw:3*Kw-2*Dw,color008f00,linethick3;   
  13.   
  14. DRAWTEXT(cross(jw,kw) and kw<45,jw,'周'),colorred,linethick2;   
  15. DRAWTEXT(cross(kw,jw) and kw>55,jw,'周'),colorgreen,linethick2;   
  16.   
  17. RSm:=(CLOSE-LLV(LOW,40))/(HHV(HIGH,40)-LLV(LOW,40))*100;   
  18. Km:=SMA(RSm,5,1);   
  19. Dm:=SMA(Km,5,1);   
  20.   
  21. RSj:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*100;   
  22. Kj:=SMA(RSj,6,1);   
  23. Dj:=SMA(Kj,6,1);   
  24.   
  25. TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);   
  26. HD := HIGH-REF(HIGH,1);   
  27. LD := REF(LOW,1)-LOW;   
  28. DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),14);   
  29. DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);   
  30. {TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),7);   
  31. HD := HIGH-REF(HIGH,1);   
  32. LD := REF(LOW,1)-LOW;   
  33. DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),7);   
  34. DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),7);}   
  35. PDI:=DMP*100/TR;   
  36. MDI:=DMM*100/TR;   
  37. ADX: MA(ABS(MDI-PDI)/(MDI+PDI)*100,6),colorred,linethick2;   
  38.   
  39. TYP := (HIGH + LOW + CLOSE)/3;   
  40. cci:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));   
  41.   
  42. 买点0:=j+jw<68 and j>ref(j,1) and jw>ref(jw,1) and adx>28 and cci>ref(cci,1) and (cci<-90 or cci>90) and c>ref(c,1);   
  43. 买点1:=j>ref(j,1) and cci>ref(cci,1) and c>ref(c,1) and (ref(j,1)<5 or ref(cci,1)<-180);   
  44.   
  45. 买点:买点0 or 买点1;   
  46.   
  47. DIBU:=K<20 AND D<20 AND Kw<20 AND Dw<20;    
  48. STICKLINE(DIBU=1,100,80,1,0),COLORRED;    
  49. DIBU0:= Km<20 AND Dm<20 AND Kj<20 AND Dj<20;    
  50. STICKLINE(DIBU0=1,100,90,4,1),COLOR00008f;    
  51. TOBU:=K>80 AND D>80 AND Kw>80 AND Dw>80;    
  52. STICKLINE(TOBU=1,20,0,1,0),COLORGREEN;   
  53. TOBU0:=Km>80 AND Dm>80 AND Kj>80 AND Dj>80;    
  54. STICKLINE(TOBU0=1,10,0,4,1),COLOR008f00;   
  55.   
  56. ——:60,colorwhite,dotline;0,colorred,dotline;   
  57.   
  58. 100,colorgreen,dotline;   
  59. partline(j,j<5 and j>ref(j,1),rgb(255,0,0),(j<5 and j<ref(j,1)) or (j>95 and j>ref(j,1)),rgb(255,255,0),j>95 and j<ref(j,1),rgb(0,255,0)),linethick2;   
  60. partline(jw,jw<5 and jw>ref(jw,1),rgb(128,0,0),(jw<5 and jw<ref(jw,1)) or (jw>95 and jw>ref(jw,1)),rgb(128,128,0),jw>5 and jw<95 and j>ref(j,1) and jw>ref(jw,1),rgb(128,0,128)),linethick3;   
  61. partline(adx,adx>ref(adx,1) and adx>25 and mdi>pdi,rgb(0,255,0),   
  62.   adx<ref(adx,1) and adx>25 and mdi<pdi,rgb(0,255,0),   
  63.   adx<25,rgb(88,88,88)),linethick2;   
  64. DRAWICON(FILTER(mdi>ref(mdi,1) and mdi>25 and cci<-90 and adx>ref(adx,1) and c>o,3),adx*1.0,12);   
  65. STICKLINE(filter(买点,2),j+0,j+5,6,0),COLOR0000FF;   
  66. STICKLINE(filter(买点,2),j+5,j+10,3,0),COLORWHITE;   
  67. STICKLINE(filter(买点,2),j+10,j+15,1,0),COLORYELLOW;    

 



网站搜索:  



Copyright © 2009-2010 gszb.com ™,All Rights Reserved. 
公式网-www.gszx.com.cn-股票指标公式网