Directional Oscillator
Creating a useful directional oscillator
Have you ever looked for an indicator that could provide you with a broad indication of price direction? Well, here’s a nifty little indicator that could help.
It’s very similar to MACD but tends to suffer fewer whipsaws in flatter corrections. The basic concept behind the MACD indicator is instead of using the crossover signals of two moving averages to base signals, it assigns one (exponential) moving average to represent price and a second, longer (exponential) moving average to represent the underlying direction of price.
The problem with just using the crossovers of two moving averages is that the signals can come very late and much of the directional move can be complete when the signal is finally generated.
The MACD, by measuring the width between the averages, is more sensitive to how fast the averages are moving apart (divergence) and also how quickly they are moving together (convergence.)
The drawback of MACD is that it can be so responsive to changes in direction that it can provide a signal too quickly.
The challenge is therefore to devise an oscillator that will remain responsive but avoids some of the premature signals.
Therefore, what I did was use a linear regression average. While all averages have a lag due to the look back period the linear regression average tends to remove some of the lag and move closer with price itself.
What we could do as an indication is merely take the close price and deduct the value of the linear regression average. However, as you can see from the following image it produces a rather choppy result from which signals are not obvious or even useful.

Therefore the challenge was to provide a signal that was more a reflection of the underlying direction. To achieve this I took an average of the linear regression average but to retain sensitivity I used and exponential moving average that gives more weighting to recent values. I used the same period for the exponential moving average as I did for the linear regression average.
Then to avoid whipsaws from price I used a 10 period linear regression average of price. Now, the result is far more useful…
Basically using the crossover of the oscillator through the zero equilibrium line we can generate signals. Very clearly such simple signals are rather raw and we should at least use some basic common sense.
For example, to the middle right of the chart we can see a period of consolidation that caused the oscillator to drop below zero and then recover. When seeing this we should remember that using indicators blindly can make us ignore very simple rules.
We can see that price is consolidating and in these situations it is far wiser to trade on breaks. If price had fallen to break below the first corrective low then it would have been a stronger signal. Until that occurs we can still see that both highs are rising and lows are rising which indicates a potential uptrend.
We may choose to square a long position and then renter once a stronger signal has been generated. If the general trend in a larger time frame (this chart is hourly) we could choose to remain in the position. In this situation it would have paid off.
This Directional Oscillator may be added to your Dealbook charts through the Chart Studio.
Open this Chart Studio and then open a new technique. Cut and paste the following into the area that appears:
Indicator Directional_Oscillator ;
input Period = 34 ;
draw DOsc("DO"), Equil("Equilibrium");
vars f(number), b(number), Res(series), i(number), Avg(series) ;
begin
f := front(close);
b := back(close);
Equil := makeseries(f, b, 0) ;
Avg := LinReg(Close,Period) ;
DOsc := LinReg(Close,10) - ema(Avg,period) ;
end.
Following this select “Build” and select “Verify Module” from the top menu bar
You will be prompted to enter a name for this analysis technique. Write in “Directional Oscillator.”
The Select “Build” again and this time you should see this succeed in the output window at the bottom of the studio.
Then select “Build” again but this time choose “Install Module”
The module will be installed into the User Modules.
You will now be able to access Directional Oscillator in the charting application via the “set Up Indicators” icon at the top of the chart.
Good luck.
Ian Copsey
See Also
- Pro Commentary
Probably the most comprehensive technical report in the market
This entry was posted on Friday, May 16th, 2008 at 8:09 and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply
Forex Forum
- cable: Gbp/usd
Sep 7, 23:35 GMT - Arnaud Jeulin: Trading Ideas - Non-farm Payrolls, Average Hourly Earning, Unemployment Rate - Sept 5th
Sep 5, 10:26 GMT - Arnaud Jeulin: Trading Ideas - Boe And Ecb Interest Rate Decision, Ecb Trichet's Speech - Sept 4th
Sep 4, 5:56 GMT - Arnaud Jeulin: Trading Ideas - Boc (canada) Interest Rate Announcement, Fed's Beige Book, Gross Domestic Product - Sept 3rd
Sep 3, 6:40 GMT - razor: Where To Get Ohcl Price ?
Sep 3, 3:15 GMT - Arnaud Jeulin: Trading Ideas - Rba Interest Rate Decision, Consumer Price Index, Ism Manufacturing - September 2nd
Sep 2, 6:21 GMT - Erbe: How Long Are The Analysis Valid For?
Sep 1, 13:19 GMT - Arnaud Jeulin: Could You Please Explain How Your Trading System Works?
Sep 1, 12:54 GMT - Arnaud Jeulin: What Is Your Previous Trading History Like?
Sep 1, 12:43 GMT - Arnaud Jeulin: Trading Ideas - M4 Sterling Lending, Purchasing Manager Index Manufacturing - Sept 1st
Sep 1, 6:36 GMT
- jctrader: Conférence : Vivre De La Bourse Par Romain Delacretaz
Sep 7, 19:49 GMT - stratif: Les Clés De La Réussite En Trading
Sep 7, 19:47 GMT - christopher@forex.fr: Bilan De La Semaine
Sep 6, 19:44 GMT - jctrader: le trading, perdre ou gagner...
Sep 6, 6:00 GMT - Arnaud Jeulin: Rencontre De Traders À Lyon
Sep 5, 16:33 GMT - Arnaud Jeulin: Vous Ne Savez Que Faire De Votre Argent ?
Sep 5, 15:08 GMT - jctrader: Tokiwa Investments Inc
Sep 5, 12:20 GMT - Arnaud Jeulin: Correlation
Sep 5, 7:23 GMT - graphfx: Idée De Trade Graphfx: 03/09/2008
Sep 4, 23:09 GMT - cacman Forex: Rsi Et Mm Mt4
Sep 4, 20:38 GMT
Latest technical analysis
- EUR/USD - Euro Dollar
Sep 5, 10:25 GMT - GBP/USD - British Pound Dollar
Sep 5, 10:23 GMT - USD/CAD - US Dollar Canadian Dollar
Sep 5, 10:20 GMT - USD/CHF - Dollar Swiss Franc
Sep 5, 10:16 GMT - USD/JPY - Dollar Yen
Sep 5, 10:12 GMT - GBP/JPY - British Pound Yen
Sep 5, 10:10 GMT - EUR/JPY - Euro Yen
Sep 5, 10:05 GMT - EUR/GBP - Euro British Pound
Sep 5, 10:02 GMT - EUR/CHF - Euro Swiss Franc
Sep 5, 9:58 GMT - EUR/CAD - Euro Canadian Dollar
Sep 5, 9:55 GMT - EUR/AUD - Euro Australian Dollar
Sep 5, 9:51 GMT - AUD/USD - Australian Dollar US Dollar
Sep 5, 9:46 GMT

