Simrido + Adx
Forums › ProRealTime foro Español › Soporte ProBuilder › Simrido + Adx
- This topic has 3 replies, 1 voice, and was last updated 2 years ago by Fr7.
Viewing 4 posts - 1 through 4 (of 4 total)
-
-
11/17/2017 at 11:09 AM #53094
Estoy intentando adaptar este código de la plataforma Tradingview de un indicador llamado Simrido + Adx : https://es.tradingview.com/script/h2SKGE0d/
Tengo desarrollado esto:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647REM SIMRIDO+ADX//@version=3lensimrido= 14rise = 0for i=0 to lensimrido-1 doif typicalprice[i] > typicalprice[i+1] thenrise=rise+1endifnextsrd = rise/lensimrido*100len = 14th = 20TrueRange = max(max(high-low, abs(high-(close[1]))), abs(low-(close[1])))if DirectionalMovementPlus thenDirectionalMovementPlus= high-(high[1])>(low[1])-lowelsif DirectionalMovementPlus=max(high-(high[1]),0) thenDirectionalMovementPlus=0endifif DirectionalMovementMinus thenDirectionalMovementMinus = (low[1])-low > high-(high[1])elsif DirectionalMovementMinus= max((low[1])-low, 0) thenDirectionalMovementMinus=0endifSmoothedTrueRange=close*0SmoothedTrueRange= (SmoothedTrueRange[1]) - ((SmoothedTrueRange[1])/len) + TrueRangeSmoothedDirectionalMovementPlus=close*0SmoothedDirectionalMovementPlus =(SmoothedDirectionalMovementPlus[1])-((SmoothedDirectionalMovementPlus[1])/len) + DirectionalMovementPlusSmoothedDirectionalMovementMinus=close*0SmoothedDirectionalMovementMinus=(SmoothedDirectionalMovementMinus[1])-((SmoothedDirectionalMovementMinus[1])/len) + DirectionalMovementMinusDPlus = (SmoothedDirectionalMovementPlus / SmoothedTrueRange) * 100DMinus = (SmoothedDirectionalMovementMinus / SmoothedTrueRange)* 100DX = abs((DPlus-DMinus / DPlus+DMinus))*100AD =average[len](DX)return srd coloured(0,0,255)as "simrido",AD coloured(255,0,0)as "adx", th style(dottedline)as "20",50 as "50"11/17/2017 at 11:13 AM #53096Como veís, la linea roja ( adx) no me sale y es lo que falta
04/11/2022 at 4:33 PM #191589Hola, he intentado arreglarlo pero sigue si funcionar…¿Alguien sabe qué está mal?
12345678910111213141516171819202122232425262728293031323334353637383940lensimrido= 14rise = 0for i=0 to lensimrido-1 doif typicalprice[i] > typicalprice[i+1] thenrise=rise+1endifnextsrd = rise/lensimrido*100len = 14th = 20TrueRange = max(max(high-low, abs(high-(close[1]))), abs(low-(close[1])))if high-(high[1])>(low[1])-low thenDirectionalMovementPlus=max(high-(high[1]),0)elseDirectionalMovementPlus=0endifif (low[1])-low > high-(high[1]) thenDirectionalMovementMinus=max((low[1])-low, 0)elseDirectionalMovementMinus=0endifSmoothedTrueRange=close*0SmoothedTrueRange= (SmoothedTrueRange[1]) - ((SmoothedTrueRange[1])/len) + TrueRangeSmoothedDirectionalMovementPlus=close*0SmoothedDirectionalMovementPlus =(SmoothedDirectionalMovementPlus[1])-((SmoothedDirectionalMovementPlus[1])/len) + DirectionalMovementPlusSmoothedDirectionalMovementMinus=close*0SmoothedDirectionalMovementMinus=(SmoothedDirectionalMovementMinus[1])-((SmoothedDirectionalMovementMinus[1])/len) + DirectionalMovementMinusDPlus = (SmoothedDirectionalMovementPlus / SmoothedTrueRange) * 100DMinus = (SmoothedDirectionalMovementMinus / SmoothedTrueRange)* 100DX = abs((DPlus-DMinus / DPlus+DMinus))*100AD =average[len](DX)return srd coloured(0,0,255)as "simrido",AD coloured(255,0,0)as "adx", th style(dottedline)as "20",50 as "50"04/11/2022 at 6:16 PM #191594Este es el código original:
12345678910111213141516171819202122232425262728293031323334353637//@version=3study("simrido")len_simrido = input(14)rise = 0for i=0 to len_simrido-1if hlc3[i] > hlc3[i+1]rise:=rise+1srd = rise/len_simrido*100len = input(title="Length", type=integer, defval=14)th = input(title="threshold", type=integer, defval=20)TrueRange = max(max(high-low, abs(high-nz(close[1]))), abs(low-nz(close[1])))DirectionalMovementPlus = high-nz(high[1]) > nz(low[1])-low ? max(high-nz(high[1]), 0): 0DirectionalMovementMinus = nz(low[1])-low > high-nz(high[1]) ? max(nz(low[1])-low, 0): 0SmoothedTrueRange=close*0SmoothedTrueRange := nz(SmoothedTrueRange[1]) - (nz(SmoothedTrueRange[1])/len) + TrueRangeSmoothedDirectionalMovementPlus=close*0SmoothedDirectionalMovementPlus := nz(SmoothedDirectionalMovementPlus[1]) - (nz(SmoothedDirectionalMovementPlus[1])/len) + DirectionalMovementPlusSmoothedDirectionalMovementMinus=close*0SmoothedDirectionalMovementMinus := nz(SmoothedDirectionalMovementMinus[1]) - (nz(SmoothedDirectionalMovementMinus[1])/len) + DirectionalMovementMinusDIPlus = SmoothedDirectionalMovementPlus / SmoothedTrueRange * 100DIMinus = SmoothedDirectionalMovementMinus / SmoothedTrueRange * 100DX = abs(DIPlus-DIMinus) / (DIPlus+DIMinus)*100ADX = sma(DX, len)dis = srd-ADXplot(srd, "simrido", color=blue, style=area, histbase=50, transp=50)plot(ADX, "ADX", color=red)hline(th, "th", color=black, linestyle=dashed)//plot(dis, "dis", color=#80008030, style=area, histbase=th)//, transp=10)//plot((dis+th)/2, "dis", color=black, linewidth=4, transp=20)//hline(50, color=black, linestyle=dashed) -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)