//PRC_Linear Regression Candles
//version = 0
//15.03.24
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
///////////////////////////////////////////////////////
//------------------Inputs------------------------------
signallength = 11 //integer//Signal Smoothing
smasignal = 1 //boolean // Simple MA (Signal Line)
linreg = 1 //boolean//Linear Regression
linreglength = 11//integer//Linear Regression Length
//------------------------------------------------------
//-------------Candle definition------------------------
if linreg then
//bopen = LinearRegression[linreglength](open)
//bhigh = LinearRegression[linreglength](high)
//blow = LinearRegression[linreglength](low)
bclose = LinearRegression[linreglength](close)
else
//bopen = open
//bhigh = high
//blow = low
bclose = close
endif
//--------------------------------------------------------
//---------------Signal definition-------------------------
if smasignal then
signal = average[signallength](bclose)
else
signal = average[signallength,1](bclose)
endif
screener[bclose crosses over signal]
//screener[bclose crosses under signal]