Dynamic Anchored Regression Channel

Dynamic Anchored Regression Channel

Regression channels are a powerful tool for analyzing trends. They plot a central “mean” line of a trend and upper/lower bands to measure volatility, helping traders identify overbought or oversold conditions.

However, most standard regression channels are based on a “rolling” fixed period (e.g., the last 100 bars). This can be limiting. What if you want to analyze a trend not from “100 bars ago,” but from its specific starting point—like a major market bottom or a key news event?

This indicator solves that problem. It allows you to anchor a regression channel to a specific date and time, creating a dynamic tool that grows and adapts with your chart.

How It Works & Key Features

The logic is simple but effective. Instead of defining a lookback period, you define a fixed starting point in the past.

  1. Anchoring: You set a StartDate and StartTime in the code’s configuration. The indicator finds this single bar on your chart and uses it as the permanent “anchor” (Bar 0) for all its calculations.
  2. Dynamic Recalculation: The “dynamic” part is key. The channel is always calculated from that single anchor point up to the current, most recent bar.
  3. Growing Channel: As each new bar forms, the indicator automatically recalculates the entire channel’s slope, intercept, and standard deviation. This means you can watch the trend’s path and volatility evolve in real-time, all based on its original starting point.

Main Use Cases

The primary benefit of this indicator is adding historical context and objectivity to your trend analysis.

  • Analyze Trends from a Specific Event: This is the most powerful feature. You can anchor the channel’s start to:
    • A major market bottom or top.
    • A significant news release (e.g., an earnings report or central bank decision).
    • The beginning of a new year, quarter, or month.
  • Objective Trend Analysis: It removes the guesswork of picking the “right” lookback period (e.g., 50, 100, or 200). Your analysis is based on the trend’s entire life since the anchor point you selected.
  • Visualize Volatility: By watching the standard deviation bands, you can see if a trend is expanding (volatility increasing, bands widening) or contracting (volatility decreasing, bands narrowing) as it matures.

Configuration

You can easily configure the channel by editing the “USER INPUTS” section at the top of the code.

  • StartDate: Enter the starting date for the channel. The format must be YYYYMMDD (e.g., 20250128 for January 28, 2025).
  • StartTime: Enter the starting time. The format must be HHMMSS (e.g., 150000 for 3:00:00 PM).
    • Important: This time is based on your chart’s time (the time displayed on the x-axis), not necessarily your local computer time.
  • StdMultiplier: (Default: 2). This controls the width of the upper and lower bands. A value of 2 is standard (capturing ~95% of price action), but you can use 1 for a tighter channel or 3 for a wider one.

ProBuilder Code

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?

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

avatar
Register or

Likes

avatar
Related users ' posts
reb Hello Marc your strat seems very intersting, will take a look Reb
897148 What exactly is meant by Total price? Is r1 =28 in your example the no of days for "Total P...
Maxime Baudin Nice, thanks!
rowestock Hi Nicolas, I am revisiting this indicator and wanted to ask, is it possible to replace sty...
Nicolas Why not, please add a new request in our probuilder forums.
xel @DerPat - I don't see any question regarding the indicator.  Anyway, I think I give enough l...
diegofe_2000 Xel, tu eres el creador de este indicador? Bueno te  cuento que es muy bueno para hacer est...
xel Buen día @diegofe_2000 -  Claro, mandalo y por aquí lo probamos en otros instrumentos y si g...
mamio Very nice indicator. Why doesn't it refresh as time passes?
Nicolas It should refresh on each bar.
mamio On my PC it doesn't refresh. I am using intraday tick bars (not minutes). Unfortunately I do...
Nicolas I would not recommend using this version of the linear regression channel, but this one inst...
Aragorna Hello, Is it possible to updated the indicator to the more updated versione of ProrealTime? ...
Nicolas Use that code instead: https://www.prorealcode.com/prorealtime-indicators/standard-deviation...
Vicari0us Really liking this indicator. Thanks
SB-FO Moving your last response to this post. Thanks for conforming the code below. How does PRT/...
Nicolas It is obtained by substracting the x days before Close from today’s Close. X is the paramete...

Top