I saw this indicator on YouTube which is an indicator available on Tradingview and I was wondering if anyone knows how this works or maybe if it can be converted to be used on TOS
I heard of linear regression but I am not sure how it's used on a candle
From what I observed by using it on Tradingview it seems to break up a large candle into smaller candles so I am not sure if it can actually be traded based on this indicator
Let's say there was a big up bar candle of 4 points on a 1 min chart using the linear regression candle indicator will show 4 separate smaller up candles more or less equal sized 1 minute apart
So the way I see it if I try to use this indicator and try to enter after the first bar it most likely will not get filled because the price went past the candle onto the next one
most likely missing the big move
Here is the indicator in pine script
//@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) : close
r = 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)