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:
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)
I don't understand the cum(1) function in the script and how or why it can be equal to e.g. 2. Doesn't cum(1) always simply return 1?
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
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
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
YW.

Agree on improving the signal.
+3 Reply
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
yw.
+2 Reply
Thanks for sharing!!!!!!! Very good indicator, appreciate it.
Reply
LazyBear PRO sudhir.mehta
yw.

Here's EUO capturing EURUSD down.

snapshot
+2 Reply
Thanks, Can not open it?
Reply
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
ประเทศไทย
Việt Nam
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out