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

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Market Direction
  4. //  Author/Uploader: Dimitris Tsokakis 
  5. //  E-mail:          
  6. //  Date/Time Added: 2002-03-24 14:03:12
  7. //  Origin:          
  8. //  Keywords:        
  9. //  Level:           advanced
  10. //  Flags:           indicator
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=176
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=176
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  Market direction is described through 3 composite tickers, based on
  17. //  Relative slope values. You may read on daily basis the % distribution of
  18. //  bullish, congestive and bearish phase of the Market.
  19. //
  20. //------------------------------------------------------------------------------
  21. /*BULL-BEAR-CONGESTIVE*/
  22. K=EMA((H+L+C)/3,10);
  23. S1=2*(K-Ref(K,-1))/(K+Ref(K,-1));
  24. RS=100*EMA(S1,3);
  25. values16 = abs(rs)<=1;
  26. values17=rs>1;
  27. values18=rs<-1;
  28. AddToComposite(Values16,"~rscongestion","V");
  29. AddToComposite(Values17,"~rsbullish","V");
  30. AddToComposite(Values18,"~rsbearish","V");
  31. Buy=0;