Nonlinear Ehlers Filter.afl
上传用户:shiqiang
上传日期:2009-06-12
资源大小:1289k
文件大小:1k
源码类别:

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Nonlinear Ehlers Filter
  4. //  Author/Uploader: Chris Yeoh 
  5. //  E-mail:          turkey@kingdomwork.net
  6. //  Date/Time Added: 2004-11-14 23:52:20
  7. //  Origin:          
  8. //  Keywords:        Ehler
  9. //  Level:           medium
  10. //  Flags:           indicator
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=403
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=403
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  Taken from TASC's April 2001 Issue.
  17. //
  18. //------------------------------------------------------------------------------
  19. Price = (H+L)/2;
  20. MomLength = 15;
  21. PriceMomSum = 0;
  22. FiveMomSum = 0;
  23. FiveMom = abs(Price - Ref(Price, -5));
  24. PriceMom = Price * FiveMom;
  25. for (i=0; i < MomLength; i++) {
  26. PriceMomSum = PriceMomSum + Ref(PriceMom, -i);
  27. FiveMomSum = FiveMomSum + Ref(FiveMom, -i);
  28. }
  29. NLEF = PriceMomSum / FiveMomSum;
  30. Plot(Close, "Close", colorBlack, styleLine);
  31. Plot(NLEF, "NonLinear Ehlers Filter", IIf(Close>NLEF, colorGreen, colorRed), styleLine);