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

金融证券系统

开发平台:

Others

  1. //------------------------------------------------------------------------------
  2. //
  3. //  Formula Name:    Rainbow Oscillator
  4. //  Author/Uploader: Anthony Faragasso 
  5. //  E-mail:          ajf1111@epix.net
  6. //  Date/Time Added: 2001-08-13 21:42:30
  7. //  Origin:          July 1997 TASC Traders Tips
  8. //  Keywords:        
  9. //  Level:           medium
  10. //  Flags:           indicator
  11. //  Formula URL:     http://www.amibroker.com/library/formula.php?id=101
  12. //  Details URL:     http://www.amibroker.com/library/detail.php?id=101
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  Very Good Visual with colored bars .
  17. //
  18. //  Imediately Identify Underlying Trend Of the Market.
  19. //
  20. //------------------------------------------------------------------------------
  21. /* Rainbow Oscillator */
  22. /* July 1997 TASC Traders Tips*/
  23. /* Coded by Anthony Faragasso */
  24. maxgraph =16;
  25. avg1= Max (Ma(C,2),
  26.            Max (Ma(Ma(C,2),2),
  27.            Max (Ma(Ma(Ma(C,2),2),2),
  28.            Max (Ma(Ma(Ma(Ma(C,2),2),2),2),
  29.            Max(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),
  30.            Max(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),
  31.            Max(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),
  32.            Max(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),
  33.            Max(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),
  34.            Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),2))))))))));;;;;;;;;
  35.        
  36. avg2 = Min(Ma(C,2),
  37.             Min(Ma(Ma(C,2),2),
  38.             Min(Ma(Ma(Ma(C,2),2),2),
  39.             Min(Ma(Ma(Ma(Ma(C,2),2),2),2),
  40.             Min(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),
  41.             Min(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),
  42.             Min(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),
  43.             Min(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),
  44.             Min(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),
  45.             Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),2))))))))));;;;;;;;;;
  46.                /*     Rainbow Oscillator */
  47.   graph0 =   100 * (CLOSE - ((Ma(C,2)+
  48.                     Ma(Ma(C,2),2)+
  49.                     Ma(Ma(Ma(C,2),2),2) + Ma(Ma(Ma(Ma(C,2),2),2),2) +
  50.                     Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2) +
  51.                     Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2) + 
  52.                     Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2)+
  53.                     Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2)+
  54.                     Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2)+
  55.                     Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),2))
  56.                     /10))/(HHV(C,10)-LLV(C,10));
  57.                      
  58.                 /*  Lower Rainbow Band */
  59. graph1 = -100  *( avg1 - avg2) /
  60.                     (HHV(C,10) - LLV(C,10));
  61.                /*     Upper Rainbow Band */
  62. graph2 =  100 * (avg1 - avg2) /
  63.                     (HHV(C,10) - LLV(C,10));
  64. graph0style = 3;
  65. graph2style = graph1style = 1;
  66. graph2color = graph1color =3;
  67. graph3 = 0;
  68. graph3color =8;
  69. downbar =graph0 <ref( graph3,-1);
  70. upbar = graph0 > ref(graph3,-1);
  71. barcolor = IIF( downbar,4, IIF( upbar, 6, 0 )  );
  72. graph0barcolor = ValueWhen( barcolor != 0, barcolor );
  73. title = name() +" Rainbow Oscillator : "+writeval(graph0,format=1.2) +" % ";