You are on page 1of 2

//@version=4

study(title="Stochastic RSIx2 + Stochastic", shorttitle="1Musd",


format=format.price, precision=2)

/////////////////////////////////////////
Estocastico//////////////////////////////////////////////////////////

periodK = input(14, title="K", minval=1)


periodD = input(3, title="D", minval=1)
smoothK3 = input(3, title="Smooth", minval=1)
k3 = 200+sma(stoch(close, high, low, periodK), smoothK3)
d3 = sma(k3, periodD)
plot(k3, title="%K", color=color.blue)
plot(d3, title="%D", color=color.orange)
h03 = hline(280)
h13 = hline(220)
fill(h03, h13, color=color.purple, transp=95)
//////////////////////////////////////////Estocastico RSI
1///////////////////////////////////////////////////

smoothK = input(6, minval=1)


smoothD = input(6, minval=1)
lengthRSI = input(14, minval=1)
lengthStoch = input(14, minval=1)
src = input(close, title="RSI Source")

rsi1 = rsi(src, lengthRSI)


k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)

plot(k, color=color.blue)
plot(d, color=color.orange)
h0 = hline(80)
h1 = hline(20)
fill(h0, h1, color=color.purple, transp=95)

/////////////////////////////////////////Estocastico RSI
2///////////////////////////////////////////////////

smoothK2 = input(3, minval=1)


smoothD2 = input(3, minval=1)
lengthRSI2 = input(14, minval=1)
lengthStoch2 = input(14, minval=1)
src2 = input(close, title="RSI Source")

rsi2 = rsi(src2, lengthRSI2)


k2 = 100+sma(stoch(rsi2, rsi2, rsi2, lengthStoch2), smoothK2)
d2 = sma(k2, smoothD2)

plot(k2, color=color.blue)
plot(d2, color=color.orange)
h02 = hline(180)
h12 = hline(120)
fill(h02, h12, color=color.purple, transp=95)

//////////////////////////////////////////
Regalo///////////////////////////////////////////////////////////////
crossS = k3>280 and k2>180 and k>80
crossB = k3<220 and k2<120 and k<20

bcol = crossB ? color.green : crossS ? color.red : na


bgcolor(bcol, transp=20)

//////////////////////////////////////////DMI
STOCH//////////////////////////////////////////////////////////////

//DMI Stoch
// WWMA
wwma(l,p) =>
wwma = 0.0
wwma := (nz(wwma[1])*(l-1)+p)/l

//VALUES
DMIlength = input(10)
Stolength = input(3)

//DMI 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 STOCH CALC


hi = highest(osc, Stolength)
lo = lowest(osc, Stolength)

You might also like