一个更精度的平滑涵数, 可用于股票交易系统.用于Amibroker 平台

源代码在线查看: rainbow oscillator.afl

软件大小: 1290 K
上传用户: myc
关键词: Amibroker 精度 股票
下载地址: 免注册下载 普通下载 VIP

相关代码

				//------------------------------------------------------------------------------
				//
				//  Formula Name:    Rainbow Oscillator
				//  Author/Uploader: Anthony Faragasso 
				//  E-mail:          ajf1111@epix.net
				//  Date/Time Added: 2001-08-13 21:42:30
				//  Origin:          July 1997 TASC Traders Tips
				//  Keywords:        
				//  Level:           medium
				//  Flags:           indicator
				//  Formula URL:     http://www.amibroker.com/library/formula.php?id=101
				//  Details URL:     http://www.amibroker.com/library/detail.php?id=101
				//
				//------------------------------------------------------------------------------
				//
				//  Very Good Visual with colored bars .
				//
				//  Imediately Identify Underlying Trend Of the Market.
				//
				//------------------------------------------------------------------------------
				
				/* Rainbow Oscillator */
				/* July 1997 TASC Traders Tips*/
				/* Coded by Anthony Faragasso */
				
				maxgraph =16;
				
				avg1= Max (Ma(C,2),
				           Max (Ma(Ma(C,2),2),
				           Max (Ma(Ma(Ma(C,2),2),2),
				           Max (Ma(Ma(Ma(Ma(C,2),2),2),2),
				           Max(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),
				           Max(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),
				           Max(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),
				           Max(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),
				           Max(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),
				           Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),2))))))))));;;;;;;;;
				       
				
				
				avg2 = Min(Ma(C,2),
				            Min(Ma(Ma(C,2),2),
				            Min(Ma(Ma(Ma(C,2),2),2),
				            Min(Ma(Ma(Ma(Ma(C,2),2),2),2),
				            Min(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),
				            Min(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),
				            Min(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),
				            Min(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),
				            Min(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),
				            Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),2))))))))));;;;;;;;;;
				
				               /*     Rainbow Oscillator */
				
				  graph0 =   100 * (CLOSE - ((Ma(C,2)+
				                    Ma(Ma(C,2),2)+
				                    Ma(Ma(Ma(C,2),2),2) + Ma(Ma(Ma(Ma(C,2),2),2),2) +
				                    Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2) +
				                    Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2) + 
				                    Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2)+
				                    Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2)+
				                    Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2)+
				                    Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(Ma(C,2),2),2),2),2),2),2),2),2),2))
				                    /10))/(HHV(C,10)-LLV(C,10));
				
				                     
				
				                /*  Lower Rainbow Band */
				
				graph1 = -100  *( avg1 - avg2) /
				                    (HHV(C,10) - LLV(C,10));
				
				               /*     Upper Rainbow Band */
				
				graph2 =  100 * (avg1 - avg2) /
				                    (HHV(C,10) - LLV(C,10));
				
				graph0style = 3;
				graph2style = graph1style = 1;
				graph2color = graph1color =3;
				graph3 = 0;
				graph3color =8;
				
				downbar =graph0 				upbar = graph0 > ref(graph3,-1);
				barcolor = IIF( downbar,4, IIF( upbar, 6, 0 )  );
				graph0barcolor = ValueWhen( barcolor != 0, barcolor );
				
				
				title = name() +" Rainbow Oscillator : "+writeval(graph0,format=1.2) +" % ";			

相关资源