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

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Donchian Channel
  4. //  Author/Uploader: R. Bertematto 
  5. //  E-mail:          
  6. //  Date/Time Added: 2003-06-09 22:58:40
  7. //  Origin:          
  8. //  Keywords:        donchian channel
  9. //  Level:           basic
  10. //  Flags:           indicator
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=285
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=285
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  This plots a Donchian Channel, similar to a Bollinger Band but based on
  17. //  highs and lows. Good for support/resistance.
  18. //
  19. //------------------------------------------------------------------------------
  20. // Plots a 20 period Donchian channel
  21. pds=20;
  22. DonchianUpper =HHV(Ref(H,-1),pds);
  23. DonchianLower = LLV(Ref(L,-1),pds);
  24. DonchianMiddle = (DonchianUpper+DonchianLower)/2;
  25. Plot(DonchianUpper,"DU",colorBlue,styleLine);
  26. Plot(DonchianMiddle,"DM",colorGreen,styleLine);
  27. Plot(DonchianLower,"DL",colorRed,styleLine);