LazyBear

Ehlers Universal Oscillator [LazyBear]

Universal Oscillator by Mr. Ehlers is an evolution of his SuperSmoother filter. The new indicator follows the swings in price without introducing extra delay.

It is controlled through one single input – the band edge – which basically is frequency. The smaller it is set, the less lag there is, but you may see lot of whipsaws. Built-in automatic gain control normalizes the output to vary between the range of -1 to +1.

Mr. Ehlers suggests a straightforward system:
- Buy when long-term Universal Oscillator crosses above zero
- Sell when long-term Universal Oscillator crosses below zero

I have added options to draw a signal line, histogram and bar coloring. Bar coloring, if enabled, is done using the histogram color, but you can change it easily to signal_cross by uncommenting a line (check the source).

More info:
Whiter is Brighter - Ehlers

List of my other indicators:
- GDoc: https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
- Chart:
Master Index: List of all my indicators

Remove from Favorite Scripts Add to Favorite Scripts
//
// @author LazyBear 
// List of all my indicators: 
// https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
//
study("Universal Oscillator [LazyBear]", shorttitle="UNIOSC_LB")
bandedge= input(20, title="BandEdge")
showHisto=input(true, type=bool, title="Show Histogram?")
showMA=input(false, type=bool, title="Show Signal?")
lengthMA=input(9, title="EMA signal length")
enableBarColors=input(false, title="Color Bars?")

whitenoise= (close - close[2])/2
a1= exp(-1.414 * 3.14159 / bandedge)
b1= 2.0*a1 * cos(1.414*180 /bandedge)
c2= b1
c3= -a1 * a1
c1= 1 - c2 - c3
filt= c1 * (whitenoise + nz(whitenoise[1]))/2 + c2*nz(filt[1]) + c3*nz(filt[2])
filt1= iff(cum(1) == 0, 0, iff(cum(1) == 2, c2*nz(filt1[1]),
	iff(cum(1) == 3, c2*nz(filt1[1]) + c3*nz(filt1[2]), filt)))

pk= iff(cum(1) == 2, .0000001,
	iff(abs(filt1) > nz(pk[1]), abs(filt1), 0.991 * nz(pk[1])))
denom= iff(pk==0, -1, pk)
euo=iff(denom == -1, nz(euo[1]), filt1/pk)
euoMA=ema(euo, lengthMA)
hline(0)
plot(showHisto ?euo:na, style=histogram, color=euo>0?green:red, title="Histogram")
plot(euo, color=maroon, linewidth=2, title="EUO")
plot(showMA?euoMA:na, color=teal, title="Signal", linewidth=1)
barcolor(enableBarColors?euo>0?green:red:na)
//Use this if signal cross should be used for barcoloring. 
//barcolor(enableBarColors?(euo>euoMA ? green : red):na)
List of my free indicators: http://bit.ly/1LQaPK8
List of my indicators at Appstore: http://blog.tradingview.com/?p=970

NextLevelFlash
2 years ago
All in all I don't really know what I'm doing but this is my favorite of your scripts so far. Using it alongside Squeeze Momentum Indicator & Weis Wave Volume to back up the crosses with this.
Reply
LazyBear PRO NextLevelFlash
2 years ago
Nice.
+1 Reply
I tried this script for btce and im not getting the green moving line that goes through 0. Do you know why? thx
Reply
LazyBear PRO Noobincrypt
2 years ago
MA line is OFF by default. Open up options dialog and enable it.
+2 Reply
Noobincrypt PRO LazyBear
2 years ago
thx
Reply
Alphaoptions
2 years ago
Thanks LB, I was just reading in S&C Magazine about this approach. Very timely!
Reply
LazyBear PRO Alphaoptions
2 years ago
YW.
+1 Reply
Hi LB: This is great. Better than his COG. Can you tell me why this is "whitenoise= (close - close)/2" You seem to be skipping a day. C instead of C? Thanks Michael
Reply
LazyBear PRO StockSwinger
2 years ago
Thanks. (C-C)/2 is how Ehlers has defined WhiteNoise in his TradeStation code.
+1 Reply
StockSwinger PRO LazyBear
2 years ago
Hi Lazy Bear: All of the bracketed numbers seem to have been stripped out of our conversation. Might be something that TV would want to look at.
Entering more here just to see if it gets stripped out again. C-C instead of C - C ?
Thanks for the reply, Michael
Reply
StockSwinger PRO StockSwinger
2 years ago
Yes! they are being stripped ;√( Michael
Reply
Thanks for sharing!!!!!!! Very good indicator, appreciate it.
Reply
LazyBear PRO sudhir.mehta
2 years ago
yw.

Here's EUO capturing EURUSD down.

snapshot
+2 Reply
sudhir.mehta PRO LazyBear
2 years ago
Thanks, Can not open it?
Reply
LazyBear PRO sudhir.mehta
2 years ago
You mean that chart image not opening?
+2 Reply
sudhir.mehta PRO LazyBear
2 years ago
Thanks for quick reply. I can not down load it. "Make it Mine" symbol does not show?
Reply
LazyBear PRO sudhir.mehta
2 years ago
That is just an embedded image of a chart. "Make it mine" possible only on published charts or on "embedded" charts (as in chat).
+2 Reply
sudhir.mehta PRO LazyBear
2 years ago
OK, Thanks, appreciate your time.
Reply
stenor PRO
2 years ago
This Universal Oscillator is the best oscillator that John Ehlers has constructed so far. In fact it may well be the only oscillator you really need. It really is that good and 'Universal'. I have used other oscillators giving similar signals to this one, but the Universal Oscillator overall does the best job of all the oscillators I have used. Thank you LazyBear for coding this great oscillator for the Trading View community.
+1 Reply
LazyBear PRO stenor
2 years ago
yw.
+2 Reply
AndrewFaulkner
2 years ago
Thanks. Maybe one could use a laguerre filter instead of an ma with a gamma as a TV variable and trade off the direction changes?
Reply
LazyBear PRO AndrewFaulkner
2 years ago
YW.

Agree on improving the signal.
+3 Reply
snapshot


I find Ehlers Universal Oscillator useful but the signals are short term unless a user can identify an overall trend. Here I offer a chart with several notations to help assist users. Please see chart notations. Not all "signals" or signs are noted. Focus on how I use the Zscore trend to filter trend, then use the UNIOSC_LB for trading purposes. Tradres could either scalps by enter/exit with each cross of UNIOSC signal or scale in for position trades.
+4 Reply
coondawg71 PRO coondawg71
2 years ago
snapshot


Of note: when overlapping indicators which I happen to do often, please check your Indicators "Properties" toggle for scaling as this is very necessary for proper indicator presentation. The default location for TV indicators is to scale on the right, when you attempt to overlap another indicator TV assumes you want the second indicator scale to be on the left so you may see the indicator readings. Please change the "scale left" on the second indicator to "scale right" so both indicators may align their respective Zero Lines together. Otherwise you with have improper readings. Now of course, not all indicators are scaled/measured in the same manner, indicator scales have to compliment one another. Hence my choosing Zscore which goes from Zero to a determined standard deviation of 2.0 in this instance set by me. And the UNIOSC_LB scales from Zero as well and within the Zscore readings up to 2.0. So for example, users cant put a WPR% with negative readings 0 to negative 100 on a scale of RSI as that reads in the oppostive manner 0 to 100. Just something to think about as screen real estate is important to some Charters.
+2 Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out