Anchored Standard Deviation & Standard Error Linear Regression Channel

Anchored Standard Deviation & Standard Error Linear Regression Channel

This version of the Linear Regression Channel with Standard Deviation (STD) and Standard Error (STE) bands has dynamic lookback for its calculation.

You can define in the setting a precise date and time to anchor the start of the channel, so its length evolves as time passing by. It can be useful to spot potential breakout of a defined trend or rebound on the top and bottom of the channel.

The original version with fixed bars lookback can be found here: Standard Deviation & Standard Error Linear Regression Channel



Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

New! PRC is also now on YouTube, subscribe to our channel for exclusive content and tutorials

  1. swapping • 06/28/2019 #

    Excellent Nicolas ūüėČ

  2. Violet • 06/28/2019 #

    Hi Nicolas,

    There seems to be a small error in the code, which causes the channel not to be shown.

    Line 20 should read as follows: if date = anchordate and time >= anchortime then

    Note the condition : >= anchortime


    • Nicolas • 06/28/2019 #

      Hmm, I don’t think so, otherwise the channel will have a moving start and not anchored anymore.
      If the channel doesn’t show, it may because the starttime is not met in the timeframe you are using.

  3. SB-FO • 16 days ago #

    Nicolas, can you share with me how PRT calculates LinearRegression ? Is it (3 * WeightedAverage Close X – 2 * AVERAGE Close X) X= Period?

    • Nicolas • 16 days ago #

      The above code is the way it is calculated in PRT. However the exact indicator can be found here:

  4. SB-FO • 14 days ago #

    Thanks Nicolas.

Register or


avatar avatar avatar avatar avatar
Related users ' posts
Nicolas email notification are not available for custom indicators.
DIOS Bonjour Nicolas, comment coder un indicateur de rsi de Divergence? Merci pour ta réponse
Nicolas En apprenant la programmation :) Plus sérieusement, il y a quantité d'exemples dans la libra...
Fabian Hi IV Mcm, have you drawn the rectangles (Dinamic, Range) by yourself in the chart or are...
IV Mcm Myself to illustrate ;)
Gaby333 not working the same thing as xtian saying?
fucode I need to calculate this in excel. Is it posible ? how ?
Nicolas Ask on an Excel website?!
Vonasi There are actually two ways to calculate standard deviations and I seem to have used the ver...
Vonasi There are actually two ways to calculate standard deviations and I seem to have used the ver...
segie Can something similar be done with Supertrends?
Vonasi Not sure I fully understand what you are asking for. Are you asking for MTF Supertrend level...
Kris75 very interesting; thanks !
Nicolas How to import file page: in the help section of the website explains howto
kenssa import through the indicator page/window in the Proreal time
chicoteca Buenas, no consigo que se me muestre en el chart de DAX. ¬ŅC√≥mo procedo? Gracias.-
Bruno38340 Bonjour, merci pour le code... Comment peut-on changer/augmenter le nombre de lots achetés s...
Ciurno981 il suffit de changer le nombre de contrats à acheter
Ciurno981 Does anyone have the data at 200,000 units, why would I like to see over 5 years?
Byggtrader Hi Nicolas! How do I get the indicator in the price chart? It only stays under i new chart.
Nicolas Just add it on the price chart by using the wrench on the left upper side of the chart (pric...
jobswaps oyes aste uno de soportes y recistencias
jobswaps eso lo necesitamos
Nicolas Sorry I do not provide assistance for Tradestation code.
surfeur Bonjour, Je suis pas expert en PRT donc si qq'un peut m'expliquer un peu le code ? Par...
Nicolas src c'est bien le customclose en effet. ATR, si aucune série de données n'est spécifié, il u...
kj1988 Thank you for this nice indicator. I find it useful and a better replacement for the RSI
ALE Happy to know
carlvan That's a great indicator and I especially the use of colors, more or less pronounced to indi...
2 years ago
Balmora74 Thanks for this code. i will try to adapt it in the EUR/USD Pac Man Strategy who is based on...
Vonasi I still have two versions of the PacMan strategy on forward test although there have been va...
Balmora74 I use your version on a real account and the strategy is profitable and i did not have any p...
Nicolas Es ist in prorealtime v10.3 nicht möglich, sorry :) Wenn Sie v11 verwenden, können Sie mögli...
Gianluca Hello, is it possible to use this channel in a strategy? i tried to apply in a code but the ...
Nicolas Because this is indeed nothing more of what you describe. A mean with +/- standard deviation...
sir_i Bonjour à tous, Je suis nouveau sur le forum et sur la plateforme, pourriez-vous me dire com...
Nicolas Il faut simplement l'appliquer sur le prix.
sir_i Merci pour la réponse, je ne suis pas familier avec l'application de cette procédure simple,...
Choliver Bonjour et merci pour cet indicateur. Toutefois, il me semble qu'il est unidirectionnel. P...
Louis Winthorp III Hi Choliver, you are right, there is a problem with the drawing instruction when the slope i...
Nicolas File and code are updated.