xel_arjona

Standard Error Bands by @XeL_arjona

Standard Error Bands - Code by @XeL_arjona
Original implementation by:
Traders issue: Stocks & Commodities V. 14:9 (375-379):
Standard Error Bands by Jon Andersen
Version 1



For a quick and publicly open explanation of this Statistical indicator, you can refer at Here!

Extract from the former URL:
Standard Error bands are quite different than Bollinger's. First, they are bands constructed around a linear regression curve. Second, the bands are based on two standard errors above and below this regression line. The error bands measure the standard error of the estimate around the linear regression line. Therefore, as a price series follows the course of the regression line the bands will narrow, showing little error in the estimate. As the market gets noisy and random, the error will be greater resulting in wider bands.


Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
// Standard Error Bands - Code by @XeL_arjona
// Original implementation by:
//     Traders issue: Stocks & Commodities V. 14:9 (375-379): 
//                    Standard Error Bands by Jon Andersen
// Ver 1
study(title="Standard Error Bands by @XeL_arjona", shorttitle="StDeBands", overlay=true)
len = input(defval=21, minval=1, title="Linear Regression Window:")
sm = input(true, title="Use Jon Andersen's Smooth of Median:")
src = close
// Standard Error Band Function
stdeB(array,p,mult,dir) =>
    lr = sm ? sma(linreg(array,p,0),1) : linreg(array,p,0)
    stde = stdev(lr,p)/sqrt(p)
    d = dir ? 1 : -1
    eband = lr + d * mult * stde
lrc = sma(linreg(src, len, 0),1)
m = plot(lrc, color = blue, title = "OLS Regression Curve", style = line, linewidth = 2)
ub = plot(stdeB(close,len,2,true), color = green, title = 'StdEu', style = line, linewidth = 1)
bb = plot(stdeB(close,len,2,false), color = red, title = 'StdEb', style = line, linewidth = 1)
fill(m,ub, color=olive, title="StdE_U", transp=81)
fill(m,bb, color=orange, title="StdE_B", transp=81)