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

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Heikin-Ashi HaDiffCO
  4. //  Author/Uploader: Brian 
  5. //  E-mail:          brianrichard99@hotmail.com
  6. //  Date/Time Added: 2006-03-30 18:54:54
  7. //  Origin:          Originally saw a version of this indicator in an issue of S&C magazine.
  8. //  Keywords:        HaDiffCO, Heikin-Ashi, Heikin Ashi
  9. //  Level:           basic
  10. //  Flags:           indicator
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=610
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=610
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  This is a modified version of the "Heikin-Ashi HaDiffCO," which is a
  17. //  "leading signal" oscillator. May be used with Bollinger or other bands to
  18. //  determine buy/cover or sell/short areas. I did not find much value in using
  19. //  the HaDiffCO with the Heikin-Ashi candlesticks. The HaDiffCO works well in
  20. //  any timeframe. Please post worthwhile modifications (some form of smoothing
  21. //  without drag, perhaps?) to this indicator if you come up with any. Thanks
  22. //  in advance.
  23. //
  24. //------------------------------------------------------------------------------
  25. _SECTION_BEGIN("D_Opt HaDiffCO");
  26. /* HaDiffCo for use with Heikin-Ashi Modified Candlestick Chart */
  27. HaClose=(O+H+L+C)/4;
  28. HaOpen=AMA(Ref(HaClose,-1),0.5);
  29. HaHigh=Max(H,Max(HaClose,HaOpen));
  30. HaLow=Min(L,Min(HaClose,HaOpen));
  31. HaDiffCO = HaClose-HaOpen;
  32. Per = Param("MA Periods",8,3,50,1);
  33. Plot(HaDiffCO,"HaDiffCO",colorWhite);
  34. Plot(WMA(HaDiffCO,5),"HaDiffCO",colorRed, styleDots);
  35. Plot(MA(HaDiffCO,per),"MA("+per+")",colorBlue,styleDots);
  36. // Plot Arrows
  37. Buy = Cross(WMA(HaDiffCO,5),MA(HaDiffCO,per));
  38. Short = Cross(MA(HaDiffCO,per),WMA(HaDiffCO,5));
  39. Title = "HaDiffCO";
  40. _SECTION_END();
  41. _SECTION_BEGIN("Bollinger Bands");
  42. P = ParamField("Price field",-1);
  43. Periods = Param("Periods", 15, 2, 100, 1 );
  44. Width = Param("Width", 2, 0, 10, 0.05 );
  45. Color = ParamColor("Color", colorCycle );
  46. Style = ParamStyle("Style");
  47. Plot( BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style ); 
  48. Plot( BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style ); 
  49. _SECTION_END();