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

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Dinapoli Guru Commentary
  4. //  Author/Uploader: Grayesso 
  5. //  E-mail:          grayesso@rambler.ru
  6. //  Date/Time Added: 2003-12-10 14:06:39
  7. //  Origin:          
  8. //  Keywords:        
  9. //  Level:           basic
  10. //  Flags:           commentary
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=311
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=311
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  Dinapoli Guru Commentari + MACD optimise + Stochastic optimise = Trade
  17. //  system
  18. //
  19. //------------------------------------------------------------------------------
  20. /* Project:       AmiBroker
  21. ** File:          Dinapoli.afl
  22. ** Title:         Dinapoli Guru Commentary (Trading with DiNapoli Levels,chapter 5)
  23. ** Date:          Dec 8th, 2003
  24. ** Written by:    Grayesso (grayesso dog rambler dot ru)
  25. */ 
  26. /* MACD (fa,sa,sig) , where: fa - fast avg., sa - slow avg., sig - signal
  27.  (it is necessary to install in preferences [Preferences - Indicators]) */
  28. fa = Prefs( 11 );
  29. sa = Prefs( 12 );
  30. sig = Prefs( 13 );
  31. /* Stochastic (range, Ksmooth, Dsmooth) 
  32. range - to install in preferences [Preferences - Indicators]*/
  33. range = Prefs(14);
  34. /* Attention!!! 
  35. Ksmooth and Dsmooth - to install here and now, in preferences uselessly to change */
  36. Ksmooth=3;
  37. Dsmooth=3;
  38. Buy=Cross(StochK (range,Ksmooth), StochD(range,Ksmooth,Dsmooth)) AND (MACD(fa,sa)>Signal(fa,sa,sig)) OR Cross(MACD(fa,sa),Signal(fa,sa,sig)) ;
  39. Sell = Cross(StochD(range,Ksmooth,Dsmooth), StochK(range,Ksmooth)) AND (MACD(fa,sa)< Signal (fa,sa,sig)) OR Cross(Signal(fa,sa,sig),MACD(fa,sa));
  40. "n Review of    " + FullName() + " (" + Name() + ")" + "n as of            " + Date();
  41. "n MACD:          (" + Prefs(11)+","+Prefs(12)+","+Prefs(13)+")";
  42. " Stochastic:    (" + Prefs(14)+","+Ksmooth+","+Dsmooth+")";
  43. "n Current Statistics :n";
  44. " Close:              " + WriteVal(Close);
  45. " Change:          " + WriteVal(Close - Ref( Close, -1 ) ) ;
  46. "n MACD Value:  " + WriteVal(MACD(fa,sa));
  47. " Signal Line:     " + WriteVal(Signal(fa,sa,sig));
  48. "n Stochastic %K  "+WriteVal (StochK(range,Ksmooth));
  49. " Stochastic %D  "+WriteVal (StochD(range,Ksmooth, Dsmooth ));