LazyBear

Cycle Channel Oscillator [LazyBear]

Here's an oscillator derived from my previous script, Cycle Channel Clone (www.tradingview.com/v/QmgtSIj5/).

There are 2 oscillator plots - fast & slow. Fast plot shows the price location with in the medium term channel, while slow plot shows the location of short term midline of cycle channel with respect to medium term channel.

Usage of this is similar to %b oscillator. The slow plot can be considered as the signal line.

Bar colors can be enabled via options page. When short plot is above 1.0 or below 0, they are marked purple (both histo and the bar color) to highlight the extreme condition.

This makes use of the default 10/30 values of Cycle Channel, but may need tuning for your instrument.

More info:

List of my free indicators: bit.ly/1LQaPK8
List of my app-store indicators: blog.tradingview.com/?p=970 (More info: bit.ly/lazybeardoc)

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 my public indicators: http://bit.ly/1LQaPK8
// List of my app-store indicators: http://blog.tradingview.com/?p=970 
//
study("Hurst Cycle Channel Clone Oscillator [LazyBear]", shorttitle="HCCCO_LB", overlay=false)
scl_t =  input(10, title="Short Cycle Length?")
mcl_t =  input(30, title="Medium Cycle Length?")
scm =  input(1.0, title="Short Cycle Multiplier?")
mcm =  input(3.0, title="Medium Cycle Multiplier?")
src=input(close, title="Source")
scl = scl_t/2, mcl = mcl_t/2
ma_scl=rma(src,scl)
ma_mcl=rma(src,mcl)
scm_off = scm*atr(scl)
mcm_off = mcm*atr(mcl)
scl_2=scl/2, mcl_2=mcl/2
sct =  nz(ma_scl[scl_2], src)+ scm_off
scb =  nz(ma_scl[scl_2], src)- scm_off
mct =  nz(ma_mcl[mcl_2], src)+ mcm_off
mcb =  nz(ma_mcl[mcl_2], src)- mcm_off
scmm=avg(sct,scb)
ul=plot(1.0, title="UpperLine", color=gray), ml=plot(0.5, title="MidLine", color=gray), ll=plot(0.0, title="LowerLine", color=gray)
fill(ll,ml,color=red), fill(ul,ml,color=green)
omed=(scmm-mcb)/(mct-mcb)
oshort=(src-mcb)/(mct-mcb)
plot(omed>=1.0?omed:na, histbase=1.0, style=histogram, color=purple, linewidth=2, title="MediumCycleOB")
plot(omed<=0.0?omed:na, histbase=0.0, style=histogram, color=purple, linewidth=2, title="MediumCycleOS")
plot(oshort>=1.0?oshort:na, histbase=1.0, style=histogram, color=purple, linewidth=2, title="ShortCycleOB")
plot(oshort<=0.0?oshort:na, histbase=0.0, style=histogram, color=purple, linewidth=2, title="ShortCycleOS")
plot(oshort, color=red, linewidth=2, title="FastOsc")
plot(omed, color=green, linewidth=2, title="SlowOsc")
ebc=input(false, title="Enable bar colors")
bc=(oshort>0.5)?(oshort>1.0?purple:(oshort>omed?lime:green)):(oshort<0?purple:(oshort<omed?red:orange))
barcolor(ebc?bc:na)