[blackcat] L1 Jon Andersen R-Squared IndicatorLevel: 1
Background
The R-Squared indicator created by Jon Andersen in "Standard error bands" in the September 1996 STOCKS & COMMODITIES .
Function
This script fristly creates the coeffR function which is used to produced the R-Squared indicator. The coeffR function is used to calculate the correlation coefficient R. Once I have created and verified the coeffR function, the R-Sqaured indicator can be built easily.
Key Signal
AvgSqrR --> Smoothed R-Squared Oscillator Output.
Labels and alerts are added.
Remarks
Feedbacks are appreciated.
Readme
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.
Jonandersen
[blackcat] L1 Jon Andersen Standard Error BandsLevel: 1
Background
The standard error bands created by Jon Andersen in "Standard error bands" in the September 1996 STOCKS & COMMODITIES.
Function
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.
Remarks
Feedbacks are appreciated.
Readme
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.
Standard Error of the Estimate -Composite Bands-Standard Error of the Estimate - Code and adaptation by @glaz & @XeL_arjona
Ver. 2.00.a
Original implementation idea of bands by:
Traders issue: Stocks & Commodities V. 14:9 (375-379):
Standard Error Bands by Jon Andersen
This code is a former update to previous "Standard Error Bands" that was wrongly applied given that previous version in reality use the Standard Error OF THE MEAN, not THE ESTIMATE as it should be used by Jon Andersen original idea and corrected in this version.
As always I am very Thankfully with the support at the Pine Script Editor chat room, with special mention to user @glaz in order to help me adequate the alpha-beta (y-y') algorithm, as well to give him full credit to implement the "wide" version of the former bands.
For a quick and publicly open explanation of this truly statistical (regression analysis) 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.
Standard Error Bands by @XeL_arjonaStandard 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.