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

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Stochastic of Weekly Price Array
  4. //  Author/Uploader: Anthony Faragasso 
  5. //  E-mail:          ajf1111@epix.net
  6. //  Date/Time Added: 2002-09-21 20:03:31
  7. //  Origin:          
  8. //  Keywords:        
  9. //  Level:           medium
  10. //  Flags:           indicator
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=225
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=225
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  Plot the Stochastic of Weekly Price array , while staying in
  17. //
  18. //  Daily mode.
  19. //
  20. //------------------------------------------------------------------------------
  21. //Stochastic of Weekly Price Array
  22. //Coded by Anthony Faragasso
  23. //Ver. 1.01 Update#1
  24. //Credit to Tomasz for some help
  25. weekstart = DayOfWeek() < Ref( DayOfWeek(), -1 );
  26. weekend = DayOfWeek() > Ref( DayOfWeek(),1);
  27. /**Establish Weekly Price arrays**/
  28. WeeklyOpen=ValueWhen(DayOfWeek()< Ref(DayOfWeek(),-1) ,Open);
  29. WeeklyHigh = ValueWhen( weekend, HighestSince( weekstart, High ) );
  30. WeeklyLow = ValueWhen( weekend, LowestSince( weekstart, Low ) );
  31. WeeklyClose=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1),Close);
  32. WeeklyVolume=ValueWhen(DayOfWeek() > Ref(DayOfWeek(),1),Sum(V,5));
  33. /***Stochastic of Weekly Price Array***/
  34. t=3;//Slowing Variable
  35. StochWeekly=(Sum((weeklyclose-weeklylow),t)/Sum((weeklyhigh-weeklylow),t))*100;
  36. Plot(Stochweekly,EncodeColor(colorBlack)+"Stoch_Weekly",colorRed,styleLine);
  37. Plot(EMA(Stochweekly,3),EncodeColor(colorBlue)+"Signal",colorBlue,styleLine);