[blackcat] L1 Jon Andersen Standard Error Bands

Level: 1


The standard error bands created by Jon Andersen in "Standard error bands" in the September 1996 STOCKS & COMMODITIES .


This script calculates the beta and alpha coefficients of the linear regression . First, it creates the calcB and calcA functions, which refer to the beta and alpha coefficients. Create calcB first, then calcA. These functions are used in calculating the regression coefficients for the standard error bands. In This standard error bands indicator, the "Length" value specifies the period of the linear regression line; the default is 21. The SDeg value specifies the smoothing factor that is used to smooth the linear regression and standard error bands; the default is 3.

Key Signal

LinRegS --> standard error bands center line
LinRegS + SErr --> standard error bands upper line
LinRegS - SErr --> standard error bands lower line

Labels and alerts are added.


Feedbacks are appreciated.


In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.

The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.

Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.

Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.

Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.

Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.

Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.

本着真正的TradingView精神,该脚本的作者将其开源发布,因此交易者可以理解和验证它。为作者加油! 您可以免费使用它,但是在发布中重复使用此代码受网站规则的约束。您可以收藏它以在图表上使用。

"Win$ & Donate w/ This" Address:
BTC: 1GeuxGE6UUato7AgMnNUjSg56mSzQ6Wxxk
USDT ERC20: 0xfd4d0eb131e81f44530849c1a966cb261dd6bda2
ETH: 0xfd4d0eb131e81f44530849c1a966cb261dd6bda2
LINK: 0xfd4d0eb131e81f44530849


Thank you for sharing your study. I tested it with strategy ( ) from 01 Jan , with BTCUSDT is not profitable while ADAUSDT performed well, using 1H , 0.5% profit per trade.
+1 回复
gmeneguzzo gmeneguzzo
@gmeneguzzo, using regular Candles as recommend TV.
+1 回复
gmeneguzzo gmeneguzzo
@gmeneguzzo, using Lenght 23 and Sdeg 4 , ADAUSDT 1H , 0.94% per trade
+1 回复
gmeneguzzo gmeneguzzo
@gmeneguzzo, DOGEUSDT works very good with Lenght 23 and Sdeg 4 1H , profitable all months since Jan 2021.
+1 回复
blackcat1402 gmeneguzzo
@gmeneguzzo, thanks for sharing your backtest result :D