Buonasera, posso chiedere la cortesia di tradurre questo indicatore dal linguaggio pine script al linguaggio proreal time?
Ecco il codice :
// @version= 6
indicator ( “Autocorrelation Price Forecasting [The Quant Scie nce]” , overlay = true , max_labels_count = 500 ) tooltip1 = “Imposta la lunghezza dei dati utilizzati nel modello di previsione dei prezzi con autocorrelazione.” _length = input.int ( defval = 20 , title = “Lunghezza:” , step = 1 , minval =
1 , maxval = 200 , tooltip = tooltip1 , group = “IMPOSTAZIONE” )
signal_threshold = 0.50 color1 = input.color ( defval = color.rgb ( 105 , 247 , 62 ) , title = “Stima in su” , group = “STIMA COLORI” , inline = ‘footer’ ) color2 = input.color ( defval = color.rgb ( 255 , 0 , 0 ) , title = “Stima in giù” , group = “STIMA COLORI” , inline = ‘footer’ ) prices = close autocorr_values = ta.correlation ( prezzi , prezzi [ _length ] , 200 ) cycle_detected = autocorr_values > signal_threshold restituisce = ( prezzi – prezzi [ 1 ]) / prezzi [ 1 ] * 100 linreg_values = ta.linreg ( restituisce , _length , 0 ) var float store_cycle_value = 0 se cycle_detected store_cycle_value := linreg_values
future_price_estimate = close * ( 1 + store_cycle_value / 100 ) hipotetical_gain = future_price_estimate – close color_estimate = future_price_estimate > close ? color1 : future_price_estimate < close ? color2 : na color_estimate2 = hipotetical_gain > 0 ? color1 : na color_estimate3 = hipotetical_gain < 0 ? color2 : na label.new ( bar_index , future_price_estimate , xloc = xloc . bar_index , yloc = yloc . abovebar , text = str. tostring ( math. round_to_mintick ( hipotetical_gain )) , style = label. style_none , textcolor = color_estimate2 , size = size. tiny ) label.new ( bar_index , future_price_estimate , xloc = xloc . bar_index , yloc = yloc . belowbar , text = str. tostring ( math. round_to_mintick ( hipotetical_gain )) , style = label. style_none , textcolor = color_estimate3 , size = size. tiny ) plot ( future_price_estimate , color = color_estimate , style = plot. style_stepline_diamond , larghezza della riga = 2 )