Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
We know the formula for the RMO Oscillator is EXACTLY the same as the Rainbow Oscillator that was first introduced tot he world in 1997 (see http://www.traders.com/Documentation/FEEDbk_docs/Archive/0897/TradersTips/Tips9708.html#anchor203073th it himself as the way it is presented in the TASC article and they way he has written the code is, line by line, identical - - coincidence? Personally, I don't believe so). OK. So what is the Rainbow Oscillator or the RMO? Lets look at the code first: Code:
100 *
(CLOSE - ((Mov(C,2,S) +
Mov(Mov(C,2,S),2,S) +
Mov(Mov(Mov(C,2,S),2,S),2,S) +
Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S) +
Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S) +
Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S) +
Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S) +
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S) +
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S) +
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)) / 10)) /
(HHV(C,10) - LLV(C,10))
Now it looks a little scary to some people when written like this so lets take the guts out of the program and store this in a variable and then see what the program looks like: Code:
MovingAverageExpression:=
Mov(C,2,S)+
Mov(Mov(C,2,S),2,S)+
Mov(Mov(Mov(C,2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S);
100 * (CLOSE - (MovingAverageExpresson/10)) / (HHV(C,10) - LLV(C,10))
So now what do we have? If you plot each 'element' of the MovingAverageExpression i.e. plot Mov(C,2,S) and Mov(Mov(c,2,S),2,S) and... etc you get series of short term moving averages, each is a moving average of a moving average (except the first). You will get ten lines on the plot, if you coloured each line a different colour you might get a rainbow effect, hence the original name of the oscillator. When you take a moving average you smooth out the data and introduce a slight lag, taking the moving average of a moving average smooths the curve of the first moving average and introduces another lag. By taking the MA of a MA of a MA (ten times) you have filtered a lot of the raw price action out and have are now lagging quite a bit behind the price action. What the code does then, is to take the numerical average of all the moving average elements (sum the ten MAs then divides by ten). If you were to plot this average as well as the 'rainbow' of MAs you will see the average line nestled in amongst the other MAs, nearly always centered in the plots. With this information, we could re-write the code again to reveal more about what is going on: Code:
MovingAverageExpression:=
Mov(C,2,S)+
Mov(Mov(C,2,S),2,S)+
Mov(Mov(Mov(C,2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S)+
Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C,2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S),2,S);
AverageOfMovingAverages:=MovingAverageExpression/10;
100 * (CLOSE - AverageOfMovingAverages) / (HHV(C,10) - LLV(C,10))
Focussing on the scalar multiplier of 100, we see all it does is to "stretch" the plot vertically (above and below zero). It is a commonly used method when trying to convert ratios into percentages. It adds little to the features of the plot, so for the moment, let's ignore it. Let's turn our attention to the numerator expression (HHV(C,10) - LLV(C,10)) This is measure of volatility. The result of this expression is ALWAYS greater than or equal to zero, the low is always less than or equal to the high so the expression will always be greater to or equal to zero. I guess the purpose of this expression is to make the resultant of the total expression larger when the volatility is low, and the resultant small when the volatiliy is higher. Bollinger bands have a similar principal, they encourage traders to buy when the volatility (measured using standard deviations) is small. This has never sat well with me. I have never seen a rule listed in any Exchange that says if the volatility of a particular stock is small then traders must do something about this and drive the price up to increase the volatility. This sort of logic is like saying it is not raining today so it must rain tomorrow! Anyway, all the numerator expression is doing here is to vertically stretch the resultant expression when the volatility is low; the resultant is stretched above and below zero. Incidentally, a real programmer or a mechanical trader would have handled the instances when the HHV(C,10) and LLV(C,10) were the same value (i.e the volatility is zero (the stock closed at the same price for ten consecutive bars)) This again makes me wonder whether the 'author' did re-create the function because the divide-by-zero error potential was never fixed from the original Rainbow Oscillator. So what are we left with? Code:
CLOSE - AverageOfMovingAverages
In the employment of this section of the expression, we are looking to find whether the expression is greater than or less than zero. If the resultant is greater than zero, it means the CLOSE is greater than the AverageOfMovingAverages, if the resultant is negative it means the AverageOfMovingAverages is greater then the CLOSE. All the expression is doing is monitoring which value is greatest. Another way to write this is: CLOSE > AverageOfMovingAverages At this point in time, it might be interesting to note that the AverageOfMovingAverages (the mathematical average of the ten 2 bar SMAs) is ALMOST the same as a much more simple expression, Mov(C,6,S). If you compare the PRECISE VALUES of the AverageOfMovingAverages and the Mov(C,6,S) there is always a small difference, but, if you compare the instances when the CLOSE crosses the AverageOfMovingAverages and the instances when the CLOSE crosses the Mov(C,6,S) they are the same, with about 3-4% error. If you apply one bar latitude in either direction, the two expressions are the same within 1%. Thefore, for testing when the CLOSE crosses the AverageOfMovingAverages the trader could easily substitute Mov(C,6,S) for the more complicated expression. In summary, if you are going to ignore the "height" of the Rainbow Oscillator or the RMO and only deal with the instances when it crosses the zero line, you might as well use Cross(C, Mov(C,6,S)) instead! A summary of my summary, the RMO is nothing but a MA crossover system. Now that we know a little more about how the Rainbow Oscillator works, we can consider a little more about the height of the oscillator? (Simply, the height of the oscillator is the distance between the CLOSE and the MA, divided by the volatility). Do with this information what you need to! Hope this helps. wabbit [:D]
|