Moderator: admin
beta(array,periods) where
n = barindex
val1 = sum(n*array,periods)-(periods*sma(n,periods)*sma(array,periods))
val2 = sum(pow(n,2),periods)-(periods*pow(sma(n,periods),2))
calcB = val1/val2
alpha(array,periods) =>
n = barindex
calcA = sma(array,periods)-(beta(array,periods)*sma(n,periods))
see(array,periods) // This function must supplant StdDev for band creation with mult factor
lr = linearregression(array,periods) // Can be supplanted with TSF
val1 = (sum(pow(array,2),periods))-((alpha(array,periods)*sum(array,periods)))-((beta(array,periods)*sum(n*array,periods)))
val2 = periods - 2
eest = sqrt(val1/val2)
xel_arjona wrote:Just for the record, Bands are badly calculated.
Here's the implementation I made at TradingView's Pine if you like to re-code it to LUA:
https://www.tradingview.com/script/qQjavJxT-Standard-Error-of-the-Estimate-Composite-Bands/
Basically you need to define 2 functions prior to calculate error which are Alpha and Beta, then define the Standard Error Estimate from the Linear Regression Curve (I like to use TSF)
Users browsing this forum: No registered users and 44 guests