Linear Regression Candles
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Linear Regression Candles
- This topic has 2 replies, 2 voices, and was last updated 9 months ago by brian gilbert.
-
-
03/14/2024 at 8:57 PM #229802
Hi, i found this code on web… i think that it’s a Pine Script code and i would know, if it’s possible, the translation for Probuilder.
Thank you very much for helping.//@version=4
study(title=”Humble LinReg Candles”, shorttitle=”LinReg Candles”, format=format.price, precision=4, overlay=true)signal_length = input(title=”Signal Smoothing”, type=input.integer, minval = 1, maxval = 200, defval = 11)
sma_signal = input(title=”Simple MA (Signal Line)”, type=input.bool, defval=true)lin_reg = input(title=”Lin Reg”, type=input.bool, defval=true)
linreg_length = input(title=”Linear Regression Length”, type=input.integer, minval = 1, maxval = 200, defval = 11)bopen = lin_reg ? linreg(open, linreg_length, 0) : open
bhigh = lin_reg ? linreg(high, linreg_length, 0) : high
blow = lin_reg ? linreg(low, linreg_length, 0) : low
bclose = lin_reg ? linreg(close, linreg_length, 0) : closer = bopen < bclose signal = sma_signal ? sma(bclose, signal_length) : ema(bclose, signal_length) plotcandle(r ? bopen : na, r ? bhigh : na, r ? blow: na, r ? bclose : na, title="LinReg Candles", color= color.green, wickcolor=color.green, bordercolor=color.green, editable= true) plotcandle(r ? na : bopen, r ? na : bhigh, r ? na : blow, r ? na : bclose, title="LinReg Candles", color=color.red, wickcolor=color.red, bordercolor=color.red, editable= true) plot(signal, color=color.white)
03/15/2024 at 11:28 AM #229830Ecco cosa hai:
PRC_Candele di regressione lineare123456789101112131415161718192021222324252627282930313233343536373839404142434445//PRC_Linear Regression Candles//version = 0//15.03.24//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge/////////////////////////////////////////////////////////------------------Inputs------------------------------signallength = 11 //integer//Signal Smoothingsmasignal = 1 //boolean // Simple MA (Signal Line)linreg = 1 //boolean//Linear Regressionlinreglength = 11//integer//Linear Regression Length//------------------------------------------------------//-------------Candle definition------------------------if linreg thenbopen = LinearRegression[linreglength](open)bhigh = LinearRegression[linreglength](high)blow = LinearRegression[linreglength](low)bclose = LinearRegression[linreglength](close)elsebopen = openbhigh = highblow = lowbclose = closeendif//--------------------------------------------------------//--------------Color candles-----------------------------if bopen < bclose thenr=0g=255elser=255g=0endif//---------------------------------------------------------//---------------Draw Candles------------------------------DRAWCANDLE(bopen, bhigh, blow, bclose)coloured(r,g,0)//---------------------------------------------------------//---------------Signal definition-------------------------if smasignal thensignal = average[signallength](bclose)elsesignal = average[signallength,1](bclose)endifreturn signal as "Signal"coloured("white")style(line,2)03/15/2024 at 6:12 PM #229864Wonderful, it works! You’re truly great, thank you very much…
-
AuthorPosts
Find exclusive trading pro-tools on