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

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Weighted Index
  4. //  Author/Uploader: Gerard 
  5. //  E-mail:          gerard_kellett@optusnet.com.au
  6. //  Date/Time Added: 2005-09-08 04:06:39
  7. //  Origin:          
  8. //  Keywords:        Weighted Index AddToComposite
  9. //  Level:           basic
  10. //  Flags:           exploration
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=553
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=553
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  Creates a weighted index based on a group of tickers using the
  17. //  AddToComposite function.
  18. //
  19. //------------------------------------------------------------------------------
  20. //Select a group of tickers i.e. Apply to/Use Filter/Define - choose a watchlist
  21. //Click on Scan to create your new index
  22. AddToComposite((Close*Volume),  "~GMarketIndx", "Avg",atcFlagResetValues = 1);
  23. AddToComposite(Open*((Close*Volume)/Foreign("~GMarketIndx", "Avg")),"~GMarketIndx", "O",atcFlagResetValues = 1);  
  24. AddToComposite(High*((Close*Volume)/Foreign("~GMarketIndx","Avg")),"~GMarketIndx", "H",atcFlagResetValues = 1);   
  25. AddToComposite(Low*((Close*Volume)/Foreign("~GMarketIndx","Avg")),"~GMarketIndx", "L",atcFlagResetValues = 1);   
  26. AddToComposite(Close *((Close*Volume)/Foreign("~GMarketIndx","Avg")),"~GMarketIndx", "C",atcFlagResetValues = 1); 
  27. AddToComposite(Volume*((Close*Volume)/Foreign("~GMarketIndx","Avg")),"~GMarketIndx", "V",atcFlagResetValues = 1);   
  28. Buy = 0; // required by scan mode