|
|||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
| Special offer: buy MetaStock (try for free) | Reuters QuoteCenter Real-Time Data (get a free month) | EOD Data |
|
This month, we'll look back at Brian Bell's article "Normalization" from the October 2000 STOCKS & COMMODITIES. In his article, Bell defines four different techniques for normalizing oscillators. For this month's Traders' Tip, I have created an EasyLanguage function for normalizing oscillators, based on each normalization method described by Bell. The EasyLanguage functions given here have been written specifically so that they can easily be used with any oscillator. The oscillator value is simply specified as one of the input parameters for the function. Following the EasyLanguage for the different functions, I have also created a sample indicator that utilizes all four of the normalization functions and allows the user to specify the oscillator and the type of normalization to use. The first function to be created is one based on Bell's technique for normalizing to average price. This function has three input values. OscValue represents the value of the oscillator to be normalized. This input is included in each of the four functions. The NormPrice and NormLength inputs represent the price and length values used to calculate the average that is used in the normalization. Type: Function, Name: NormAvg Inputs: OscValue(Numeric), NormPrice(Numeric), NormLength(Numeric); Variable: AvgValue(0); AvgValue = Average(NormPrice, NormLength); If AvgValue <> 0 Then NormAvg = OscValue / AvgValue Else NormAvg = 0; The second function is for Bell's technique for normalizing to standard deviation of prices. This function also has three input values. I already described the OscValue input. The NormPrice and NormLength inputs represent the price and length values used to calculate the standard deviation that is used in the normalization. Type: Function, Name: NormStdDev Inputs: OscValue(Numeric), NormPrice(Numeric), NormLength(Numeric); Variable: StdDevVal(0); StdDevVal = StdDev(NormPrice, NormLength); If StdDevVal <> 0 Then NormStdDev = OscValue / StdDevVal Else NormStdDev = 0; The third function is for Bell's techniques for normalizing to average range of prices. Unlike the two previous functions, this function only has two inputs: the OscValue input, and the NormLength input, which represents the number of bars to use in the calculation of the average true range that is used in the normalization. Type: Function, Name: NormATR Inputs: OscValue(Numeric), NormLength(Numeric); Variable: ATR(0); ATR = AvgTrueRange(NormLength); If ATR <> 0 Then NormATR = OscValue / ATR Else NormATR = 0; The fourth function is for Bell's technique for normalizing to range. This function also has only two inputs: the OscValue input, and a NormLength input, which represents the number of bars to use for the historical range that is used in the normalization. Type: Function, Name: NormRange Inputs: OscValue(Numeric), NormLength(Numeric); Variable: HiHi(0), LoLo(0), HighLowDiff(0); HiHi = Highest(OscValue, NormLength); LoLo = Lowest(OscValue, NormLength); HighLowDiff = HiHi - LoLo; If HighLowDiff <> 0 Then NormRange = ((OscValue - LoLo) / HighLowDiff) * 100 Else NormRange = 0; Finally, here is the EasyLanguage for the sample indicator that ties together all of the functions that we just created. This indicator allows a user to specify an oscillator and the type of normalization they wish to use for that oscillator. The NormType input is used to determine the oscillator normalization method (1=Avg, 2=Std Deviation, 3=Avg True Rng, 4=Hist Range). The oscillator that will be normalized is specified in the OscValue input. Please note that the value of the NormPrice input will not affect the results when NormType 3 or 4 are selected, since neither of these calculations references the price value. NormLength should be increased significantly when doing a range normalization (NormType = 4). Also note that while this indicator integrates all four functions that we created, it is in no way the only way in which these functions can be utilized. It is simply an example. Type: Indicator, Name: Osc Normalization Inputs: NormType(1), OscValue(Momentum(Close, 10)), NormPrice(Close), NormLength(8); Variable: NormOsc(0); If NormType = 1 Then Begin NormOsc = NormAvg(OscValue, NormPrice, NormLength); Plot1(NormOsc, "Norm Osc"); Plot2(0, "Balance"); End; If NormType = 2 Then Begin NormOsc = NormStdDev(OscValue, NormPrice, NormLength); Plot1(NormOsc, "Norm Osc"); Plot2(0, "Balance"); End; If NormType = 3 Then Begin NormOsc = NormATR(OscValue, NormLength); Plot1(NormOsc, "Norm Osc"); Plot2(0, "Balance"); End; If NormType = 4 Then Begin NormOsc = NormRange(OscValue, NormLength); Plot1(NormOsc, "Norm Osc"); Plot2(50, "Balance"); End; The EasyLanguage for the normalized functions and sample indicator are available for download at Omega Research's Website. The filename is Normalize.ELS. -- Gaston Sanchez, Omega Research Inc. 800 422-8587, 305 270-1095 Internet: http://www.omegaresearch.com Code:
all formulas for TradeStation all formulas
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators and systems are submitted by anonymous users. Therefore S4T™ does not take any responsibility for it's quality. If you use any of this information, use it at your own risk. You are responsible for your own trading decisions. Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade. In no case will S4T™ be responsible for your trading gains or losses. |
||
|
||
|