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

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Dahl Oscillator modified
  4. //  Author/Uploader: Hans 
  5. //  E-mail:          
  6. //  Date/Time Added: 2004-09-18 03:24:24
  7. //  Origin:          
  8. //  Keywords:        Dahl Oscillator
  9. //  Level:           basic
  10. //  Flags:           system,indicator
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=380
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=380
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  Modified formula from original DAHL(55) with 14 simple average. Used TEMA
  17. //  instead of simple MA, added parameters and optimization. Good also for
  18. //  trading system (as indicator to be used with 10 and 90 levels also)..
  19. //
  20. //------------------------------------------------------------------------------
  21. /*Dahl Oscillator TS modificato (TEMA)
  22. */ 
  23. P=14;Q=34;R=9;AV=6;
  24. p = Optimize("Period",P,3,25,1); 
  25. q = Optimize("Q ",Q,20,36,2); 
  26. //r = Optimize("R lookback",R,5,25,1); 
  27. Av = Optimize("S Average",AV,2,30,2); 
  28. M=MA(C,q);
  29. Dahl = TEMA( ( M - Ref(M,-p)- LLV (M - Ref(M,-p),r) )/(HHV(M - Ref(M,-p),r)-(LLV(M - Ref(M,-p),r))),r)*100 ;
  30. Buy = Cover = Cross (dahl, MA(Dahl,av));
  31. Short = Sell = Cross (MA(Dahl,av), dahl);
  32. GraphXSpace=2;
  33. Plot(Dahl,"Dahl",4,4); 
  34. Plot(MA(Dahl,av),"Avg",7,4); 
  35. //===========================end Dahl oscillator