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: docs.google.com...ByMEvm5MLo/edit?usp=sharin...
- Chart:

List of my free indicators: bit.ly/1LQaPK8
List of my indicators at Appstore: blog.tradingview.com/?p=970
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย 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)