CapnOscar

Stochastic In Bands

What about to display Stochastic Oscilator in EMA-ATR Bands? If you like the idea I would code advanced version
สคริปต์โอเพนซอร์ซ

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

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

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

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
study(title="Stochastic In Bands", shorttitle="SIB", overlay=true)
ATRlength = input(14, minval=1)
ATRMult = input(2.70, minval=1)
ATRBase = input(3.50, minval=1)
ATR = rma(tr(true), ATRlength)

len = input(21, minval=1, title="Length")
src = input(close, title="Source")
out = ema(src, len)

emaup = out+(ATR*ATRMult)
emadw = out-(ATR*ATRMult)
emabs = out-(ATR*ATRBase)
plot(out, title="EMA", color=orange)
plot(emaup, title="EMAUP", color=silver)
plot(emadw, title="EMADW", color=silver)

Stlength = input(14, minval=1), smoothK = input(5, minval=1), smoothD = input(3, minval=1)
k = sma(stoch(close, high, low, Stlength), smoothK)
d = sma(k, smoothD)

MDiff = emaup-emadw
StM = emabs+((k*MDiff)/80)
StS = emabs+((d*MDiff)/80)
plot(StM, title="Main", color=red)
plot(StS, title="Signal", color=blue)