Chande's Trend Score.afl
上传用户:shiqiang
上传日期:2009-06-12
资源大小:1289k
文件大小:1k
源码类别:

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Chande's Trend Score
  4. //  Author/Uploader: Ben Letto 
  5. //  E-mail:          
  6. //  Date/Time Added: 2005-03-04 13:42:00
  7. //  Origin:          
  8. //  Keywords:        Chande Trend Score
  9. //  Level:           medium
  10. //  Flags:           indicator
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=436
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=436
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  I just found this code in a Visual Trader site and transfered it into AFL.
  17. //
  18. //------------------------------------------------------------------------------
  19. SmoothingPeriod = 5;
  20. CTS=IIf(C>=Ref(C,-11),1,-1)+IIf(C>=Ref(C,-12),1,-1)+IIf(C>=Ref(C,-13),1,-1)+IIf(C>=Ref(C,-14),1,-1)+IIf(C>=Ref(C,-15),1,-1)+IIf(C>=Ref(C,-16),1,-1)+IIf(C>=Ref(C,-17),1,-1)+IIf(C>=Ref(C,-18),1,-1)+IIf(C>=Ref(C,-19),1,-1)+IIf(C>=Ref(C,-20),1,-1);
  21. CTSM = WMA(CTS,SmoothingPeriod);
  22. Histo = IIf(CTSM==10,5,IIf(CTS==-10,-5,Null)); 
  23. Plot(CTSM, "CTSM", colorBlack, styleLine );
  24. Plot(Histo, "", colorGreen, styleHistogram );
  25. Plot(12,"",colorRed,styleLine);
  26. Plot(-12,"",colorRed,styleLine);