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

金融证券系统

开发平台:

Others

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