Linear Regression Volume Profile [ChartPrime]LR VolumeProfile
This indicator combines a Linear Regression channel with a dynamic volume profile, giving traders a powerful way to visualize both directional price movement and volume concentration along the trend.
⯁ KEY FEATURES
Linear Regression Channel: Draws a statistically fitted channel to track the market trend over a defined period.
Volume Profile Overlay: Splits the channel into multiple horizontal levels and calculates volume traded within each level.
Percentage-Based Labels: Displays each level's share of total volume as a percentage, offering a clean way to see high and low volume zones.
Gradient Bars: Profile bars are colored using a gradient scale from yellow (low volume) to red (high volume), making it easy to identify key interest areas.
Adjustable Profile Width and Resolution: Users can change the width of profile bars and spacing between levels.
Channel Direction Indicator: An arrow inside a floating label shows the direction (up or down) of the current linear regression slope.
Level Style Customization: Choose from solid, dashed, or dotted lines for visual preference.
⯁ HOW TO USE
Use the Linear Regression channel to determine the dominant price trend direction.
Analyze the volume bars to spot key levels where the majority of volume was traded—these act as potential support/resistance zones.
Pay attention to the largest profile bars—these often mark zones of institutional interest or price consolidation.
The arrow label helps quickly assess whether the trend is upward or downward.
Combine this tool with price action or momentum indicators to build high-confidence trading setups.
⯁ CONCLUSION
LR Volume Profile is a precision tool for traders who want to merge trend analysis with volume insight. By integrating linear regression trendlines with a clean and readable volume distribution, this indicator helps traders find price levels that matter the most—backed by volume, trend, and structure. Whether you're spotting high-volume nodes or gauging directional flow, this toolkit elevates your decision-making process with clarity and depth.
Regression
Algo-ONE: Advanced Signal & Trend PredictionVici Trading Solutions is proud to introduce a truly unique algorithm called “Algo ONE.” This cutting-edge tool combines proprietary studies with advanced machine learning and non-parametric supervised learning classifiers and a sophisticated grading system to deliver high-quality signals that indicate potential price direction as a complement to any trader’s technical analysis needs. Created and coded by Yale Math wiz Robert Curry, this is a first-of-its-kind comprehensive script made fully from the ground up to provide an all-in-one solution for traders. “Algo ONE” can be used alongside other forms of technical analysis; however, it was designed to be used as a standalone product made to fit any trading style.
What sets this algorithm apart is its ability to continuously adapt to evolving market conditions, factoring in volatility to refine its predictions. Every day's price action is meticulously analyzed using complex mathematical formulas, including quadratic functions, to ensure the most precise and reliable outcomes. This is more than just a signal provider for market direction—it's an ever-evolving, intelligent system designed to stay ahead of the market. This script can be used on any timeframe and any asset to assist you in making informed decisions on market direction.
The first release of this product has all the settings fixed and optimized as default to give you the winning combination out of the box. We have also combined a machine learning aspect of the tool to optimize the settings seamlessly with both changes in volatility and price action for each time frame.
Providing Endless Possibilities for any asset and any trading style
Algo One works in any market for discretionary analysis and includes:
- Beginner-friendly pre-established settings, ensuring you get the best results out of the box
- Trade Signals: Machine learning-based signals that calculate for changes in volatility and price action. (Not to be followed blindly)
- Quadratic Trendline: Constantly evolving trendline that optimizes on the fly to help capture the proper direction for trend and spot potential reversals
- Trade Stats: Toggle the time frame that best suits your needs and see the win rate of Algo One before taking any action.
- Auto-Drawn Support & Resistance Zones: ALGO ONE now identifies up to eight dynamic support and resistance zones per chart, per time frame. These zones include both major and minor levels for more accurate entries, exits, and refined risk management.
- Advanced Targeting System: Algorithmic-based exit levels now provide optimal profit-taking targets tailored to the active time frame.
- Alert System: Built-in alerts for buy/sell signals and now ALGO ONE-produced exit signals.
- Customization Options: Toggle on/off major signal arrows, display or hide prices on support/resistance lines, and more—tailor the tool to your preferences.
How to Use Features:
Trade Signals, Quadratic Trend-line, and Trade Stats
USEAGE:
Trade Signals are provided into only 2 core concepts: Up/Long/Buy & Down/Short/Sell. These signals are designed to be very clear and concise and only fire when a combination of our behind-the-scenes functions all line up and grade the probability of the outcome in favor of the signaled direction. (These signals are not to be followed blindly)
The other key feature of Algo One is our Quadratic Trendline . This is an ever-evolving trendline that has a machine learning function to adapt to volatility and price action. This line is a key component to deciding if the trade is in your favor by using this line to trade long above or short below. We also encourage not taking any signal or trade unless the price has moved above or below the trendline in combination with the direction of the signal provided. Another feature of the Quadratic Trendline is that during a trend, it tends to act as support or resistance, and you will often see price react to this line as price trends in the favored direction.
There is also a Trade Stats Dashboard that is located at the top right-hand side of the window. This helps you as you go through all the time frames to give you the option of choosing the best win rate for the time frame that suits your preference. This is very helpful for day traders and swing traders alike as you have the flexibility to pick the proper time frame with the best outcomes. The win rate is calculated by taking the close of the 4th bar after the signal is fired. If the price doesn't come back to the entry price by the close of the 4th bar, it is a win. If the price exceeds the entry price upon the close of the 4th bar, it is a loss. Default lookback period is set to 500 bars. You can adjust this accordingly to get more or less relevant data depending on your needs.
Conclusion:
We believe that true success comes from how the user engages with the indicator, rather than relying solely on the tool to generate profits. While many traders expect an indicator to be the key to their success, the reality is far more complex.
Our goal is to empower traders by providing a tool that acts as a trusted companion to their technical analysis. We know that hesitation can strike at critical moments, causing missed opportunities. This tool is designed to eliminate that doubt, instilling confidence that the price is moving in the desired direction, so traders can take action with conviction.
You can see the Author’s instructions below to get instant access to this indicator
Risk Disclaimer:
Trading carries significant risks, and many day traders experience losses. All content, tools, scripts, articles, and educational resources provided by Vici Trading Solutions are intended solely for informational and educational purposes. Remember, past performance is not indicative of future results. The indicator published on TradingView is fully compliant, does not constitute investment advice, and is not exclusively designed for qualified investors.
We are providing this script as a private invite-only script as it is a proprietary combination of indicators, settings, and machine learning. This combination has taken us hundreds of hours to find the proper combination to drive high probable outcomes. This indicator does not replace the work needed to analyze each trade entry individually; however, this standalone indicator provides you with buy and sell signals to confirm the trades you are already looking at and give you the confidence in your initial trade analysis.
For Full Risk Disclaimer please click on the link HERE to visit the website for more detail
Bitcoin Power LawThis is the main body version of the script. The Oscillator version can be found here .
Firstly, we would like to give credit to @apsk32 and @x_X_77_X_x as part of the code originates from their work. Additionally, @apsk32 is widely credited with applying the Power Law concept to Bitcoin and popularizing this model within the crypto community. Additionally, the visual layout is fully inspired by @apsk32's designs, and we think it looks amazing. So much so that we had to turn it into a TradingView script. Thank you!
Understanding the Bitcoin Power Law Model
Also called the Long-Term Bitcoin Power Law Model. The Bitcoin Power Law model tries to capture and predict Bitcoin's price growth over time. It assumes that Bitcoin's price follows an exponential growth pattern, where the price increases over time according to a mathematical relationship.
By fitting a power law to historical data, the model creates a trend line that represents this growth. It then generates additional parallel lines (support and resistance lines) to show potential price boundaries, helping to visualize where Bitcoin’s price could move within certain ranges.
In simple terms, the model helps us understand Bitcoin's general growth trajectory and provides a framework to visualize how its price could behave over the long term.
The Bitcoin Power Law has the following function:
Power Law = 10^(a + b * log10(d))
Consisting of the following parameters:
a: Power Law Intercept (default: -17.668).
b: Power Law Slope (default: 5.926).
d: Number of days since a reference point(calculated by counting bars from the reference point with an offset).
Explanation of the a and b parameters:
Roughly explained, the optimal values for the a and b parameters are determined through a process of linear regression on a log-log scale (after applying a logarithmic transformation to both the x and y axes). On this log-log scale, the power law relationship becomes linear, making it possible to apply linear regression. The best fit for the regression is then evaluated using metrics like the R-squared value, residual error analysis, and visual inspection. This process can be quite complex and is beyond the scope of this post.
Applying vertical shifts to generate the other lines:
Once the initial power-law is created, additional lines are generated by applying a vertical shift . This shift is achieved by adding a specific number of days (or years in case of this script) to the d-parameter. This creates new lines perfectly parallel to the initial power law with an added vertical shift, maintaining the same slope and intercept.
In the case of this script, shifts are made by adding +365 days, +2 * 365 days, +3 * 365 days, +4 * 365 days, and +5 * 365 days, effectively introducing one to five years of shifts. This results in a total of six Power Law lines, as outlined below (From lowest to highest):
Base Power Law Line (no shift)
1-year shifted line
2-year shifted line
3-year shifted line
4-year shifted line
5-year shifted line
The six power law lines:
Bitcoin Power Law Oscillator
This publication also includes the oscillator version of the Bitcoin Power Law. This version applies a logarithmic transformation to the price, Base Power Law Line, and 5-year shifted line using the formula log10(x) .
The log-transformed price is then normalized using min-max normalization relative to the log-transformed Base Power Law Line and 5-year shifted line with the formula:
normalized price = log(close) - log(Base Power Law Line) / log(5-year shifted line) - log(Base Power Law Line)
Finally, the normalized price was multiplied by 5 to map its value between 0 and 5, aligning with the shifted lines.
Interpretation of the Bitcoin Power Law Model:
The shifted Power Law lines provide a framework for predicting Bitcoin's future price movements based on historical trends. These lines are created by applying a vertical shift to the initial Power Law line, with each shifted line representing a future time frame (e.g., 1 year, 2 years, 3 years, etc.).
By analyzing these shifted lines, users can make predictions about minimum price levels at specific future dates. For example, the 5-year shifted line will act as the main support level for Bitcoin’s price in 5 years, meaning that Bitcoin’s price should not fall below this line, ensuring that Bitcoin will be valued at least at this level by that time. Similarly, the 2-year shifted line will serve as the support line for Bitcoin's price in 2 years, establishing that the price should not drop below this line within that time frame.
On the other hand, the 5-year shifted line also functions as an absolute resistance , meaning Bitcoin's price will not exceed this line prior to the 5-year mark. This provides a prediction that Bitcoin cannot reach certain price levels before a specific date. For example, the price of Bitcoin is unlikely to reach $100,000 before 2021, and it will not exceed this price before the 5-year shifted line becomes relevant. After 2028, however, the price is predicted to never fall below $100,000, thanks to the support established by the shifted lines.
In essence, the shifted Power Law lines offer a way to predict both the minimum price levels that Bitcoin will hit by certain dates and the earliest dates by which certain price points will be reached. These lines help frame Bitcoin's potential future price range, offering insight into long-term price behavior and providing a guide for investors and analysts. Lets examine some examples:
Example 1:
In Example 1 it can be seen that point A on the 5-year shifted line acts as major resistance . Also it can be seen that 5 years later this price level now corresponds to the Base Power Law Line and acts as a major support (Note: Vertical yearly grid lines have been added for this purpose👍).
Example 2:
In Example 2, the price level at point C on the 3-year shifted line becomes a major support three years later at point C, now aligning with the Base Power Law Line.
Finally, let's explore some future price predictions, as this script provides projections on the weekly timeframe :
Example 3:
In Example 3, the Bitcoin Power Law indicates that Bitcoin's price cannot surpass approximately $808K before 2030 as can be seen at point E, while also ensuring it will be at least $224K by then (point F).
Periodic Linear Regressions [LuxAlgo]The Periodic Linear Regressions (PLR) indicator calculates linear regressions periodically (similar to the VWAP indicator) based on a user-set period (anchor).
This allows for estimating underlying trends in the price, as well as providing potential supports/resistances.
🔶 USAGE
The Periodic Linear Regressions indicator calculates a linear regression over a user-selected interval determined from the selected "Anchor Period".
The PLR can be visualized as a regular linear regression (Static), with a fit readjusting for new data points until the end of the selected period, or as a moving average (Rolling), with new values obtained from the last point of a linear regression fitted over the calculation interval. While the static method line is prone to repainting, it has value since it can further emphasize the linearity of an underlying trend, as well as suggest future trend directions by extrapolating the fit.
Extremities are included in the indicator, these are obtained from the root mean squared error (RMSE) between the price and calculated linear regression. The Multiple setting allows the users to control how far each extremity is from the other.
Periodic Linear Regressions can be helpful in finding support/resistance areas or even opportunities when ranging in a channel.
The anchor - where a new period starts - can be shown (in this case in the top right corner).
The shown bands can be visualized by enabling Show Extremities in settings ( Rolling or Static method).
The script includes a background gradient color option for the bands, which only applies when using the Rolling method.
The indicator colors can be suggestive of the detected trend and are determined as follows:
Method Rolling: a gradient color between red and green indicates the trend; more green if the output is rising, suggesting an uptrend, and more red if it is decreasing, suggesting a downtrend.
Method Static: green if the slope of the line is positive, suggesting an uptrend, red if negative, suggesting a downtrend.
🔶 DETAILS
🔹 Anchor Type
When the Anchor Type is set to Periodic , the indicator will be reset when the "Anchor Period" changes, after which calculations will start again.
An anchored rolling line set at First Bar won't reset at a new session; it will continue calculating the linear regression from the first bar to the last; in other words, every bar is included in the calculation. This can be useful to detect potential long-term tops/bottoms.
Note that a linear regression needs at least two values for its calculation, which explains why you won't see a static line at the first bar of the session. The rolling linear regression will only show from the 3rd bar of the session since it also needs a previous value.
🔹 Rolling/Static
When Anchor Type is set at Periodic , a linear regression is calculated between the first bar of the chosen session and the current bar, aiming to find the line that best fits the dataset.
The example above shows the lines drawn during the session. The offered script, though, shows the last calculated point connected to the previous point when the Rolling method is chosen, while the Static method shows the latest line.
Note that linear regression needs at least two values, which explains why you won't see a static line at the first bar of the session. The rolling line will only show from the 3rd bar of the session since it also needs a previous value.
🔶 SETTINGS
Method: Indicator method used, with options: "Static" (straight line) / "Rolling" (rolling linear regression).
Anchor Type: "Periodic / First Bar" (the latter works only when "Method" is set to "Rolling").
Anchor Period: Only applicable when "Anchor Type" is set at "Periodic".
Source: open, high, low, close, ...
Multiple: Alters the width of the bands when "Show Extremities" is enabled.
Show Extremities: Display one upper and one lower extremity.
🔹 Color Settings
Mono Color: color when "Bicolor" is disabled
Bicolor: Toggle on/off + Colors
Gradient: Background color when "Show extremities" is enabled + level of gradient
🔹 Dashboard
Show Dashboard
Location of dashboard
Text size
Bitcoin Power Law OscillatorThis is the oscillator version of the script. The main body of the script can be found here .
Firstly, we would like to give credit to @apsk32 and @x_X_77_X_x as part of the code originates from their work. Additionally, @apsk32 is widely credited with applying the Power Law concept to Bitcoin and popularizing this model within the crypto community. Additionally, the visual layout is fully inspired by @apsk32's designs, and we think it looks amazing. So much so that we had to turn it into a TradingView script. Thank you!
Understanding the Bitcoin Power Law Model
Also called the Long-Term Bitcoin Power Law Model. The Bitcoin Power Law model tries to capture and predict Bitcoin's price growth over time. It assumes that Bitcoin's price follows an exponential growth pattern, where the price increases over time according to a mathematical relationship.
By fitting a power law to historical data, the model creates a trend line that represents this growth. It then generates additional parallel lines (support and resistance lines) to show potential price boundaries, helping to visualize where Bitcoin’s price could move within certain ranges.
In simple terms, the model helps us understand Bitcoin's general growth trajectory and provides a framework to visualize how its price could behave over the long term.
The Bitcoin Power Law has the following function:
Power Law = 10^(a + b * log10(d))
Consisting of the following parameters:
a: Power Law Intercept (default: -17.668).
b: Power Law Slope (default: 5.926).
d: Number of days since a reference point(calculated by counting bars from the reference point with an offset).
Explanation of the a and b parameters:
Roughly explained, the optimal values for the a and b parameters are determined through a process of linear regression on a log-log scale (after applying a logarithmic transformation to both the x and y axes). On this log-log scale, the power law relationship becomes linear, making it possible to apply linear regression. The best fit for the regression is then evaluated using metrics like the R-squared value, residual error analysis, and visual inspection. This process can be quite complex and is beyond the scope of this post.
Applying vertical shifts to generate the other lines:
Once the initial power-law is created, additional lines are generated by applying a vertical shift . This shift is achieved by adding a specific number of days (or years in case of this script) to the d-parameter. This creates new lines perfectly parallel to the initial power law with an added vertical shift, maintaining the same slope and intercept.
In the case of this script, shifts are made by adding +365 days, +2 * 365 days, +3 * 365 days, +4 * 365 days, and +5 * 365 days, effectively introducing one to five years of shifts. This results in a total of six Power Law lines, as outlined below (From lowest to highest):
Base Power Law Line (no shift)
1-year shifted line
2-year shifted line
3-year shifted line
4-year shifted line
5-year shifted line
The six power law lines:
Bitcoin Power Law Oscillator
This publication also includes the oscillator version of the Bitcoin Power Law. This version applies a logarithmic transformation to the price, Base Power Law Line, and 5-year shifted line using the formula log10(x) .
The log-transformed price is then normalized using min-max normalization relative to the log-transformed Base Power Law Line and 5-year shifted line with the formula:
normalized price = log(close) - log(Base Power Law Line) / log(5-year shifted line) - log(Base Power Law Line)
Finally, the normalized price was multiplied by 5 to map its value between 0 and 5, aligning with the shifted lines.
Interpretation of the Bitcoin Power Law Model:
The shifted Power Law lines provide a framework for predicting Bitcoin's future price movements based on historical trends. These lines are created by applying a vertical shift to the initial Power Law line, with each shifted line representing a future time frame (e.g., 1 year, 2 years, 3 years, etc.).
By analyzing these shifted lines, users can make predictions about minimum price levels at specific future dates. For example, the 5-year shifted line will act as the main support level for Bitcoin’s price in 5 years, meaning that Bitcoin’s price should not fall below this line, ensuring that Bitcoin will be valued at least at this level by that time. Similarly, the 2-year shifted line will serve as the support line for Bitcoin's price in 2 years, establishing that the price should not drop below this line within that time frame.
On the other hand, the 5-year shifted line also functions as an absolute resistance , meaning Bitcoin's price will not exceed this line prior to the 5-year mark. This provides a prediction that Bitcoin cannot reach certain price levels before a specific date. For example, the price of Bitcoin is unlikely to reach $100,000 before 2021, and it will not exceed this price before the 5-year shifted line becomes relevant. After 2028, however, the price is predicted to never fall below $100,000, thanks to the support established by the shifted lines.
In essence, the shifted Power Law lines offer a way to predict both the minimum price levels that Bitcoin will hit by certain dates and the earliest dates by which certain price points will be reached. These lines help frame Bitcoin's potential future price range, offering insight into long-term price behavior and providing a guide for investors and analysts. Lets examine some examples:
Example 1:
In Example 1 it can be seen that point A on the 5-year shifted line acts as major resistance . Also it can be seen that 5 years later this price level now corresponds to the Base Power Law Line and acts as a major support (Note: Vertical yearly grid lines have been added for this purpose👍).
Example 2:
In Example 2, the price level at point C on the 3-year shifted line becomes a major support three years later at point C, now aligning with the Base Power Law Line.
Finally, let's explore some future price predictions, as this script provides projections on the weekly timeframe :
Example 3:
In Example 3, the Bitcoin Power Law indicates that Bitcoin's price cannot surpass approximately $808K before 2030 as can be seen at point E, while also ensuring it will be at least $224K by then (point F).
Bitcoin Polynomial Regression ModelThis is the main version of the script. Click here for the Oscillator part of the script.
💡Why this model was created:
One of the key issues with most existing models, including our own Bitcoin Log Growth Curve Model , is that they often fail to realistically account for diminishing returns. As a result, they may present overly optimistic bull cycle targets (hence, we introduced alternative settings in our previous Bitcoin Log Growth Curve Model).
This new model however, has been built from the ground up with a primary focus on incorporating the principle of diminishing returns. It directly responds to this concept, which has been briefly explored here .
📉The theory of diminishing returns:
This theory suggests that as each four-year market cycle unfolds, volatility gradually decreases, leading to more tempered price movements. It also implies that the price increase from one cycle peak to the next will decrease over time as the asset matures. The same pattern applies to cycle lows and the relationship between tops and bottoms. In essence, these price movements are interconnected and should generally follow a consistent pattern. We believe this model provides a more realistic outlook on bull and bear market cycles.
To better understand this theory, the relationships between cycle tops and bottoms are outlined below:https://www.tradingview.com/x/7Hldzsf2/
🔧Creation of the model:
For those interested in how this model was created, the process is explained here. Otherwise, feel free to skip this section.
This model is based on two separate cubic polynomial regression lines. One for the top price trend and another for the bottom. Both follow the general cubic polynomial function:
ax^3 +bx^2 + cx + d.
In this equation, x represents the weekly bar index minus an offset, while a, b, c, and d are determined through polynomial regression analysis. The input (x, y) values used for the polynomial regression analysis are as follows:
Top regression line (x, y) values:
113, 18.6
240, 1004
451, 19128
655, 65502
Bottom regression line (x, y) values:
103, 2.5
267, 211
471, 3193
676, 16255
The values above correspond to historical Bitcoin cycle tops and bottoms, where x is the weekly bar index and y is the weekly closing price of Bitcoin. The best fit is determined using metrics such as R-squared values, residual error analysis, and visual inspection. While the exact details of this evaluation are beyond the scope of this post, the following optimal parameters were found:
Top regression line parameter values:
a: 0.000202798
b: 0.0872922
c: -30.88805
d: 1827.14113
Bottom regression line parameter values:
a: 0.000138314
b: -0.0768236
c: 13.90555
d: -765.8892
📊Polynomial Regression Oscillator:
This publication also includes the oscillator version of the this model which is displayed at the bottom of the screen. The oscillator applies a logarithmic transformation to the price and the regression lines using the formula log10(x) .
The log-transformed price is then normalized using min-max normalization relative to the log-transformed top and bottom regression line with the formula:
normalized price = log(close) - log(bottom regression line) / log(top regression line) - log(bottom regression line)
This transformation results in a price value between 0 and 1 between both the regression lines. The Oscillator version can be found here.
🔍Interpretation of the Model:
In general, the red area represents a caution zone, as historically, the price has often been near its cycle market top within this range. On the other hand, the green area is considered an area of opportunity, as historically, it has corresponded to the market bottom.
The top regression line serves as a signal for the absolute market cycle peak, while the bottom regression line indicates the absolute market cycle bottom.
Additionally, this model provides a predicted range for Bitcoin's future price movements, which can be used to make extrapolated predictions. We will explore this further below.
🔮Future Predictions:
Finally, let's discuss what this model actually predicts for the potential upcoming market cycle top and the corresponding market cycle bottom. In our previous post here , a cycle interval analysis was performed to predict a likely time window for the next cycle top and bottom:
In the image, it is predicted that the next top-to-top cycle interval will be 208 weeks, which translates to November 3rd, 2025. It is also predicted that the bottom-to-top cycle interval will be 152 weeks, which corresponds to October 13th, 2025. On the macro level, these two dates align quite well. For our prediction, we take the average of these two dates: October 24th 2025. This will be our target date for the bull cycle top.
Now, let's do the same for the upcoming cycle bottom. The bottom-to-bottom cycle interval is predicted to be 205 weeks, which translates to October 19th, 2026, and the top-to-bottom cycle interval is predicted to be 259 weeks, which corresponds to October 26th, 2026. We then take the average of these two dates, predicting a bear cycle bottom date target of October 19th, 2026.
Now that we have our predicted top and bottom cycle date targets, we can simply reference these two dates to our model, giving us the Bitcoin top price prediction in the range of 152,000 in Q4 2025 and a subsequent bottom price prediction in the range of 46,500 in Q4 2026.
For those interested in understanding what this specifically means for the predicted diminishing return top and bottom cycle values, the image below displays these predicted values. The new values are highlighted in yellow:
And of course, keep in mind that these targets are just rough estimates. While we've done our best to estimate these targets through a data-driven approach, markets will always remain unpredictable in nature. What are your targets? Feel free to share them in the comment section below.
Bitcoin Polynomial Regression OscillatorThis is the oscillator version of the script. Click here for the other part of the script.
💡Why this model was created:
One of the key issues with most existing models, including our own Bitcoin Log Growth Curve Model , is that they often fail to realistically account for diminishing returns. As a result, they may present overly optimistic bull cycle targets (hence, we introduced alternative settings in our previous Bitcoin Log Growth Curve Model).
This new model however, has been built from the ground up with a primary focus on incorporating the principle of diminishing returns. It directly responds to this concept, which has been briefly explored here .
📉The theory of diminishing returns:
This theory suggests that as each four-year market cycle unfolds, volatility gradually decreases, leading to more tempered price movements. It also implies that the price increase from one cycle peak to the next will decrease over time as the asset matures. The same pattern applies to cycle lows and the relationship between tops and bottoms. In essence, these price movements are interconnected and should generally follow a consistent pattern. We believe this model provides a more realistic outlook on bull and bear market cycles.
To better understand this theory, the relationships between cycle tops and bottoms are outlined below:https://www.tradingview.com/x/7Hldzsf2/
🔧Creation of the model:
For those interested in how this model was created, the process is explained here. Otherwise, feel free to skip this section.
This model is based on two separate cubic polynomial regression lines. One for the top price trend and another for the bottom. Both follow the general cubic polynomial function:
ax^3 +bx^2 + cx + d.
In this equation, x represents the weekly bar index minus an offset, while a, b, c, and d are determined through polynomial regression analysis. The input (x, y) values used for the polynomial regression analysis are as follows:
Top regression line (x, y) values:
113, 18.6
240, 1004
451, 19128
655, 65502
Bottom regression line (x, y) values:
103, 2.5
267, 211
471, 3193
676, 16255
The values above correspond to historical Bitcoin cycle tops and bottoms, where x is the weekly bar index and y is the weekly closing price of Bitcoin. The best fit is determined using metrics such as R-squared values, residual error analysis, and visual inspection. While the exact details of this evaluation are beyond the scope of this post, the following optimal parameters were found:
Top regression line parameter values:
a: 0.000202798
b: 0.0872922
c: -30.88805
d: 1827.14113
Bottom regression line parameter values:
a: 0.000138314
b: -0.0768236
c: 13.90555
d: -765.8892
📊Polynomial Regression Oscillator:
This publication also includes the oscillator version of the this model which is displayed at the bottom of the screen. The oscillator applies a logarithmic transformation to the price and the regression lines using the formula log10(x) .
The log-transformed price is then normalized using min-max normalization relative to the log-transformed top and bottom regression line with the formula:
normalized price = log(close) - log(bottom regression line) / log(top regression line) - log(bottom regression line)
This transformation results in a price value between 0 and 1 between both the regression lines.
🔍Interpretation of the Model:
In general, the red area represents a caution zone, as historically, the price has often been near its cycle market top within this range. On the other hand, the green area is considered an area of opportunity, as historically, it has corresponded to the market bottom.
The top regression line serves as a signal for the absolute market cycle peak, while the bottom regression line indicates the absolute market cycle bottom.
Additionally, this model provides a predicted range for Bitcoin's future price movements, which can be used to make extrapolated predictions. We will explore this further below.
🔮Future Predictions:
Finally, let's discuss what this model actually predicts for the potential upcoming market cycle top and the corresponding market cycle bottom. In our previous post here , a cycle interval analysis was performed to predict a likely time window for the next cycle top and bottom:
In the image, it is predicted that the next top-to-top cycle interval will be 208 weeks, which translates to November 3rd, 2025. It is also predicted that the bottom-to-top cycle interval will be 152 weeks, which corresponds to October 13th, 2025. On the macro level, these two dates align quite well. For our prediction, we take the average of these two dates: October 24th 2025. This will be our target date for the bull cycle top.
Now, let's do the same for the upcoming cycle bottom. The bottom-to-bottom cycle interval is predicted to be 205 weeks, which translates to October 19th, 2026, and the top-to-bottom cycle interval is predicted to be 259 weeks, which corresponds to October 26th, 2026. We then take the average of these two dates, predicting a bear cycle bottom date target of October 19th, 2026.
Now that we have our predicted top and bottom cycle date targets, we can simply reference these two dates to our model, giving us the Bitcoin top price prediction in the range of 152,000 in Q4 2025 and a subsequent bottom price prediction in the range of 46,500 in Q4 2026.
For those interested in understanding what this specifically means for the predicted diminishing return top and bottom cycle values, the image below displays these predicted values. The new values are highlighted in yellow:
And of course, keep in mind that these targets are just rough estimates. While we've done our best to estimate these targets through a data-driven approach, markets will always remain unpredictable in nature. What are your targets? Feel free to share them in the comment section below.
Multi-Anchored Linear Regression Channels [TANHEF]█ Overview:
The 'Multi-Anchored Linear Regression Channels ' plots multiple dynamic regression channels (or bands) with unique selectable calculation types for both regression and deviation. It leverages a variety of techniques, customizable anchor sources to determine regression lengths, and user-defined criteria to highlight potential opportunities.
Before getting started, it's worth exploring all sections, but make sure to review the Setup & Configuration section in particular. It covers key parameters like anchor type, regression length, bias, and signal criteria—essential for aligning the tool with your trading strategy.
█ Key Features:
⯁ Multi-Regression Capability:
Plot up to three distinct regression channels and/or bands simultaneously, each with customizable anchor types to define their length.
⯁ Regression & Deviation Methods:
Regressions Types:
Standard: Uses ordinary least squares to compute a simple linear trend by averaging the data and deriving a slope and endpoints over the lookback period.
Ridge: Introduces L2 regularization to stabilize the slope by penalizing large coefficients, which helps mitigate multicollinearity in the data.
Lasso: Uses L1 regularization through soft-thresholding to shrink less important coefficients, yielding a simpler model that highlights key trends.
Elastic Net: Combines L1 and L2 penalties to balance coefficient shrinkage and selection, producing a robust weighted slope that handles redundant predictors.
Huber: Implements the Huber loss with iteratively reweighted least squares (IRLS) and EMA-style weights to reduce the impact of outliers while estimating the slope.
Least Absolute Deviations (LAD): Reduces absolute errors using iteratively reweighted least squares (IRLS), yielding a slope less sensitive to outliers than squared-error methods.
Bayesian Linear: Merges prior beliefs with weighted data through Bayesian updating, balancing the prior slope with data evidence to derive a probabilistic trend.
Deviation Types:
Regressive Linear (Reverse): In reverse order (recent to oldest), compute weighted squared differences between the data and a line defined by a starting value and slope.
Progressive Linear (Forward): In forward order (oldest to recent), compute weighted squared differences between the data and a line defined by a starting value and slope.
Balanced Linear: In forward order (oldest to newest), compute regression, then pair to source data in reverse order (newest to oldest) to compute weighted squared differences.
Mean Absolute: Compute weighted absolute differences between each data point and its regression line value, then aggregate them to yield an average deviation.
Median Absolute: Determine the weighted median of the absolute differences between each data point and its regression line value to capture the central tendency of deviations.
Percent: Compute deviation as a percentage of a base value by multiplying that base by the specified percentage, yielding symmetric positive and negative deviations.
Fitted: Compare a regression line with high and low series values by computing weighted differences to determine the maximum upward and downward deviations.
Average True Range: Iteratively compute the weighted average of absolute differences between the data and its regression line to yield an ATR-style deviation measure.
Bias:
Bias: Applies EMA or inverse-EMA style weighting to both Regression and/or Deviation, emphasizing either recent or older data.
⯁ Customizable Regression Length via Anchors:
Anchor Types:
Fixed: Length.
Bar-Based: Bar Highest/Lowest, Volume Highest/Lowest, Spread Highest/Lowest.
Correlation: R Zero, R Highest, R Lowest, R Absolute.
Slope: Slope Zero, Slope Highest, Slope Lowest, Slope Absolute.
Indicator-Based: Indicators Highest/Lowest (ADX, ATR, BBW, CCI, MACD, RSI, Stoch).
Time-Based: Time (Day, Week, Month, Quarter, Year, Decade, Custom).
Session-Based: Session (Tokyo, London, New York, Sydney, Custom).
Event-Based: Earnings, Dividends, Splits.
External: Input Source Highest/Lowest.
Length Selection:
Maximum: The highest allowed regression length (also fixed value of “Length” anchor).
Minimum: The shortest allowed length, ensuring enough bars for a valid regression.
Step: The sampling interval (e.g., 1 checks every bar, 2 checks every other bar, etc.). Increasing the step reduces the loading time, most applicable to “Slope” and “R” anchors.
Adaptive lookback:
Adaptive Lookback: Enable to display regression regardless of too few historical bars.
⯁ Selecting Bias:
Bias applies separately to regression and deviation.
Positive values emphasize recent data (EMA-style), negative invert, and near-zero maintains balance. (e.g., a length 100, bias +1 gives the newest price ~7× more weight than the oldest).
It's best to apply bias to both (regression and deviation) or just the deviation. Biasing only regression may distort deviation visually, while biasing both keeps their relationship intuitive. Using bias only for deviation scales it without altering regression, offering unique analysis.
⯁ Scale Awareness:
Supports linear and logarithmic price scaling, the regression and deviations adjust accordingly.
⯁ Signal Generation & Alerts:
Customizable entry/exit signals and alerts, detailed in the dedicated section below.
⯁ Visual Enhancements & Real-World Examples:
Optional on-chart table display summarizing regression input criteria (display type, anchor type, source, regression type, regression bias, deviation type, deviation bias, deviation multiplier) and key calculated metrics (regression length, slope, Pearson’s R, percentage position within deviations, etc.) for quick reference.
█ Understanding R (Pearson Correlation Coefficient):
Pearson’s R gauges data alignment to a straight-line trend within the regression length:
Range: R varies between –1 and +1.
R = +1 → Perfect positive correlation (strong uptrend).
R = 0 → No linear relationship detected.
R = –1 → Perfect negative correlation (strong downtrend).
This script uses Pearson’s R as an anchor, adjusting regression length to target specific R traits. Strong R (±1) follows the regression channel, while weak R (0) shows inconsistency.
█ Understanding the Slope:
The slope is the direction and rate at which the regression line rises or falls per bar:
Positive Slope (>0): Uptrend – Steeper means faster increase.
Negative Slope (<0): Downtrend – Steeper means sharper drop.
Zero or Near-Zero Slope: Sideways – Indicating range-bound conditions.
This script uses highest and lowest slope as an anchor, where extremes highlight strong moves and trend lines, while values near zero indicate sideways action and possible support/resistance.
█ Setup & Configuration:
Whether you’re new to this script or want to quickly adjust all critical parameters, the panel below shows the main settings available. You can customize everything from the anchor type and maximum length to the bias, signal conditions, and more.
Scale (select Log Scale for logarithmic, otherwise linear scale).
Display (regression channel and/or bands).
Anchor (how regression length is determined).
Length (control bars analyzed):
• Max – Upper limit.
• Min – Prevents regression from becoming too short.
• Step – Controls scanning precision; increasing Step reduces load time.
Regression:
• Type – Calculation method.
• Bias – EMA-style emphasis (>0=new bars weighted more; <0=old bars weighted more).
Deviation:
• Type – Calculation method.
• Bias – EMA-style emphasis (>0=new bars weighted more; <0=old bars weighted more).
• Multiplier - Adjusts Upper and Lower Deviation.
Signal Criteria:
• % (Price vs Deviation) – (0% = lower deviation, 50% = regression, 100% = upper deviation).
• R – (0 = no correlation, ±1 = perfect correlation; >0 = +slope, <0 = -slope).
Table (analyze table of input settings, calculated results, and signal criteria).
Adaptive Lookback (display regression while too few historical bars).
Multiple Regressions (steps 2 to 7 apply to #1, #2, and #3 regressions).
█ Signal Generation & Alerts:
The script offers customizable entry and exit signals with flexible criteria and visual cues (background color, dots, or triangles). Alerts can also be triggered for these opportunities.
Percent Direction Criteria:
(0% = lower deviation, 50% = regression line, 100% = upper deviation)
Above %: Triggers if price is above a specified percent of the deviation channel.
Below %: Triggers if price is below a specified percent of the deviation channel.
(Blank): Ignores the percent‐based condition.
Pearson's R (Correlation) Direction Criteria:
(0 = no correlation, ±1 = perfect correlation; >0 = positive slope, <0 = negative slope)
Above R / Below R: Compares the correlation to a threshold.
Above│R│ / Below│R│: Uses absolute correlation to focus on strength, ignoring direction.
Zero to R: Checks if R is in the 0-to-threshold range.
(Blank): Ignores correlation-based conditions.
█ User Tips & Best Practices:
Choose an anchor type that suits your strategy, “Bar Highest/Lowest” automatically spots commonly used regression zones, while “│R│ Highest” targets strong linear trends.
Consider enabling or disabling the Adaptive Lookback feature to ensure you always have a plotted regression if your chart doesn’t meet the maximum-length requirement.
Use a small Step size (1) unless relying on R-correlation or slope-based anchors as the are time-consuming to calculate. Larger steps speed up calculations but reduce precision.
Fine-tune settings such as lookback periods, regression bias, and deviation multipliers, or trend strength. Small adjustments can significantly affect how channels and signals behave.
To reduce loading time , show only channels (not bands) and disable signals, this limits calculations to the last bar and supports more extreme criteria.
Use the table display to monitor anchor type, calculated length, slope, R value, and percent location at a glance—especially if you have multiple regressions visible simultaneously.
█ Conclusion:
With its blend of advanced regression techniques, flexible deviation options, and a wide range of anchor types, this indicator offers a highly adaptable linear regression channeling system. Whether you're anchoring to time, price extremes, correlation, slope, or external events, the tool can be shaped to fit a variety of strategies. Combined with customizable signals and alerts, it may help highlight areas of confluence and support a more structured approach to identifying potential opportunities.
LinearRegressionLibrary "LinearRegression"
Calculates a variety of linear regression and deviation types, with optional emphasis weighting. Additionally, multiple of slope and Pearson’s R calculations.
calcSlope(_src, _len, _condition)
Calculates the slope of a linear regression over the specified length.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The length of the lookback period for the linear regression.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast for efficiency.
Returns: (float) The slope of the linear regression.
calcReg(_src, _len, _condition)
Calculates a basic linear regression, returning y1, y2, slope, and average.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) An array of 4 values: .
calcRegStandard(_src, _len, _emphasis, _condition)
Calculates an Standard linear regression with optional emphasis.
Parameters:
_src (float) : (series float) The source data series.
_len (int) : (int) The length of the lookback period.
_emphasis (float) : (float) The emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRegRidge(_src, _len, lambda, _emphasis, _condition)
Calculates a ridge regression with optional emphasis.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
lambda (float) : (float) The ridge regularization parameter.
_emphasis (float) : (float) The emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRegLasso(_src, _len, lambda, _emphasis, _condition)
Calculates a Lasso regression with optional emphasis.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
lambda (float) : (float) The Lasso regularization parameter.
_emphasis (float) : (float) The emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcElasticNetLinReg(_src, _len, lambda1, lambda2, _emphasis, _condition)
Calculates an Elastic Net regression with optional emphasis.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
lambda1 (float) : (float) L1 regularization parameter (Lasso).
lambda2 (float) : (float) L2 regularization parameter (Ridge).
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRegHuber(_src, _len, delta, iterations, _emphasis, _condition)
Calculates a Huber regression using Iteratively Reweighted Least Squares (IRLS).
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
delta (float) : (float) Huber threshold parameter.
iterations (int) : (int) Number of IRLS iterations.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRegLAD(_src, _len, iterations, _emphasis, _condition)
Calculates a Least Absolute Deviations (LAD) regression via IRLS.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
iterations (int) : (int) Number of IRLS iterations for LAD.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRegBayesian(_src, _len, priorMean, priorSpan, sigma, _emphasis, _condition)
Calculates a Bayesian linear regression with optional emphasis.
Parameters:
_src (float) : (float) The source data series.
_len (int) : (int) The length of the lookback period.
priorMean (float) : (float) The prior mean for the slope.
priorSpan (float) : (float) The prior variance (or span) for the slope.
sigma (float) : (float) The assumed standard deviation of residuals.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: (float ) .
calcRFromLinReg(_src, _len, _slope, _average, _y1, _condition)
Calculates the Pearson correlation coefficient (R) based on linear regression parameters.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_average (float) : (float) The average value of the source data series.
_y1 (float) : (float) The starting point (y-intercept of the oldest bar) for the linear regression.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast for efficiency.
Returns: (float) The Pearson correlation coefficient (R) adjusted for the direction of the slope.
calcRFromSource(_src, _len, _condition)
Calculates the correlation coefficient (R) using a specified length and source data.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The length of the lookback period.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast for efficiency.
Returns: (float) The correlation coefficient (R).
calcSlopeLengthZero(_src, _len, _minLen, _step, _condition)
Identifies the length at which the slope is flattest (closest to zero).
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length to consider (minimum of 2).
_minLen (int) : (int) The minimum length to start from (cannot exceed the max length).
_step (int) : (int) The increment step for lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length at which the slope is flattest.
calcSlopeLengthHighest(_src, _len, _minLen, _step, _condition)
Identifies the length at which the slope is highest.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length at which the slope is highest.
calcSlopeLengthLowest(_src, _len, _minLen, _step, _condition)
Identifies the length at which the slope is lowest.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length at which the slope is lowest.
calcSlopeLengthAbsolute(_src, _len, _minLen, _step, _condition)
Identifies the length at which the absolute slope value is highest.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length at which the absolute slope value is highest.
calcRLengthZero(_src, _len, _minLen, _step, _condition)
Identifies the length with the lowest absolute R value.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length with the lowest absolute R value.
calcRLengthHighest(_src, _len, _minLen, _step, _condition)
Identifies the length with the highest R value.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length with the highest R value.
calcRLengthLowest(_src, _len, _minLen, _step, _condition)
Identifies the length with the lowest R value.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length with the lowest R value.
calcRLengthAbsolute(_src, _len, _minLen, _step, _condition)
Identifies the length with the highest absolute R value.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The maximum lookback length (minimum of 2).
_minLen (int) : (int) The minimum length to start from.
_step (int) : (int) The step for incrementing lengths.
_condition (bool) : (bool) Flag to enable calculation. Set to true to calculate on every bar; otherwise, set to barstate.islast.
Returns: (int) The length with the highest absolute R value.
calcDevReverse(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates the regressive linear deviation in reverse order, with optional emphasis on recent data.
Parameters:
_src (float) : (float) The source data.
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The y-intercept (oldest bar) of the linear regression.
_inputDev (float) : (float) The input deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevForward(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates the progressive linear deviation in forward order (oldest to most recent bar), with optional emphasis.
Parameters:
_src (float) : (float) The source data array, where _src is oldest and _src is most recent.
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The y-intercept of the linear regression (value at the most recent bar, adjusted by slope).
_inputDev (float) : (float) The input deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevBalanced(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates the balanced linear deviation with optional emphasis on recent or older data.
Parameters:
_src (float) : (float) Source data array, where _src is the most recent and _src is the oldest.
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The y-intercept of the linear regression (value at the oldest bar).
_inputDev (float) : (float) The input deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevMean(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates the mean absolute deviation from a forward-applied linear trend (oldest to most recent), with optional emphasis.
Parameters:
_src (float) : (float) The source data array, where _src is the most recent and _src is the oldest.
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The y-intercept (oldest bar) of the linear regression.
_inputDev (float) : (float) The input deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevMedian(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates the median absolute deviation with optional emphasis on recent data.
Parameters:
_src (float) : (float) The source data array (index 0 = oldest, index _len - 1 = most recent).
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The y-intercept (oldest bar) of the linear regression.
_inputDev (float) : (float) The deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns:
calcDevPercent(_y1, _inputDev, _condition)
Calculates the percent deviation from a given value and a specified percentage.
Parameters:
_y1 (float) : (float) The base value from which to calculate deviation.
_inputDev (float) : (float) The deviation percentage.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevFitted(_len, _slope, _y1, _emphasis, _condition)
Calculates the weighted fitted deviation based on high and low series data, showing max deviation, with optional emphasis.
Parameters:
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The Y-intercept (oldest bar) of the linear regression.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcDevATR(_src, _len, _slope, _y1, _inputDev, _emphasis, _condition)
Calculates an ATR-style deviation with optional emphasis on recent data.
Parameters:
_src (float) : (float) The source data (typically close).
_len (int) : (int) The length of the lookback period.
_slope (float) : (float) The slope of the linear regression.
_y1 (float) : (float) The Y-intercept (oldest bar) of the linear regression.
_inputDev (float) : (float) The input deviation multiplier.
_emphasis (float) : (float) Emphasis factor: 0 for equal weight; >0 emphasizes recent bars; <0 emphasizes older bars.
_condition (bool) : (bool) Flag to enable calculation (true = calculate).
Returns: A 2-element tuple: .
calcPricePositionPercent(_top, _bot, _src)
Calculates the percent position of a price within a linear regression channel. Top=100%, Bottom=0%.
Parameters:
_top (float) : (float) The top (positive) deviation, corresponding to 100%.
_bot (float) : (float) The bottom (negative) deviation, corresponding to 0%.
_src (float) : (float) The source price.
Returns: (float) The percent position within the channel.
plotLinReg(_len, _y1, _y2, _slope, _devTop, _devBot, _scaleTypeLog, _lineWidth, _extendLines, _channelStyle, _colorFill, _colUpLine, _colDnLine, _colUpFill, _colDnFill)
Plots the linear regression line and its deviations, with configurable styles and fill.
Parameters:
_len (int) : (int) The lookback period for the linear regression.
_y1 (float) : (float) The starting y-value of the regression line.
_y2 (float) : (float) The ending y-value of the regression line.
_slope (float) : (float) The slope of the regression line (used to determine line color).
_devTop (float) : (float) The top deviation to add to the line.
_devBot (float) : (float) The bottom deviation to subtract from the line.
_scaleTypeLog (bool) : (bool) Use a log scale if true; otherwise, linear scale.
_lineWidth (int) : (int) The width of the plotted lines.
_extendLines (string) : (string) How lines should extend (none, left, right, both).
_channelStyle (string) : (string) The style of the channel lines (solid, dashed, dotted).
_colorFill (bool) : (bool) Whether to fill the space between the top and bottom deviation lines.
_colUpLine (color) : (color) Line color when slope is positive.
_colDnLine (color) : (color) Line color when slope is negative.
_colUpFill (color) : (color) Fill color when slope is positive.
_colDnFill (color) : (color) Fill color when slope is negative.
[iQ]PRO Master iQWave SystemWelcome to the PRO Master iQWave System, an exclusive, ndicator crafted for TradingView. This cutting-edge tool harnesses sophisticated mathematical models to deliver precise buy and sell signals, empowering traders with a comprehensive view of market dynamics.
Key Features
Advanced Analytical Framework: Seamlessly integrates state-of-the-art techniques in signal processing, statistical analysis, and market profiling to uncover high-probability trading opportunities.
Holistic Market Insight: Combines proprietary methods for data transformation, frequency-based cycle detection, adaptive trend and seasonality extraction, and moment-driven anomaly identification—offering a multi-dimensional approach to price analysis.
Customizable Precision: With a wide range of user inputs, traders can tailor the system to their unique strategies and adapt it to diverse market conditions, ensuring flexibility across asset classes and timeframes.
Intuitive Visual Feedback: Displays critical insights directly on your chart, including adaptive fits, statistical boundaries, market profile levels, and a clear, actionable signal label—making complex analysis accessible at a glance.
Why Choose PRO Master iQWave System?
Designed for experienced traders, this indicator stands out by blending advanced analytics with practical usability. Whether you're identifying reversals, filtering noise, or gauging market structure, the PRO Master iQWave System equips you with a robust, all-in-one solution. Its proprietary algorithms distill intricate market data into actionable signals, helping you stay ahead of the curve.
Elevate Your Trading
Experience the power of next-level technical analysis. The PRO Master iQWave System is more than an indicator—it's a strategic edge, reserved for those ready to unlock its potential. Take your trading to new heights with this exclusive tool, available only by invitation.
ADvM, of MMiQ
Logarithmic Regression Channel-Trend [BigBeluga]
This indicator utilizes logarithmic regression to track price trends and identify overbought and oversold conditions within a trend. It provides traders with a dynamic channel based on logarithmic regression, offering insights into trend strength and potential reversal zones.
🔵Key Features:
Logarithmic Regression Trend Tracking: Uses log regression to model price trends and determine trend direction dynamically.
f_log_regression(src, length) =>
float sumX = 0.0
float sumY = 0.0
float sumXSqr = 0.0
float sumXY = 0.0
for i = 0 to length - 1
val = math.log(src )
per = i + 1.0
sumX += per
sumY += val
sumXSqr += per * per
sumXY += val * per
slope = (length * sumXY - sumX * sumY) / (length * sumXSqr - sumX * sumX)
average = sumY / length
intercept = average - slope * sumX / length + slope
Regression-Based Channel: Plots a log regression channel around the price to highlight overbought and oversold conditions.
Adaptive Trend Colors: The color of the regression trend adjusts dynamically based on price movement.
Trend Shift Signals: Marks trend reversals when the log regression line cross the log regression line 3 bars back.
Dashboard for Key Insights: Displays:
- The regression slope (multiplied by 100 for better scale).
- The direction of the regression channel.
- The trend status of the logarithmic regression band.
🔵Usage:
Trend Identification: Observe the regression slope and channel direction to determine bullish or bearish trends.
Overbought/Oversold Conditions: Use the channel boundaries to spot potential reversal zones when price deviates significantly.
Breakout & Continuation Signals: Price breaking outside the channel may indicate strong trend continuation or exhaustion.
Confirmation with Other Indicators: Combine with volume or momentum indicators to strengthen trend confirmation.
Customizable Display: Users can modify the lookback period, channel width, midline visibility, and color preferences.
Logarithmic Regression Channel-Trend is an essential tool for traders who want a dynamic, regression-based approach to market trends while monitoring potential price extremes.
Adaptive Trend FinderAdaptive Trend Finder - The Ultimate Trend Detection Tool
Introducing Adaptive Trend Finder, the next evolution of trend analysis on TradingView. This powerful indicator is an enhanced and refined version of Adaptive Trend Finder (Log), designed to offer even greater flexibility, accuracy, and ease of use.
What’s New?
Unlike the previous version, Adaptive Trend Finder allows users to fully configure and adjust settings directly within the indicator menu, eliminating the need to modify chart settings manually. A major improvement is that users no longer need to adjust the chart's logarithmic scale manually in the chart settings; this can now be done directly within the indicator options, ensuring a smoother and more efficient experience. This makes it easier to switch between linear and logarithmic scaling without disrupting the analysis. This provides a seamless user experience where traders can instantly adapt the indicator to their needs without extra steps.
One of the most significant improvements is the complete code overhaul, which now enables simultaneous visualization of both long-term and short-term trend channels without needing to add the indicator twice. This not only improves workflow efficiency but also enhances chart readability by allowing traders to monitor multiple trend perspectives at once.
The interface has been entirely redesigned for a more intuitive user experience. Menus are now clearer, better structured, and offer more customization options, making it easier than ever to fine-tune the indicator to fit any trading strategy.
Key Features & Benefits
Automatic Trend Period Selection: The indicator dynamically identifies and applies the strongest trend period, ensuring optimal trend detection with no manual adjustments required. By analyzing historical price correlations, it selects the most statistically relevant trend duration automatically.
Dual Channel Display: Traders can view both long-term and short-term trend channels simultaneously, offering a broader perspective of market movements. This feature eliminates the need to apply the indicator twice, reducing screen clutter and improving efficiency.
Fully Adjustable Settings: Users can customize trend detection parameters directly within the indicator settings. No more switching chart settings – everything is accessible in one place.
Trend Strength & Confidence Metrics: The indicator calculates and displays a confidence score for each detected trend using Pearson correlation values. This helps traders gauge the reliability of a given trend before making decisions.
Midline & Channel Transparency Options: Users can fine-tune the visibility of trend channels, adjusting transparency levels to fit their personal charting style without overwhelming the price chart.
Annualized Return Calculation: For daily and weekly timeframes, the indicator provides an estimate of the trend’s performance over a year, helping traders evaluate potential long-term profitability.
Logarithmic Adjustment Support: Adaptive Trend Finder is compatible with both logarithmic and linear charts. Traders who analyze assets like cryptocurrencies, where log scaling is common, can enable this feature to refine trend calculations.
Intuitive & User-Friendly Interface: The updated menu structure is designed for ease of use, allowing quick and efficient modifications to settings, reducing the learning curve for new users.
Why is this the Best Trend Indicator?
Adaptive Trend Finder stands out as one of the most advanced trend analysis tools available on TradingView. Unlike conventional trend indicators, which rely on fixed parameters or lagging signals, Adaptive Trend Finder dynamically adjusts its settings based on real-time market conditions. By combining automatic trend detection, dual-channel visualization, real-time performance metrics, and an intuitive user interface, this indicator offers an unparalleled edge in trend identification and trading decision-making.
Traders no longer have to rely on guesswork or manually tweak settings to identify trends. Adaptive Trend Finder does the heavy lifting, ensuring that users are always working with the strongest and most reliable trends. The ability to simultaneously display both short-term and long-term trends allows for a more comprehensive market overview, making it ideal for scalpers, swing traders, and long-term investors alike.
With its state-of-the-art algorithms, fully customizable interface, and professional-grade accuracy, Adaptive Trend Finder is undoubtedly one of the most powerful trend indicators available.
Try it today and experience the future of trend analysis.
This indicator is a technical analysis tool designed to assist traders in identifying trends. It does not guarantee future performance or profitability. Users should conduct their own research and apply proper risk management before making trading decisions.
// Created by Julien Eche - @Julien_Eche
Smoothed Gaussian Trend Filter [AlgoAlpha]Experience seamless trend detection and market analysis with the Smoothed Gaussian Trend Filter by AlgoAlpha! This cutting-edge indicator combines advanced Gaussian filtering with linear regression smoothing to identify and enhance market trends, making it an essential tool for traders seeking precise and actionable signals.
Key Features :
🔍 Gaussian Trend Filtering: Utilizes a customizable Gaussian filter with adjustable length and pole settings for tailored smoothing and trend identification.
📊 Linear Regression Smoothing: Reduces noise and further refines the Gaussian output with user-defined smoothing length and offset, ensuring clarity in trend representation.
✨ Dynamic Visual Highlights: Highlights trends and signals based on volume intensity, allowing for real-time insights into market behavior.
📉 Choppy Market Detection: Identifies ranging or choppy markets, helping traders avoid false signals.
🔔 Custom Alerts: Set alerts for bullish and bearish signals, trend reversals, or choppy market conditions to stay on top of trading opportunities.
🎨 Color-Coded Visuals: Fully customizable colors for bullish and bearish signals, ensuring clear and intuitive chart analysis.
How to Use :
Add the Indicator: Add it to your favorites and apply it to your TradingView chart.
Interpret the Chart: Observe the trend line for directional changes and use the accompanying buy/sell signals for entry and exit opportunities. Choppy market conditions are flagged for additional caution.
Set Alerts: Enable alerts for trend signals or choppy market detections to act promptly without constant chart monitoring.
How It Works :
The Smoothed Gaussian Trend Filter uses a combination of advanced smoothing techniques to identify trends and enhance market clarity. First, a Gaussian filter is applied to price data, using a user-defined length (Gaussian length) and poles (smoothness level) to calculate an alpha value that determines the degree of smoothing. This creates a refined trend line that minimizes noise while preserving key market movements. The output is then further processed using linear regression smoothing, allowing traders to adjust the length and offset to flatten minor oscillations and emphasize the dominant trend. To incorporate market activity, volume intensity is analyzed through a normalized Hull Moving Average (HMA), dynamically adjusting the trend line's color transparency based on trading activity. The indicator also identifies trend direction by comparing the smoothed trend line with a calculated SuperTrend-style level, generating clear trend regimes and highlighting ranging or choppy conditions where trends are less reliable and avoiding false signals. This seamless integration of Gaussian smoothing, regression analysis, and volume dynamics provides traders with a powerful and intuitive tool for market analysis.
Mean Reversion IndicatorSMA with Deviation and Z-Score Indicator
Overview:
This indicator combines the Simple Moving Average (SMA) with statistical measures of price deviation to identify potential buy and sell signals based on mean reversion principles. It calculates the Z-Score, which quantifies how far the current price is from its moving average in terms of standard deviations, helping traders spot when an asset might be overbought or oversold.
Key Features:
SMA Calculation: Uses a user-defined period to compute a Simple Moving Average, providing a baseline for price movement.
Z-Score: Measures the number of standard deviations the current price is from the SMA. This is crucial for identifying extreme price movements.
Formula: Z-Score = (Current Price - SMA) / Standard Deviation
Signal Generation:
Buy Signal: Generated when the Z-Score falls below a predefined threshold, suggesting the price is significantly below its mean and potentially undervalued.
Sell Signal: Triggered when the Z-Score exceeds another threshold, indicating the price is significantly above its mean and possibly overvalued.
Visual Indicators:
SMA Line: Plotted in blue on the chart for easy reference.
Z-Score Line: Available but hidden by default, can be shown if needed for deeper analysis.
Buy/Sell Signals: Represented by green up-arrows for buy signals and red down-arrows for sell signals.
Background Color: Changes to green or red subtly to indicate buy or sell zones based on Z-Score thresholds.
Z-Score Label: Provides the numerical Z-Score for each bar, aiding in precise decision-making.
Customizable Parameters:
SMA Length: Adjust the period over which the SMA is calculated.
Lookback Period: Set the number of periods for calculating the standard deviation and Z-Score.
Buy/Sell Z-Scores: Thresholds for generating buy and sell signals can be tailored to your strategy or market conditions. FX:EURUSD FX:EURUSD
Usage Tips:
This indicator is best used in conjunction with other forms of analysis for confirmation. Mean reversion does not always hold in trending markets.
Adjust the Z-Score thresholds based on asset volatility for more or less frequent signals.
Backtest with historical data to optimize settings for your specific trading approach.
Note: While this indicator can help identify potential trading opportunities based on statistical anomalies, it does not guarantee success and should be part of a broader trading strategy that includes risk management and market context understanding.
LRI Momentum Cycles [AlgoAlpha]Discover the LRI Momentum Cycles indicator by AlgoAlpha, a cutting-edge tool designed to identify market momentum shifts using trend normalization and linear regression analysis. This advanced indicator helps traders detect bullish and bearish cycles with enhanced accuracy, making it ideal for swing traders and intraday enthusiasts alike.
Key Features :
🎨 Customizable Appearance : Set personalized colors for bullish and bearish trends to match your charting style.
🔧 Dynamic Trend Analysis : Tracks market momentum using a unique trend normalization algorithm.
📊 Linear Regression Insight : Calculates real-time trend direction using linear regression for better precision.
🔔 Alert Notifications : Receive alerts when the market switches from bearish to bullish or vice versa.
How to Use :
🛠 Add the Indicator : Favorite and apply the indicator to your TradingView chart. Adjust the lookback period, linear regression source, and regression length to fit your strategy.
📊 Market Analysis : Watch for color changes on the trend line. Green signals bullish momentum, while red indicates bearish cycles. Use these shifts to time entries and exits.
🔔 Set Alerts : Enable notifications for momentum shifts, ensuring you never miss critical market moves.
How It Works :
The LRI Momentum Cycles indicator calculates trend direction by applying linear regression on a user-defined price source over a specified period. It compares historical trend values, detecting bullish or bearish momentum through a dynamic scoring system. This score is normalized to ensure consistent readings, regardless of market conditions. The indicator visually represents trends using gradient-colored plots and fills to highlight changes in momentum. Alerts trigger when the momentum state changes, providing actionable trading signals.
Log Regression OscillatorThe Log Regression Oscillator transforms the logarithmic regression curves into an easy-to-interpret oscillator that displays potential cycle tops/bottoms.
🔶 USAGE
Calculating the logarithmic regression of long-term swings can help show future tops/bottoms. The relationship between previous swing points is calculated and projected further. The calculated levels are directly associated with swing points, which means every swing point will change the calculation. Importantly, all levels will be updated through all bars when a new swing is detected.
The "Log Regression Oscillator" transforms the calculated levels, where the top level is regarded as 100 and the bottom level as 0. The price values are displayed in between and calculated as a ratio between the top and bottom, resulting in a clear view of where the price is situated.
The main picture contains the Logarithmic Regression Alternative on the chart to compare with this published script.
Included are the levels 30 and 70. In the example of Bitcoin, previous cycles showed a similar pattern: the bullish parabolic was halfway when the oscillator passed the 30-level, and the top was very near when passing the 70-level.
🔹 Proactive
A "Proactive" option is included, which ensures immediate calculations of tentative unconfirmed swings.
Instead of waiting 300 bars for confirmation, the "Proactive" mode will display a gray-white dot (not confirmed swing) and add the unconfirmed Swing value to the calculation.
The above example shows that the "Calculated Values" of the potential future top and bottom are adjusted, including the provisional swing.
When the swing is confirmed, the calculations are again adjusted, showing a red dot (confirmed top swing) or a green dot (confirmed bottom swing).
🔹 Dashboard
When less than two swings are available (top/bottom), this will be shown in the dashboard.
The user can lower the "Threshold" value or switch to a lower timeframe.
🔹 Notes
Logarithmic regression is typically used to model situations where growth or decay accelerates rapidly at first and then slows over time, meaning some symbols/tickers will fit better than others.
Since the logarithmic regression depends on swing values, each new value will change the calculation. A well-fitted model could not fit anymore in the future.
Users have to check the validity of swings; for example, if the direction of swings is downwards, then the dataset is not fitted for logarithmic regression.
In the example above, the "Threshold" is lowered. However, the calculated levels are unreliable due to the swings, which do not fit the model well.
Here, the combination of downward bottom swings and price accelerates slower at first and faster recently, resulting in a non-fit for the logarithmic regression model.
Note the price value (white line) is bound to a limit of 150 (upwards) and -150 (down)
In short, logarithmic regression is best used when there are enough tops/bottoms, and all tops are around 100, and all bottoms around 0.
Also, note that this indicator has been developed for a daily (or higher) timeframe chart.
🔶 DETAILS
In mathematics, the dot product or scalar product is an algebraic operation that takes two equal-length sequences of numbers (arrays) and returns a single number, the sum of the products of the corresponding entries of the two sequences of numbers.
The usual way is to loop through both arrays and sum the products.
In this case, the two arrays are transformed into a matrix, wherein in one matrix, a single column is filled with the first array values, and in the second matrix, a single row is filled with the second array values.
After this, the function matrix.mult() returns a new matrix resulting from the product between the matrices m1 and m2.
Then, the matrix.eigenvalues() function transforms this matrix into an array, where the array.sum() function finally returns the sum of the array's elements, which is the dot product.
dot(x, y)=>
if x.size() > 1 and y.size() > 1
m1 = matrix.new()
m2 = matrix.new()
m1.add_col(m1.columns(), y)
m2.add_row(m2.rows (), x)
m1.mult (m2)
.eigenvalues()
.sum()
🔶 SETTINGS
Threshold: Period used for the swing detection, with higher values returning longer-term Swing Levels.
Proactive: Tentative Swings are included with this setting enabled.
Style: Color Settings
Dashboard: Toggle, "Location" and "Text Size"
Linear Regression Channel [TradingFinder] Existing Trend Line🔵 Introduction
The Linear Regression Channel indicator is one of the technical analysis tool, widely used to identify support, resistance, and analyze upward and downward trends.
The Linear Regression Channel comprises five main components : the midline, representing the linear regression line, and the support and resistance lines, which are calculated based on the distance from the midline using either standard deviation or ATR.
This indicator leverages linear regression to forecast price changes based on historical data and encapsulates price movements within a price channel.
The upper and lower lines of the channel, which define resistance and support levels, assist traders in pinpointing entry and exit points, ultimately aiding better trading decisions.
When prices approach these channel lines, the likelihood of interaction with support or resistance levels increases, and breaking through these lines may signal a price reversal or continuation.
Due to its precision in identifying price trends, analyzing trend reversals, and determining key price levels, the Linear Regression Channel indicator is widely regarded as a reliable tool across financial markets such as Forex, stocks, and cryptocurrencies.
🔵 How to Use
🟣 Identifying Entry Signals
One of the primary uses of this indicator is recognizing buy signals. The lower channel line acts as a support level, and when the price nears this line, the likelihood of an upward reversal increases.
In an uptrend : When the price approaches the lower channel line and signs of upward reversal (e.g., reversal candlesticks or high trading volume) are observed, it is considered a buy signal.
In a downtrend : If the price breaks the lower channel line and subsequently re-enters the channel, it may signal a trend change, offering a buying opportunity.
🟣 Identifying Exit Signals
The Linear Regression Channel is also used to identify sell signals. The upper channel line generally acts as a resistance level, and when the price approaches this line, the likelihood of a price decrease increases.
In an uptrend : Approaching the upper channel line and observing weakness in the uptrend (e.g., declining volume or reversal patterns) indicates a sell signal.
In a downtrend : When the price reaches the upper channel line and reverses downward, this is considered a signal to exit trades.
🟣 Analyzing Channel Breakouts
The Linear Regression Channel allows traders to identify price breakouts as strong signals of potential trend changes.
Breaking the upper channel line : Indicates buyer strength and the likelihood of a continued uptrend, often accompanied by increased trading volume.
Breaking the lower channel line : Suggests seller dominance and the possibility of a continued downtrend, providing a strong sell signal.
🟣 Mean Reversion Analysis
A key concept in using the Linear Regression Channel is the tendency for prices to revert to the midline of the channel, which acts as a dynamic moving average, reflecting the price's equilibrium over time.
In uptrends : Significant deviations from the midline increase the likelihood of a price retracement toward the midline.
In downtrends : When prices deviate considerably from the midline, a return toward the midline can be used to identify potential reversal points.
🔵 Settings
🟣 Time Frame
The time frame setting enables users to view higher time frame data on a lower time frame chart. This feature is especially useful for traders employing multi-time frame analysis.
🟣 Regression Type
Standard : Utilizes classical linear regression to draw the midline and channel lines.
Advanced : Produces similar results to the standard method but may provide slightly different alignment on the chart.
🟣 Scaling Type
Standard Deviation : Suitable for markets with stable volatility.
ATR (Average True Range) : Ideal for markets with higher volatility.
🟣 Scaling Coefficients
Larger coefficients create broader channels for broader trend analysis.
Smaller coefficients produce tighter channels for precision analysis.
🟣 Channel Extension
None : No extension.
Left: Extends lines to the left to analyze historical trends.
Right : Extends lines to the right for future predictions.
Both : Extends lines in both directions.
🔵 Conclusion
The Linear Regression Channel indicator is a versatile and powerful tool in technical analysis, providing traders with support, resistance, and midline insights to better understand price behavior. Its advanced settings, including time frame selection, regression type, scaling options, and customizable coefficients, allow for tailored and precise analysis.
One of its standout advantages is its ability to support multi-time frame analysis, enabling traders to view higher time frame data within a lower time frame context. The option to use scaling methods like ATR or standard deviation further enhances its adaptability to markets with varying volatility.
Designed to identify entry and exit signals, analyze mean reversion, and assess channel breakouts, this indicator is suitable for a wide range of markets, including Forex, stocks, and cryptocurrencies. By incorporating this tool into your trading strategy, you can make more informed decisions and improve the accuracy of your market predictions.
Scatter PlotThe Price Volume Scatter Plot publication aims to provide intrabar detail as a Scatter Plot .
🔶 USAGE
A dot is drawn at every intrabar close price and its corresponding volume , as can seen in the following example:
Price is placed against the white y-axis, where volume is represented on the orange x-axis.
🔹 More detail
A Scatter Plot can be beneficial because it shows more detail compared with a Volume Profile (seen at the right of the Scatter Plot).
The Scatter Plot is accompanied by a "Line of Best Fit" (linear regression line) to help identify the underlying direction, which can be helpful in interpretation/evaluation.
It can be set as a screener by putting multiple layouts together.
🔹 Easier Interpretation
Instead of analysing the 1-minute chart together with volume, this can be visualised in the Scatter Plot, giving a straightforward and easy-to-interpret image of intrabar volume per price level.
One of the scatter plot's advantages is that volumes at the same price level are added to each other.
A dot on the scatter plot represents the cumulated amount of volume at that particular price level, regardless of whether the price closed one or more times at that price level.
Depending on the setting "Direction" , which sets the direction of the Volume-axis, users can hoover to see the corresponding price/volume.
🔹 Highest Intrabar Volume Values
Users can display up to 5 last maximum intrabar volume values, together with the intrabar timeframe (Res)
🔹 Practical Examples
When we divide the recent bar into three parts, the following can be noticed:
Price spends most of its time in the upper part, with relative medium-low volume, since the intrabar close prices are mostly situated in the upper left quadrant.
Price spends a shorter time in the middle part, with relative medium-low volume.
Price moved rarely below 61800 (the lowest part), but it was associated with high volume. None of the intrabar close prices reached the lowest area, and the price bounced back.
In the following example, the latest weekly candle shows a rejection of the 45.8 - 48.5K area, with the highest volume at the 45.8K level.
The next three successive candles show a declining maximum intrabar volume, after which the price broke through the 45.8K area.
🔹 Visual Options
There are many visual options available.
🔹 Change Direction
The Scatter Plot can be set in 4 different directions.
🔶 NOTES
🔹 Notes
The script uses the maximum available resources to draw the price/volume dots, which are 500 boxes and 500 labels. When the population size exceeds 1000, a warning is provided ( Not all data is shown ); otherwise, only the population size is displayed.
The Scatter Plot ideally needs a chart which contains at least 100 bars. When it contains less, a warning will be shown: bars < 100, not all data is shown
🔹 LTF Settings
When 'Auto' is enabled ( Settings , LTF ), the LTF will be the nearest possible x times smaller TF than the current TF. When 'Premium' is disabled, the minimum TF will always be 1 minute to ensure TradingView plans lower than Premium don't get an error.
Examples with current Daily TF (when Premium is enabled):
500 : 3 minute LTF
1500 (default): 1 minute LTF
5000: 30 seconds LTF (1 minute if Premium is disabled)
🔶 SETTINGS
Direction: Direction of Volume-axis; Left, Right, Up or Down
🔹 LTF
LTF: LTF setting
Auto + multiple: Adjusts the initial set LTF
Premium: Enable when your TradingView plan is Premium or higher
🔹 Character
Character: Style of Price/Volume dot
Fade: Increasing this number fades dots at lower price/volume
Color
🔹 Linear Regression
Toggle (enable/disable), color, linestyle
Center Cross: Toggle, color
🔹 Background Color
Fade: Increasing this number fades the background color near lower values
Volume: Background color that intensifies as the volume value on the volume-axis increases
Price: Background color that intensifies as the price value on the price-axis increases
🔹 Labels
Size: Size of price/volume labels
Volume: Color for volume labels/axis
Price: Color for price labels/axis
Display Population Size: Show the population size + warning if it exceeds 1000
🔹 Dashboard
Location: Location of dashboard
Size: Text size
Display LTF: Display the intrabar Lower Timeframe used
Highest IB volume: Display up to 5 previous highest Intrabar Volume values
Logarithmic Regression AlternativeLogarithmic regression is typically used to model situations where growth or decay accelerates rapidly at first and then slows over time. Bitcoin is a good example.
𝑦 = 𝑎 + 𝑏 * ln(𝑥)
With this logarithmic regression (log reg) formula 𝑦 (price) is calculated with constants 𝑎 and 𝑏, where 𝑥 is the bar_index .
Instead of using the sum of log x/y values, together with the dot product of log x/y and the sum of the square of log x-values, to calculate a and b, I wanted to see if it was possible to calculate a and b differently.
In this script, the log reg is calculated with several different assumed a & b values, after which the log reg level is compared to each Swing. The log reg, where all swings on average are closest to the level, produces the final 𝑎 & 𝑏 values used to display the levels.
🔶 USAGE
The script shows the calculated logarithmic regression value from historical swings, provided there are enough swings, the price pattern fits the log reg model, and previous swings are close to the calculated Top/Bottom levels.
When the price approaches one of the calculated Top or Bottom levels, these levels could act as potential cycle Top or Bottom.
Since the logarithmic regression depends on swing values, each new value will change the calculation. A well-fitted model could not fit anymore in the future.
Swings are based on Weekly bars. A Top Swing, for example, with Swing setting 30, is the highest value in 60 weeks. Thirty bars at the left and right of the Swing will be lower than the Top Swing. This means that a confirmation is triggered 30 weeks after the Swing. The period will be automatically multiplied by 7 on the daily chart, where 30 becomes 210 bars.
Please note that the goal of this script is not to show swings rapidly; it is meant to show the potential next cycle's Top/Bottom levels.
🔹 Multiple Levels
The script includes the option to display 3 Top/Bottom levels, which uses different values for the swing calculations.
Top: 'high', 'maximum open/close' or 'close'
Bottom: 'low', 'minimum open/close' or 'close'
These levels can be adjusted up/down with a percentage.
Lastly, an "Average" is included for each set, which will only be visible when "AVG" is enabled, together with both Top and Bottom levels.
🔹 Notes
Users have to check the validity of swings; the above example only uses 1 Top Swing for its calculations, making the Top level unreliable.
Here, 1 of the Bottom Swings is pretty far from the bottom level, changing the swing settings can give a more reliable bottom level where all swings are close to that level.
Note the display was set at "Logarithmic", it can just as well be shown as "Regular"
In the example below, the price evolution does not fit the logarithmic regression model, where growth should accelerate rapidly at first and then slows over time.
Please note that this script can only be used on a daily timeframe or higher; using it at a lower timeframe will show a warning. Also, it doesn't work with bar-replay.
🔶 DETAILS
The code gathers data from historical swings. At the last bar, all swings are calculated with different a and b values. The a and b values which results in the smallest difference between all swings and Top/Bottom levels become the final a and b values.
The ranges of a and b are between -20.000 to +20.000, which means a and b will have the values -20.000, -19.999, -19.998, -19.997, -19.996, ... -> +20.000.
As you can imagine, the number of calculations is enormous. Therefore, the calculation is split into parts, first very roughly and then very fine.
The first calculations are done between -20 and +20 (-20, -19, -18, ...), resulting in, for example, 4.
The next set of calculations is performed only around the previous result, in this case between 3 (4-1) and 5 (4+1), resulting in, for example, 3.9. The next set goes even more in detail, for example, between 3.8 (3.9-0.1) and 4.0 (3.9 + 0.1), and so on.
1) -20 -> +20 , then loop with step 1 (result (example): 4 )
2) 4 - 1 -> 4 +1 , then loop with step 0.1 (result (example): 3.9 )
3) 3.9 - 0.1 -> 3.9 +0.1 , then loop with step 0.01 (result (example): 3.93 )
4) 3.93 - 0.01 -> 3.93 +0.01, then loop with step 0.001 (result (example): 3.928)
This ensures complicated calculations with less effort.
These calculations are done at the last bar, where the levels are displayed, which means you can see different results when a new swing is found.
Also, note that this indicator has been developed for a daily (or higher) timeframe chart.
🔶 SETTINGS
Three sets
High/Low
• color setting
• Swing Length settings for 'High' & 'Low'
• % adjustment for 'High' & 'Low'
• AVG: shows average (when both 'High' and 'Low' are enabled)
Max/Min (maximum open/close, minimum open/close)
• color setting
• Swing Length settings for 'Max' & 'Min'
• % adjustment for 'Max' & 'Min'
• AVG: shows average (when both 'Max' and 'Min' are enabled)
Close H/Close L (close Top/Bottom level)
• color setting
• Swing Length settings for 'Close H' & 'Close L'
• % adjustment for 'Close H' & 'Close L'
• AVG: shows average (when both 'Close H' and 'Close L' are enabled)
Show Dashboard, including Top/Bottom levels of the desired source and calculated a and b values.
Show Swings + Dot size
Linear Regression Intensity [AlgoAlpha]Introducing the Linear Regression Intensity indicator by AlgoAlpha, a sophisticated tool designed to measure and visualize the strength of market trends using linear regression analysis. This indicator not only identifies bullish and bearish trends with precision but also quantifies their intensity, providing traders with deeper insights into market dynamics. Whether you’re a novice trader seeking clearer trend signals or an experienced analyst looking for nuanced trend strength indicators, Linear Regression Intensity offers the clarity and detail you need to make informed trading decisions.
Key Features:
📊 Comprehensive Trend Analysis: Utilizes linear regression over customizable periods to assess and quantify trend strength.
🎨 Customizable Appearance: Choose your preferred colors for bullish and bearish trends to align with your trading style.
🔧 Flexible Parameters: Adjust the lookback period, range tolerance, and regression length to tailor the indicator to your specific strategy.
📉 Dynamic Bar Coloring: Instantly visualize trend states with color-coded bars—green for bullish, red for bearish, and gray for neutral.
🏷️ Intensity Labels: Displays dynamic labels that represent the intensity of the current trend, helping you gauge market momentum at a glance.
🔔 Alert Conditions: Set up alerts for strong bullish or bearish trends and trend neutrality to stay ahead of market movements without constant monitoring.
Quick Guide to Using Linear Regression Intensity:
🛠 Add the Indicator: Simply add Linear Regression Intensity to your TradingView chart from your favorites. Customize the settings such as lookback period, range tolerance, and regression length to fit your trading approach.
📈 Market Analysis: Observe the color-coded bars to quickly identify the current trend state. Use the intensity labels to understand the strength behind each trend, allowing for more strategic entry and exit points.
🔔 Set Up Alerts: Enable alerts for when strong bullish or bearish trends are detected or when the trend reaches a neutral zone. This ensures you never miss critical market movements, even when you’re away from the chart.
How It Works:
The Linear Regression Intensity indicator leverages linear regression to calculate the underlying trend of a selected price source over a specified length. By analyzing the consistency of the regression values within a defined lookback period, it determines the trend’s intensity based on a percentage tolerance. The indicator aggregates pairwise comparisons of regression values to assess whether the trend is predominantly upward or downward, assigning a state of bullish, bearish, or neutral accordingly. This state is then visually represented through dynamic bar colors and intensity labels, offering a clear and immediate understanding of market conditions. Additionally, the inclusion of Average True Range (ATR) ensures that the intensity visualization accounts for market volatility, providing a more robust and reliable trend assessment. With customizable settings and alert conditions, Linear Regression Intensity empowers traders to fine-tune their strategies and respond swiftly to evolving market trends.
Elevate your trading strategy with Linear Regression Intensity and gain unparalleled insights into market trends! 🌟📊
N-Degree Moment-Based Adaptive Detection🙏🏻 N-Degree Moment-Based Adaptive Detection (NDMBAD) method is a generalization of MBAD since the horizontal line fit passing through the data's mean can be simply treated as zero-degree polynomial regression. We can extend the MBAD logic to higher-degree polynomial regression.
I don't think I need to talk a lot about the thing there; the logic is really the same as in MBAD, just hit the link above and read if you want. The only difference is now we can gather cumulants not only from the horizontal mean fit (degree = 0) but also from higher-order polynomial regression fit, including linear regression (degree = 1).
Why?
Simply because residuals from the 0-degree model don't contain trend information, and while in some cases that's exactly what you need, in other cases, you want to model your trend explicitly. Imagine your underlying process trends in a steady manner, and you want to control the extreme deviations from the process's core. If you're going to use 0-degree, you'll be treating this beautiful steady trend as a residual itself, which "constantly deviates from the process mean." It doesn't make much sense.
How?
First, if you set the length to 0, you will end up with the function incrementally applied to all your data starting from bar_index 0. This can be called the expanding window mode. That's the functionality I include in all my scripts lately (where it makes sense). As I said in the MBAD description, choosing length is a matter of doing business & applied use of my work, but I think I'm open to talk about it.
I don't see much sense in using degree > 1 though (still in research on it). If you have dem curves, you can use Fourier transform -> spectral filtering / harmonic regression (regression with Fourier terms). The job of a degree > 0 is to model the direction in data, and degree 1 gets it done. In mean reversion strategies, it means that you don't wanna put 0-degree polynomial regression (i.e., the mean) on non-stationary trending data in moving window mode because, this way, your residuals will be contaminated with the trend component.
By the way, you can send thanks to @aaron294c , he said like mane MBAD is dope, and it's gonna really complement his work, so I decided to drop NDMBAD now, gonna be more useful since it covers more types of data.
I wanned to call it N-Order Moment Adaptive Detection because it abbreviates to NOMAD, which sounds cool and suits me well, because when I perform as a fire dancer, nomad style is one of my outfits. Burning Man stuff vibe, you know. But the problem is degree and order really mean two different things in the polynomial context, so gotta stay right & precise—that's the priority.
∞
Half Trend Regression [AlgoAlpha]Introducing the Half Trend Regression indicator by AlgoAlpha, a cutting-edge tool designed to provide traders with precise trend detection and reversal signals. This indicator uniquely combines linear regression analysis with ATR-based channel offsets to deliver a dynamic view of market trends. Ideal for traders looking to integrate statistical methods into their analysis to improve trade timing and decision-making.
Key Features
🎨 Customizable Appearance : Adjust colors for bullish (green) and bearish (red) trends to match your charting preferences.
🔧 Flexible Parameters : Configure amplitude, channel deviation, and linear regression length to tailor the indicator to different time frames and trading styles.
📈 Dynamic Trend Line : Utilizes linear regression of high, low, and close prices to calculate a trend line that adapts to market movements.
🚀 Trend Direction Signals : Provides clear visual signals for potential trend reversals with plotted arrows on the chart.
📊 Adaptive Channels : Incorporates ATR-based channel offsets to account for market volatility and highlight potential support and resistance zones.
🔔 Alerts : Set up alerts for bullish or bearish trend changes to stay informed of market shifts in real-time.
How to Use
🛠 Add the Indicator : Add the Half Trend Regression indicator to your chart from the TradingView library. Access the settings to customize parameters such as amplitude, channel deviation, and linear regression length to suit your trading strategy.
📊 Analyze the Trend : Observe the plotted trend line and the filled areas under it. A green fill indicates a bullish trend, while a red fill indicates a bearish trend.
🔔 Set Alerts : Use the built-in alert conditions to receive notifications when a trend reversal is detected, allowing you to react promptly to market changes.
How It Works
The Half Trend Regression indicator calculates linear regression lines for the high, low, and close prices over a specified period to determine the general direction of the market. It then computes moving averages and identifies the highest and lowest points within these regression lines to establish a dynamic trend line. The trend direction is determined by comparing the moving averages and previous price levels, updating as new data becomes available. To account for market volatility, the indicator calculates channels above and below the trend line, offset by a multiple of half the Average True Range (ATR). These channels help visualize potential support and resistance zones. The area under the trend line is filled with color corresponding to the current trend direction—green for bullish and red for bearish. When the trend direction changes, the indicator plots arrows on the chart to signal a potential reversal, and alerts can be set up to notify you. By integrating linear regression and ATR-based channels, the indicator provides a comprehensive view of market trends and potential reversal points, aiding traders in making informed decisions.
Enhance your trading strategy with the Half Trend Regression indicator by AlgoAlpha and gain a statistical edge in the markets! 🌟📊
Alpine Predictive BandsAlpine Predictive Bands - ADX & Trend Projection is an advanced indicator crafted to estimate potential price zones and trend strength by integrating dynamic support/resistance bands, ADX-based confidence scoring, and linear regression-based price projections. Designed for adaptive trend analysis, this tool combines multi-timeframe ADX insights, volume metrics, and trend alignment for improved confidence in trend direction and reliability.
Key Calculations and Components:
Linear Regression for Price Projection:
Purpose: Provides a trend-based projection line to illustrate potential price direction.
Calculation: The Linear Regression Centerline (LRC) is calculated over a user-defined lookbackPeriod. The slope, representing the rate of price movement, is extended forward using predictionLength. This projected path only appears when the confidence score is 70% or higher, revealing a white dotted line to highlight high-confidence trends.
Adaptive Prediction Bands:
Purpose: ATR-based bands offer dynamic support/resistance zones by adjusting to volatility.
Calculation: Bands are calculated using the Average True Range (ATR) over the lookbackPeriod, multiplied by a volatilityMultiplier to adjust the width. These shaded bands expand during higher volatility, guiding traders in identifying flexible support/resistance zones.
Confidence Score (ADX, Volume, and Trend Alignment):
Purpose: Reflects the reliability of trend projections by combining ADX, volume status, and EMA alignment across multiple timeframes.
ADX Component: ADX values from the current timeframe and two higher timeframes assess trend strength on a broader scale. Strong ADX readings across timeframes boost the confidence score.
Volume Component: Volume strength is marked as “High” or “Low” based on a moving average, signaling trend participation.
Trend Alignment: EMA alignment across timeframes indicates “Bullish” or “Bearish” trends, confirming overall trend direction.
Calculation: ADX, volume, and trend alignment integrate to produce a confidence score from 0% to 100%. When the score exceeds 70%, the white projection line is activated, underscoring high-confidence trend continuations.
User Guide
Projection Line: The white dotted line, which appears only when the confidence score is 70% or higher, highlights a high-confidence trend.
Prediction Bands: Adaptive bands provide potential support/resistance zones, expanding with market volatility to help traders visualize price ranges.
Confidence Score: A high score indicates a stronger, more reliable trend and can support trend-following strategies.
Settings
Prediction Length: Determines the forward length of the projection.
Lookback Period: Sets the data range for calculating regression and ATR.
Volatility Multiplier: Adjusts the width of bands to match volatility levels.
Disclaimer: This indicator is for educational purposes and does not guarantee future price outcomes. Additional analysis is recommended, as trading carries inherent risks.
Volume-Supported Linear Regression Trend TableThe "Volume-Supported Linear Regression Trend Table" (VSLRT Table) script helps traders identify buy and sell opportunities by analyzing price trends and volume dynamics across multiple timeframes. It uses linear regression to calculate the trend direction and volume strength, visually representing this data with color-coded signals on the chart and in a table. Green signals indicate buying opportunities, while red signals suggest selling, with volume acting as confirmation of trend strength. Traders can use these signals for both short and long positions, with additional risk management and multi-timeframe validation to enhance the strategy.
------------------------------------------------------------------------------
To use the "Volume-Supported Linear Regression Trend Table" (VSLRT Table) script in a trading strategy, you would incorporate it into your decision-making process to identify potential buy and sell opportunities based on the trend and volume dynamics. Here’s how you could apply it for trading:
1. Understanding the Key Elements:
Trend Direction (Slope of Price): The script uses linear regression to assess the trend direction of the price. If the price slope is positive, the asset is likely in an uptrend; if it's negative, the asset is in a downtrend.
Volume-Backed Signals: The buy or sell signal is not only based on the price trend but also on volume. Volume is crucial in validating the strength of a trend; large volume often indicates strong interest in a direction.
2. Interpreting the Table and Signals:
The table displayed at the bottom-right of your TradingView chart gives you a clear overview of the trends across different timeframes:
Trend Colors:
Green hues (e.g., ccol11, ccol12, etc.): Indicate a buying trend supported by volume.
Red hues (e.g., ccol21, ccol22, etc.): Indicate a selling trend supported by volume.
Gray: Indicates weak or unclear trends where no decisive direction is present.
Buy/Sell Signals:
The script plots triangles on the chart:
Upward triangle below the bar signals a potential buy.
Downward triangle above the bar signals a potential sell.
3. Building a Trading Strategy:
Here’s how you can incorporate the script’s information into a trading strategy:
Buy Signal (Long Entry):
Look for green triangles (indicating a buy signal) below a bar.
Confirm that the trend color in the table for the relevant timeframe is green, which shows that the buy signal is supported by strong volume.
Ensure that the price is in an uptrend (positive slope) and that volume is increasing on upward moves, as this indicates buying interest.
Execute a long position when these conditions align.
Sell Signal (Short Entry):
Look for red triangles (indicating a sell signal) above a bar.
Confirm that the trend color in the table for the relevant timeframe is red, which shows that the sell signal is supported by strong volume.
Ensure that the price is in a downtrend (negative slope) and that volume is increasing on downward moves, indicating selling pressure.
Execute a short position when these conditions align.
Exiting the Trade:
Exit a long position when a sell signal (red triangle) appears, or when the trend color in the table shifts to red.
Exit a short position when a buy signal (green triangle) appears, or when the trend color in the table shifts to green.
4. Multi-Timeframe Confirmation:
The script provides trends across multiple timeframes (tf1, tf2, tf3), which can help in validating your trade:
Short-Term Trading: Use shorter timeframes (e.g., 3, 5 minutes) for intraday trades. If both short and medium timeframes align in trend direction (e.g., both showing green), it strengthens the signal.
Longer-Term Trading: If you are trading on a higher timeframe (e.g., daily or weekly), confirm that the lower timeframes align with your intended trade direction.
5. Adding Risk Management:
Stop-Loss: Place stop-losses below recent lows (for long trades) or above recent highs (for short trades) to minimize risk.
Take Profit: Consider taking profit at key support/resistance levels or based on a fixed risk-to-reward ratio (e.g., 2:1).
Example Strategy Flow:
For Long (Buy) Trade:
Signal: A green triangle appears below a candle (Buy signal).
Trend Confirmation: Check that the color in the table for your selected timeframe is green, confirming the trend is supported by volume.
Execute Long: Enter a long trade if the price is trending upward (positive price slope).
Exit Long: Exit when a red triangle appears above a candle (Sell signal) or if the trend color shifts to red in the table.
For Short (Sell) Trade:
Signal: A red triangle appears above a candle (Sell signal).
Trend Confirmation: Check that the color in the table for your selected timeframe is red, confirming the trend is supported by volume.
Execute Short: Enter a short trade if the price is trending downward (negative price slope).
Exit Short: Exit when a green triangle appears below a candle (Buy signal) or if the trend color shifts to green in the table.
6. Fine-Tuning:
Backtesting: Before trading live, use TradingView’s backtesting features to test the strategy on historical data and optimize the settings (e.g., length of linear regression, timeframe).
Combine with Other Indicators: Use this strategy alongside other technical indicators (e.g., RSI, MACD) for better confirmation.
In summary, the script helps identify trends with volume support, giving more confidence in buy/sell decisions. Combining these signals with risk management and multi-timeframe analysis can create a solid trading strategy.