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/15AGC...
- Chart:
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,因此交易者可以理解和验证它。为作者加油! 您可以免费使用它,但是在发布中重复使用此代码受网站规则的约束。您可以收藏它以在图表上使用。

想在图表上使用此脚本?
//
// @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

评论



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.
+7 回复
cooney_s cooney_s


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.
+4 回复
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.
+2 回复
LazyBear stenor
yw.
+2 回复
Your cos function should be in radians, not in degrees in line 15. @mwlang has fixed it.
回复
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?
回复
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?
回复
LazyBear AndrewFaulkner
YW.

Agree on improving the signal.
+3 回复
Thanks for sharing!!!!!!! Very good indicator, appreciate it.
回复
LazyBear sudhir.mehta
yw.

Here's EUO capturing EURUSD down.

+2 回复