conversione di codice PINE
Forums › ProRealTime forum Italiano › Supporto ProBuilder › conversione di codice PINE
- This topic has 1 reply, 2 voices, and was last updated 1 week ago by
Iván.
Viewing 2 posts - 1 through 2 (of 2 total)
-
-
02/04/2025 at 3:08 PM #243454
Buondì, qualcuno è in grado di convertire il codice PINE di questo indicatore? mi sembra interessante
//@version=6indicator(title=”Relative Volatility Index”, shorttitle=”RVI”, format=format.price, precision=2, timeframe=””, timeframe_gaps=true)length = input.int(10, minval=1)offset = input.int(0, “Offset”, minval = -500, maxval = 500)src = closelen = 14stddev = ta.stdev(src, length)upper = ta.ema(ta.change(src) <= 0 ? 0 : stddev, len)lower = ta.ema(ta.change(src) > 0 ? 0 : stddev, len)rvi = upper / (upper + lower) * 100h0 = hline(80, “Upper Band”, color=#787B86)hline(50, “Middle Band”, color=color.new(#787B86, 50))h1 = hline(20, “Lower Band”, color=#787B86)fill(h0, h1, color=color.rgb(126, 87, 194, 90), title=”Background”)plot(rvi, title=”RVI”, color=#7E57C2, offset = offset)// Smoothing MA inputsGRP = “Smoothing”TT_BB = “Only applies when ‘SMA + Bollinger Bands’ is selected. Determines the distance between the SMA and the bands.”maTypeInput = input.string(“SMA”, “Type”, options = [“None”, “SMA”, “SMA + Bollinger Bands”, “EMA”, “SMMA (RMA)”, “WMA”, “VWMA”], group = GRP, display = display.data_window)maLengthInput = input.int(14, “Length”, group = GRP, display = display.data_window)bbMultInput = input.float(2.0, “BB StdDev”, minval = 0.001, maxval = 50, step = 0.5, tooltip = TT_BB, group = GRP, display = display.data_window)var enableMA = maTypeInput != “None”var isBB = maTypeInput == “SMA + Bollinger Bands”// Smoothing MA Calculationma(source, length, MAtype) =>switchMAtype“SMA”=>ta.sma(source,length)“SMA + Bollinger Bands”=>ta.sma(source,length)“EMA”=>ta.ema(source,length)“SMMA (RMA)”=>ta.rma(source,length)“WMA”=>ta.wma(source,length)“VWMA”=>ta.vwma(source,length)// Smoothing MA plotssmoothingMA = enableMA ? ma(rvi, maLengthInput, maTypeInput) : nasmoothingStDev = isBB ? ta.stdev(rvi, maLengthInput) * bbMultInput : naplot(smoothingMA, “RVI-based MA”, color=color.yellow, display = enableMA ? display.all : display.none, editable = enableMA)bbUpperBand = plot(smoothingMA + smoothingStDev, title = “Upper Bollinger Band”, color=color.green, display = isBB ? display.all : display.none, editable = isBB)bbLowerBand = plot(smoothingMA – smoothingStDev, title = “Lower Bollinger Band”, color=color.green, display = isBB ? display.all : display.none, editable = isBB)fill(bbUpperBand, bbLowerBand, color= isBB ? color.new(color.green, 90) : na, title=”Bollinger Bands Background Fill”, display = isBB ? display.all : display.none, editable = isBB)02/07/2025 at 12:25 PM #243580Ciao. Este indicador ya fue traducido hace unos meses. Ha aggiunto las bandas de bollinger e la media mobile
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687//------------------------------------------------------////PRC_RVI relative volatility Index//version = 0//06.02.2025//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//------------------------------------------------------//// Inputs//------------------------------------------------------//stdevLength=10stdevType=1 //boolean variable 1 means PopulationsmoothLength=14obLevel=80mdLevel=50osLevel=20useRefined=1 //boolean variablehighlightBreakouts=1 //boolean variablesrc=closemaTypeInput=0maLengthInput=14useBB=1bbMultInput=2//------------------------------------------------------//// Standard deviation calculation//------------------------------------------------------////Type=1 Population else Sampleif stdevType=1 thenselectedStdev=STD[stdevLength](src)elsedev=src-average[stdevLength](src)variance=summation[stdevLength](pow(dev,2))/(stdevLength-1)selectedStdev=sqrt(variance)endif//------------------------------------------------------//// RVI original version (1993)//------------------------------------------------------//up=(src>=src[1])*selectedStdevdown=(src<src[1])*selectedStdevupsum=average[smoothLength,1](up)downsum=average[smoothLength,1](down)rvi=100*upsum/(upsum+downsum)//------------------------------------------------------//// Moving average//------------------------------------------------------//maRVI=average[maLengthInput,maTypeInput](rvi)if useBB thenbbUpperband=maRVI+std[maLengthInput](rvi)*bbMultInputbbLowerband=maRVI-std[maLengthInput](rvi)*bbMultInputendif//------------------------------------------------------//// Plot//------------------------------------------------------////---Rvi colorif rvi>oblevel thenr=14g=187b=35elsif rvi<oslevel thenr=255g=0b=0elser=244g=183b=125endif//---HighlightBreakoutsif rvi>oblevel and highlightBreakouts thenrob=0gob=255alphaob=40elsealphaob=0endifif rvi<oslevel and highlightBreakouts thenros=255gos=0alphaos=40elsealphaos=0endifcolorbetween(100,oblevel,rob,gob,0,alphaob)colorbetween(0,oslevel,ros,gos,0,alphaos)//------------------------------------------------------//return rvi as "RVI" coloured(r,g,b)style(line,2),maRVI as "MA RVI"coloured("blue"), oblevel as "Overbought Level"coloured("black")style(dottedline),oslevel as "Oversold Level"coloured("black")style(dottedline),50 as "MidLevel" coloured("black")style(dottedline),bbUpperband as "BBUp"coloured("blue")style(dottedline),bbLowerband as "BBDn"coloured("blue")style(dottedline) -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
Find exclusive trading pro-tools on
Similar topics: