UDAY_C_Santhakumar

DMI Stochastic Extreme -

DMI Stochastic Extreme - Version 2


- Replaced B with , Replaced S with
- Ability to change Overbought and Oversold Levels
- Clean PineScript

List of All my Indicators - www.tradingview.com/p/stocks/?sort=recen...

Uday C Santhakumar
สคริปต์โอเพนซอร์ซ

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

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

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

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
// Version 0 - Created by UCS_Gears
// Version 1 - Modified by Chris Moody "Added B/S"
// Version 2 - Modified by UCS_Gears, "Replaced B/S with arrows", "Ability to change Overbought / Oversold Levels"

study(title="DMI Stochastic Extreme", shorttitle="DMI-Stochastic", overlay=false)
// Wells Wilders MA
wwma(l,p) =>
    wwma = (nz(wwma[1]) * (l - 1) + p) / l

// Inputs
DMIlength = input(10, title = "DMI Length")
Stolength = input(3, title = "Stochastic Length")
Oversold = input(10, title = "Oversold")
Overbought = input(90, title="Overbought")

// DMI Osc Calc
hiDiff = high - high[1]
loDiff = low[1] - low
plusDM = (hiDiff > loDiff) and (hiDiff > 0) ? hiDiff : 0
minusDM = (loDiff > hiDiff) and (loDiff > 0) ? loDiff : 0
ATR = wwma(DMIlength, tr)
PlusDI = 100 * wwma(DMIlength,plusDM) / ATR
MinusDI = 100 * wwma(DMIlength,minusDM) / ATR
osc = PlusDI - MinusDI

// DMI Stochastic Calc
hi = highest(osc, Stolength)
lo = lowest(osc, Stolength)
Stoch = sum((osc-lo),Stolength) / sum((hi-lo),Stolength) *100
plot(Stoch, color = gray, title = 'Stochastic', linewidth = 2, style = line)

crossUp = Stoch[1] < Oversold and Stoch > Oversold ? 1 : 0
crossDown = Stoch[1] > Overbought and Stoch < Overbought ? 1 : 0

plot (Overbought, color = red, linewidth = 1, title = 'Over Bought')
plot (Oversold, color = green, linewidth = 1, title = 'Over Sold')

plotchar(crossUp, title="Crossing Up", char='↑', location=location.bottom, color=aqua, transp=0, offset=0)
plotchar(crossDown, title="Crossing Down",char='↓', offset=0, location=location.top, color=aqua, transp=0)