The D_oscillator.afl
上传用户:shiqiang
上传日期:2009-06-12
资源大小:1289k
文件大小:2k
源码类别:

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    The D_oscillator
  4. //  Author/Uploader: Dimitris Tsokakis 
  5. //  E-mail:          tsokakis@oneway.gr
  6. //  Date/Time Added: 2003-06-30 04:12:16
  7. //  Origin:          
  8. //  Keywords:        
  9. //  Level:           medium
  10. //  Flags:           system,indicator
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=289
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=289
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  The body of a candle C-O is divided by H+L to create a body to size ratio.
  17. //  To avoid any noise apply repetitive DEMA smoothing. Finally apply the RSI
  18. //  transformation to create the D_oscillator. The ^NDX OHLC data are used to
  19. //  produce Buy/Sell signals with interesting results for US stocks and the
  20. //  main European indexes. Equity curves seem to be independent of
  21. //  bullish/bearish environment. See also
  22. //
  23. //  http://groups.yahoo.com/group/amibroker/message/43405
  24. //
  25. //------------------------------------------------------------------------------
  26. // The D_oscillator and its application, by D. Tsokakis, June 2003
  27. O=Foreign("^NDX","O");
  28. H=Foreign("^NDX","H");
  29. L=Foreign("^NDX","L");
  30. C=Foreign("^NDX","C");
  31. t0=10;
  32. R0=DEMA((C-O)/(H+L),t0);
  33. R0=DEMA(R0,T0);
  34. R0=DEMA(R0,T0);
  35. R0=DEMA(R0,T0);
  36. R0=DEMA(R0,T0);
  37. R0=DEMA(R0,T0);
  38. R0=DEMA(R0,T0);
  39. R0=DEMA(R0,T0);
  40. R0=DEMA(R0,T0) ;
  41. R0=DEMA(R0,T0) ;
  42. D_oscillator=RSIA(R0,2*T0);
  43. X=30;Y=Optimize("Y",75,60,80,5);
  44. Buy=Cross(D_oscillator,X);Sell=Cross(D_oscillator,Y);
  45. Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
  46. // STOP=Optimize("STOP",20,20,100,20);ApplyStop(0,1,STOP,1);
  47. Plot(D_oscillator,"",1,1);Plot(30,"",8,1);Plot(75,"",8,1);
  48. Title=Name()+", D_oscillator = "+WriteVal(D_oscillator,1.2);
  49.