SUPERTREND RSI !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Forums › ProRealTime foro Español › Soporte ProBuilder › SUPERTREND RSI !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- This topic has 2 replies, 2 voices, and was last updated 3 months ago by
NEOMKEY.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
06/02/2024 at 4:16 PM #233405
Hola a todos, os remito el presente indicador de la plataforma TRADINGVIEW para ver si sois capaces de transcribirlo a PRT. Gracias
06/03/2024 at 4:59 PM #233464Hola!
Aquí lo tienes https://www.prorealcode.com/prorealtime-indicators/rsi-supertrend-a-trend-and-momentum-indicator/PRC_RSI Supertrend123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106//--------------------------------------------------------------------////PRC_RSI Supertrend//version = 0//03.06.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//--------------------------------------------------------------------////-----Inputs---------------------------------------------------------//relativeStrengthIndexLength=14smoothingLength=21rsiInputSource = customcloseisSmoothed=0movingAverageLength=14movingAverageType=7 //showMovingAverage=1trendFactor=0.8averageTrueRangeLength=10obline=70osline=30midline=50transparency=80//--------------------------------------------------------------------////-----RSI Calculation------------------------------------------------//if isSmoothed thenauxrsi=rsi[relativeStrengthIndexLength](rsiInputSource)myrsi=hullaverage[smoothingLength](auxrsi)elsemyrsi=rsi[relativeStrengthIndexLength](rsiInputSource)endifrsiMovingAverage=average[movingAverageLength,movingAverageType](myrsi)//--------------------------------------------------------------------////-----Calculating Supertrend based on RSI values---------------------//pricesource=myrsihighestHigh=highest[averageTrueRangeLength](pricesource)lowestlow=lowest[averageTrueRangeLength](pricesource)if barindex <= averageTrueRangeLength thentruerange=highestHigh-lowestlowelsetruerange=max(highestHigh-lowestlow,max(abs(highestHigh-pricesource[1]),abs(lowestlow-pricesource[1])))endifalpha = 1/averageTrueRangeLengthif barindex <= 4*averageTrueRangeLength thenatr = average[averageTrueRangeLength](truerange)elseatr = alpha*truerange + (1-alpha)*atr[1]endifup = pricesource - trendFactor*atrup1 = up[1]if pricesource[1] > up1 thenup = max(up,up1)elseup = upendifdn = pricesource + trendFactor*atrdn1 = dn[1]if pricesource[1] < dn1 thendn = min(dn,dn1)elsedn = dnendifonce trend = 1if trend = -1 and pricesource > dn1 thentrend = 1elsif trend = 1 and pricesource < up1 thentrend = -1elsetrend = trendendifif trend = 1 thenmysupertrend = upelsemysupertrend = dnendif//--------------------------------------------------------------------//if trend=1 thenr=0g=255b=187elser=255g=17b=0endif//--------------------------------------------------------------------//colorbetween(mysupertrend,pricesource,r,g,b,transparency)//--------------------------------------------------------------------//if mysupertrend crosses over pricesource and mysupertrend>Obline thendrawtext("▼",barindex,mysupertrend+2)coloured("red")elsif mysupertrend crosses under pricesource and mysupertrend<osline thendrawtext("▲",barindex,mysupertrend-2)coloured("green")endif//--------------------------------------------------------------------//return pricesource,mysupertrend coloured(r,g,b),rsiMovingAverage coloured("grey")style(line,2),obline as "Overbought Line" coloured("grey")style(dottedline),osline as "Overbought Line" coloured("grey")style(dottedline),midline as "Middle Line" coloured("grey")style(dottedline2)1 user thanked author for this post.
06/08/2024 at 8:08 PM #233647 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)