Linear Regression ChannelLinear Regression Channel Indicator
Overview:
The Linear Regression Channel Indicator is a versatile tool designed for TradingView to help traders visualize price trends and potential reversal points. By calculating and plotting linear regression channels, bands, and future projections, this indicator provides comprehensive insights into market dynamics. It can highlight overbought and oversold conditions, identify trend direction, and offer visual cues for future price movements.
Key Features:
Linear Regression Bands:
Input: Plot Linear Regression Bands
Description: Draws bands based on linear regression calculations, representing overbought and oversold levels.
Customizable Parameters:
Length: Defines the look-back period for the regression calculation.
Deviation: Determines the width of the bands based on standard deviations.
Linear Regression Channel:
Input: Plot Linear Regression Channel
Description: Plots a channel using linear regression to visualize the main trend.
Customizable Parameters:
Channel Length: Defines the look-back period for the channel calculation.
Deviation: Determines the channel's width.
Future Projection Channel:
Input: Plot Future Projection of Linear Regression
Description: Projects a linear regression channel into the future, aiding in forecasting potential price movements.
Customizable Parameters:
Length: Defines the look-back period for the projection calculation.
Deviation: Determines the width of the projected channel.
Arrow Direction Indicator:
Input: Plot Arrow Direction
Description: Displays directional arrows based on future projection, indicating expected price movement direction.
Color-Coded Price Bars:
Description: Colors the price bars based on their position within the regression bands or channel, providing a heatmap-like visualization.
Dynamic Visualization:
Colors: Uses a gradient color scheme to highlight different conditions, such as uptrend, downtrend, and mid-levels.
Labels and Markers: Plots visual markers for significant price levels and conditions, enhancing interpretability.
Usage Notes
Setting the Length:
Adjust the look-back period (Length) to suit the timeframe you are analyzing. Shorter lengths are responsive to recent price changes, while longer lengths provide a broader view of the trend.
Interpreting Bands and Channels:
The bands and channels help identify overbought and oversold conditions. Price moving above the upper band or channel suggests overbought conditions, while moving below the lower band or channel indicates oversold conditions.
Using the Future Projection:
Enable the future projection channel to anticipate potential price movements. This can be particularly useful for setting target prices or stop-loss levels based on expected trends.
Arrow Direction Indicator:
Use the arrow direction indicator to quickly grasp the expected price movement direction. An upward arrow indicates a potential uptrend, while a downward arrow suggests a potential downtrend.
Color-Coded Price Bars:
The color of the price bars changes based on their relative position within the regression bands or channel. This heatmap visualization helps quickly identify bullish, bearish, and neutral conditions.
Dynamic Adjustments:
The indicator dynamically adjusts its visual elements based on user settings and market conditions, ensuring that the most relevant information is always displayed.
Visual Alerts:
Pay attention to the labels and markers on the chart indicating significant events, such as crossovers and breakouts. These visual alerts help in making informed trading decisions.
The Linear Regression Channel Indicator is a powerful tool for traders looking to enhance their technical analysis. By offering multiple regression-based visualizations and customizable parameters, it helps identify key market conditions, trends, and potential reversal points. Whether you are a day trader or a long-term investor, this indicator can provide valuable insights to improve your trading strategy.
Linreg
Multiple Non-Linear Regression [ChartPrime]This indicator is designed to perform multiple non-linear regression analysis using four independent variables: close, open, high, and low prices. Here's a breakdown of its components and functionalities:
Inputs:
Users can adjust several parameters:
Normalization Data Length: Length of data used for normalization.
Learning Rate: Rate at which the algorithm learns from errors.
Smooth?: Option to smooth the output.
Smooth Length: Length of smoothing if enabled.
Define start coefficients: Initial coefficients for the regression equation.
Data Normalization:
The script normalizes input data to a range between 0 and 1 using the highest and lowest values within a specified length.
Non-linear Regression:
It calculates the regression equation using the input coefficients and normalized data. The equation used is a weighted sum of the independent variables, with coefficients adjusted iteratively using gradient descent to minimize errors.
Error Calculation:
The script computes the error between the actual and predicted values.
Gradient Descent: The coefficients are updated iteratively using gradient descent to minimize the error.
// Compute the predicted values using the non-linear regression function
predictedValues = nonLinearRegression(x_1, x_2, x_3, x_4, b1, b2, b3, b4)
// Compute the error
error = errorModule(initial_val, predictedValues)
// Update the coefficients using gradient descent
b1 := b1 - (learningRate * (error * x_1))
b2 := b2 - (learningRate * (error * x_2))
b3 := b3 - (learningRate * (error * x_3))
b4 := b4 - (learningRate * (error * x_4))
Visualization:
Plotting of normalized input data (close, open, high, low).
The indicator provides visualization of normalized data values (close, open, high, low) in the form of circular markers on the chart, allowing users to easily observe the relative positions of these values in relation to each other and the regression line.
Plotting of the regression line.
Color gradient on the regression line based on its value and bar colors.
Display of normalized input data and predicted value in a table.
Signals for crossovers with a midline (0.5).
Interpretation:
Users can interpret the regression line and its crossovers with the midline (0.5) as signals for potential buy or sell opportunities.
This indicator helps users analyze the relationship between multiple variables and make trading decisions based on the regression analysis. Adjusting the coefficients and parameters can fine-tune the model's performance according to specific market conditions.
Linear Regression Oscillator [ChartPrime]Linear Regression Oscillator Indicator
Overview:
The Linear Regression Oscillator is a custom TradingView indicator designed to provide insights into potential mean reversion and trend conditions. By calculating a linear regression on the closing prices over a user-defined period, this oscillator helps identify overbought and oversold levels and highlights trend changes. The indicator also offers visual cues and color-coded price bars to aid in quick decision-making.
Key Features:
◆ Customizable Look-Back Period:
Input: Length
Default: 20
Description: Determines the period over which the linear regression is calculated. A longer period smooths the oscillator but may lag, while a shorter period is more responsive but may be noisier.
◆ Overbought and Oversold Thresholds:
Inputs: Upper Threshold and Lower Threshold
Default: 1.5 and -1.5 respectively
Description: Define the upper and lower bounds for identifying overbought and oversold conditions. Values outside these thresholds suggest potential reversals.
◆ Candlestick Color Plotting:
Input: Plot Bar Color
Default: false
Description: Option to color the price bars based on the oscillator's value, providing a visual representation of market conditions. Bars turn cyan for positive oscillator values and blue for negative.
◆ Mean Reversion and Trend Signals:
Visual markers and labels indicate when the oscillator suggests mean reversion or trend changes, aiding in identifying key market turning points.
◆ Invalidation Levels:
Tracks the highest and lowest prices over a recent period to set levels where the current trend signal would be considered invalidated.
◆ Gradient Color Coding:
Utilizes gradient color coding to enhance the visualization of oscillator values, making it easier to interpret overbought and oversold conditions.
◆ Usage Notes:
Setting the Look-Back Period:
Adjust the "Length" input based on the timeframe and the type of trading you are conducting. Shorter periods are more suited for intraday trading, while longer periods can be used for swing trading.
Interpreting Thresholds:
Use the upper and lower threshold inputs to fine-tune the sensitivity of the overbought and oversold signals. Higher absolute values reduce the number of signals but increase their reliability.
Candlestick Coloring:
Enabling the "Plot Bar Color" option can help quickly identify the current state of the oscillator in relation to the zero line. This visual aid can be particularly useful in fast-moving markets.
Mean Reversion and Trend Signals:
Pay attention to the symbols and labels on the chart indicating mean reversion and trend changes. These signals are designed to highlight potential entry and exit points.
Invalidation Levels:
Use the plotted invalidation levels as stop-loss or signal invalidation points. If the price moves beyond these levels, the current trend signal is likely invalid.
This indicator helps traders identify overbought and oversold conditions, potential mean reversions, and trend changes based on the linear regression of the closing prices over a specified look-back period.
Lin Reg (Linear Regression) Support and Resistance by xxMargauxLin Reg (Linear Regression) Support & Resistance by xxMargaux 💸
This indicator plots three linear regression lines (Lin Reg) on the price chart, providing insights into potential support and resistance levels. It calculates Lin Reg lines based on user-defined lengths and sources.
This indicator's settings were initially configured for MNQ1! (E-Mini Nasdaq 100 futures contracts). But works as intended on any security and on any timeframe.
When price is below a given Lin Reg line, that line will be red and may serve as resistance as price moves up towards the line. That is, it may be a potential short entry opportunity. When price is above a given Lin Reg line, that line will be green and may serve as support as price continues up from the line. That is, it may be a potential long entry opportunity.
When price starts to break sideways or down through the Lin Reg lines, this may signal a reversal from uptrend to downtrend. When price starts to break sideways or up through the Lin Reg Lines, this may signal a reversal from downtrend to uptrend. In very strong trends, breaking through the lines briefly may provide an entry opportunity, but be cautious because a trend reversal may also be possible.
Inputs:
Length of Price Lin Reg Lines: Customize the lengths of the three Lin Reg lines.
Source for Price Lin Reg Lines: Choose the source for each Lin Reg line.
Source for Security Price: Select the price source for the security.
Features:
Trend Analysis: Assists in visualizing price trends based on the relationship between the security price and Lin Reg lines, which will be colored according to whether price is above or below each Lin Reg line.
Customizable Colors: When price is above a Lin Reg line that line will be green. When price is below a Lin Reg line, that line will be red.
Here's a beginner-friendly explanation of linear regression lines 💡
Best-Fit Line: Imagine you have a scatter plot of closing prices on a chart. Linear regression aims to find the straight line that best fits the overall trend of these data points. It's like drawing a line through the center of the data that minimizes the distance between the line and each data point.
Trend Identification: Once the linear regression line is plotted on a price chart, it provides a visual representation of the trend. If the price is generally rising, the linear regression line will slope upwards. If the price is falling, the line will slope downwards. This helps traders identify whether the trend is bullish (upward) or bearish (downward).
Support and Resistance: Linear regression lines can also act as dynamic support and resistance levels. When the price is above the linear regression line, it may act as support, meaning the price tends to bounce off the line and continue higher. Conversely, when the price is below the line, it may act as resistance, with the price encountering selling pressure and potentially reversing lower.
Reversal Signals: Changes in the slope or direction of the linear regression line can signal potential trend reversals. For example, if the price breaks above a downward-sloping linear regression line, it may indicate a shift from a downtrend to an uptrend, and vice versa.
Adjustable Parameters: Traders can customize the length of the linear regression line by adjusting the period over which it's calculated. Shorter periods may be more sensitive to recent price changes, while longer periods may provide a smoother trend line.
Banana RSIBanana RSI is not just ap-PEAL-ing to the eyes!
This simple little indicator provides a New Approach to determining Overbought and Oversold levels, as well as taking advantage of a non-typical smoothing method for this type of indicator.
Banana RSI uses a Cumulative High and Low Average to draw the upper, lower, and midline.
The High and Low Averages use the data only from above or below the Cumulative Average to calculate their respective line.
In simpler terms:
The High average is an average of every value ABOVE the full average.
The Low average is an average of every value BELOW the full average.
This creates an automated method to determine overbought and oversold territory based on the charts historical movement.
Since every chart can be different, these levels change with the chart.
Banana RSI also uses a linear regression smoothing method , by taking advantage of the built-in Least Squares Moving Average, we are able to view a better reacting/less-lagging moving average.
Included are 2 Length-Adjustable LSMA lines to use however needed.
Using the Regression Lines along with the High & Low Averages provides a new view on the classic RSI indicator.
Enjoy!
Trend Finder++ (by Alex L.)This indicator seeks for a short term trend within a bigger long term trend and displays both in a channel with an extension lines (optional).
Use of this indicator is quite simple: when the stock is near the trend line bottom (default RED) it can be a good time to buy and when the stock is near the trend line top (default GREEN) it can be a good time to sell.
What new ideas and cool stuff this indicator offers:
- 'Trend (Months)' -
Trend channels will always be displayed over the period: last 'X' months (regardless of the 'Time Interval' set in your chart)
This allows you to go into a larger or smaller resolution and still see the same trend lines!
- ' Trend (Bars)' -
Optional. You can choose to display the Trend channel based on bars instead of months.
This can be useful for advanced traders, or in case a security is new and there isn't even 1 month of data.
- 'Show long-term trend' -
Optional. Displays a larger 3rd (even more long-term) trend in addition to the two current trends.
This is for advanced traders who want to see an even more bigger picture. It is best viewed on a weekly time interval.
- Customizable channel size, channel colors and channel style.
- 'Extend lines' -
Optional (default: yes). Trend channels' can be displayed with extension or without using this option.
- Internal Feature -
When trend channel goes below zero (can happen if stock's price falls sharply) - its below-zero portion will be drawn as 'extension' instead.
This is useful if such occurs, and we're in an auto-scaled chart - the lines will take less space on screen (for cleaner view).
Based on an idea/indicator by @ DevLucem called "Linear Regression ++"
Open Source.
Enjoy!
Triple Quadratic Regression (w/ Normalized Value Table)This indicator draws three step lines - a fast (fuchsia), a medium (yellow), and a slow (blue) quadratic regression line to help the user obtain a clearer picture of current trends. Quadratic regression is better suited to determining (and predicting) trend than linear regression; y = ax^2 + bx + c is better to use than a simple y = ax + b. Calculating the regression involves five summation equations that utilize the bar index (x1), the price source (defaulted to ohlc4), the desired lengths, and the square of x1. Determining the coefficient values requires an additional step that factors in the simple moving average of the source, bar index, and the squared bar index.
In addition to the plotted lines, a change in bar color and a table were added. The bar color is influenced by the values of ax^2 and bx of the fast and medium length regressions. If ax^2 and bx for both the fast and medium lengths are above 0, the bar color is green. If they are both under 0, the bar color is red. Otherwise, bars are colored gray. In the table, located at the bottom of the chart (but can be moved), the ax^2 and bx values for each regression length are shown. The option to view normalized (scale of -1 to +1) values or the standard values is included in the indicator settings menu. By default, the normalized values are shown.
Buy Sell Calendar [LuxAlgo]The Buy Sell Calendar indicator displays a calendar showing the sentiment for the current day/month. Three different methods can be used to determine this sentiment.
The calendar can also highlight the percentage of bullish days/months for a month/year.
🔶 SETTINGS
Frequency: Calendar frequency, options include "Daily" and "Monthly"
Sentiment Method: Method used to determine the sentiment for the day/month, options include: "Linreg", "Accumulated Deltas", and "Max/Min"
Timezone Offset: UTC time zone offset.
Limit Date: Limit date used by the calendar, the sentiment of days/months outside this limit will not be returned.
🔹 Calendar
Show Calendar: Determines whether to display or hide the calendar.
Location: Location of the calendar on the chart.
Size: Calendar size.
🔶 USAGE
The proposed script can allow users to quickly determine if a specific day/month is considered bullish or bearish. A green cell is used for bullish days/months, while a red one is used for bearish days/months.
Additionally vertical lines are displayed on new days/months with a color highlighting the current sentiment for this specific day/month. Note that this is done retrospectively, the color of a line set at time t might differ at time t+n .
🔶 SENTIMENT METHODS
Determining whether a day/month is bullish or bearish can be done using three different methods. Note that each method makes use of the closing price as the input, and as such can eventually return different results depending on the selected timeframe. Each method is described below:
🔹 Linreg
The Linreg method fit lines between each day/month using the method of least squares and determines if that particular day is bullish or bearish based on the line slope sign. For example, a rising line would indicate a bullish day/month.
🔹 Accumulated Deltas
The method of accumulated deltas simply accumulates bullish and bearish price changes for the current day/month, the result with the highest magnitude determines the sentiment for that day/month.
🔹 Max/Min
The max/min method computes a trailing maximum and a trailing minimum for the current day/month. The sentiment is determined by the price position relative to the average between the obtained maximum/minimum, with a bullish sentiment being determined if price is above the average.
Standard Deviation Channel V.1Standard Deviation channel For TradingView V.1
Many thanks to and Made with help from @rumpypumpydumpy
█ - How to add the indicator-
You can “Boost” the tool if you like it, then scroll down on this page to "Add to favorite indicators" so it will be saved in your favorites. Easiest way to add to chart past that is simply copy the indicators name, Navigate to a chart, then paste the indicators name into your chart's "Indicators" tab. It should then be immediately added to the current chart. If your display is not large enough, when you first add your channel,, you may realize that you see labels appear, but no channel. Simply scroll backwards in time until the chart loads. TradingView needs to be able to see the data you would like the channel to read in order to plot and display correctly. This is a simple one or two mouse wheel scroll and it will appear.
You may notice a compression of price scale. IF this happens simply right click your right price axis, a menu will appear, select “Scale price chart only”, and "Auto (fits data to screen) This will release the scale compression and let you view the channel and price normally. Once your Channel is added, loaded, and ready to go, you can proceed to settings. In the top left corner of your main chart there will be a Indicator title, hover that and click on the gear icon to access the channels custom settings. You can also double click any of the active plots from the channel or averages on the chart, and gain access to the settings panel through that.
█ OVERVIEW
Settings explained -
Inputs and color choices
You can think of the settings panel as 3 separate sections.
First - Look and feel- You will have your Channels visual inputs, Simple Yes or No check boxes on whether you would like to display the visual items listed. You can choose to display the channel in a multitude of ways, with or without half deviations, with no 2nd, 3rd, or 4th deviations. This first section is your quick access control panel to the visual feel and display of the channel and its items.
Then below that you will see quick access color presets for each deviation and half deviations. You can choose to leave these as is, or you can choose custom colors per your preference.
The positive and negative Second deviations (+/-2std) are colored by positive and negative slope of channel. This will help to show overall trend, whether up or down, positive or negative. User can change the positive and negative slope colors if they would like.
Second, - Time and Regression - Next as you scroll down the settings panel you will encounter the Time and regression settings. In order for the channel to match the channel used widely in TOS, we had to Preset the look back lengths into the code because on Tradingview we have an “Continuous left edge of the chart”. We needed to tell the channel how far to look back and start calculating. The frame work for this time logic came initially from the channel that was developed years back by @corgalicious, We then took that time logic and re-worked it in order to fit the parameters that the widely used and popular TOS channel has.
Above the time frame length back inputs you will find a dropdown menu "Regression method type". This will offer different methods of regression and calculating the standard deviation from the center linear regression line. It is preset to “Population standard deviation” which will mimic the widely used TOS channel. There is also a choice for “Regression method standard error, or RMSE. This is a similar regression style, but will result in a tighter fitting, smaller deviation measurement and channel all around. As well as a multitude of other regression styles thanks to the genius of @rumpypumpydumpy
All the time presets were carefully chosen based off Pre set time frames TOS offers for their widely used Standard deviation channel, and time frames I had noted as widely used. You as the user can change those look back windows if you prefer through the input length settings. I recommend using the stock settings in most scenarios. Trading view has a 5000 bar look back limit, so we have implemented “Max lookbacks” inside the code to avoid any user error or confusion. The standard error of the sample mean is an estimate of how far the sample mean is likely to be from the population mean, whereas the standard deviation of the sample is the degree to which individuals within the sample differ from the sample mean. For longer time frames and sample sets I tend to use Population Standard Dev setting. For smaller sample sets I will go with Linreg RMSE setting. This is a personal preference. It is encouraged to try all of them and see what fits your trading style the best.
If the user would like to use a "Max bar lookback and plot the maximum allowed length on the current time frame, Simply select, "Use the full range of data allowed in max bars back for calculation?" This will automatically search back on the current time frame and plot the channel 4999 bars back. User will have to SCROLL BACK in order to fully load the channel into view. Again, Tradingview needs to see the candles you would like to plot on.
Third, - Finally at the bottom of the settings I have included Exponential moving average clouds. These are NOT enabled by default. If the user would like them enabled simply check "show momentum average clouds" and "Show Candle EMA". These are Multiple time frame moving average clouds consisting of 72/89 length 3, and 5min exponential moving averages. I use these to simply show the front or back side of a move and to find if trend is strong or weakening. These are not always needed so they are turned off by default.
█ CONCEPTS
Reversion and Repulsion-
You will find that the channel linear regression trend line has two characteristic's, Reversion to the mean, and Repulsion away from the mean. Price either seeks to aggressively return to the mean when it has exited a normal distribution, or price seeks to aggressively move away from the mean in times of momentum. Most seek to participate in the move through MAJOR WHOLE deviation levels in one scenario or the other.
The idea behind using a Standard deviation channel is to see extension and find where in the move we are. Are you extended out to 3 or 4 deviation's up or down? If so, you could start to think about reversion back to the mean. Have you had a violent move down to -3 or -4 deviations in a sell off? Maybe look at reversion back up toward the mean off a whole deviation break. Have you broken out of a normal distribution at +1 deviation and are building trend? maybe seek to join trend.
I have found most success by using a Split screen style layout. On the left chart most will have a 1min intraday channel showing, and on the left chart a 4hr channel showing. The idea is to mark your longer time frame deviations onto your intraday time frame, and use the intraday Channel to guide you through the higher time framed move. The move through +/- 1 deviation is a high momentum area in most names as price either seeks to return to the mean, or move strongly away from the mean.
█ Time periods
The channel has pre determined lookback presets for each major time frame. These have been preset in the code to mimic the widely used channel in TOS to the best of our ability.
Preset timeframe lookbacks include.
//intraday shorter time frames. 1/2min with 2day lookbacks
'1D-1Min' - Default= 2D, minval=1, maxval=5
'1D-2Min' - Default= 2D, minval=1, maxval=7
//intraday shorter time frames. 3/5min with 5day lookbacks. User can set shorter or longer if they choose, up to a 5000k bar look back depending on their Data tier level, Basic, Pro, Pro+, Premium etc.
'5D-3Min' - Default= 5D, minval=1, maxval=7
'5D-5Min' - Default= 5D, minval=1, maxval=20
// larger intraday time frames, 10/15min with 5day look backs.
'5D-10Min' - Default= 5D, minval=1, maxval=20
'5D-15Min' - Default= 5D, minval=1, maxval=60
// "Swing style time frames" 30/60 min with 10 and 20 day look back.
'10D-30Min' - Default= 10D, minval=1, maxval=60
'20D-1Hr' - Default= 20D, minval=1, maxval=90
//longer lookbacks for larger time frames using day lookback with the exception of week/month
'90D-2Hr' - Default = 90D, minval=1, maxval=180
'4h ' - Default = 180D,minval=1, maxval=4999
'6h' - Default = 36D, minval=1, maxval=252
'5Yr-W' - Default = 260W,minval=1, maxval=260
'1Yr-1D' - Default = 252D,minval=1, maxval=4999
'1Yr-1W' - Default = 52W, minval=1, maxval=480
'5Yr-1M' - Default = 60W, minval=1, maxval=480
█ Minimum Window Size
Note that on each time frame you MUST quickly scroll out to the first bar that the channel should start calculating on in order for the channel to populate on longer time frame series. This is under construction and as soon as there is a fix or other way around this, it will be addressed.
█ NOTES
Enjoy!
In the end I encourage any who tries the Channel to really sit down and spend some time playing around with the settings in order to find out how they like the Channel set up. I usually run the default settings on a intraday 5min chart, and then another instance of the study on a 4 hour chart. That way I can see granular intraday levels, and macro long term levels in the same view. See what fit's you the best, and how you like to trade. Most of all ENJOY!
Good luck -
JMF.
IMPORTANT INFO-
As always, the creator of this code is NOT a licensed investment advisor. No output of this tool is to be taken as investment advice or a recommendation to buy or sell any security.
Trading is risky, any one using this tool acknowledges they CAN LOSE some if not all of their initial investment even with this tool enabled.
User assumes ALL RESPONSIBILITY when using this tool in their technical analysis. There is NO GUARANTEE THAT THE USE OF THIS TOOL WILL RESULT IN PROFIT Use at your own risk.
Trendlines with Breaks [LuxAlgo]The trendlines with breaks indicator return pivot point based trendlines with highlighted breakouts. Users can control the steepness of the trendlines as well as their slope calculation method.
Trendline breakouts occur in real-time and are not subject to backpainting. Trendlines can however be subject to repainting unless turned off from the user settings.
The indicator includes integrated alerts for trendline breakouts.
🔶 USAGE
Any valid trendlines methodology can be used with the indicator, users can identify breakouts in order to infer future price movements.
The calculation method of the slope greatly affects the trendline's behaviors. By default, an average true range is used, returning a more constant slope amongst trendlines. Other methods might return trendlines with significantly different slopes.
Stdev makes use of the standard deviation for the slope calculation, while Linreg makes use of the slope of a linear regression.
The above chart shows the indicator using "Stdev" as a slope calculation method. The chart below makes use of the "Linreg" method.
By default trendlines are subject to backpainting, and as such are offset by length bars in the past. Disabling backpainting will not offset the trendlines.
🔶 SETTINGS
Length: Pivot points period
Slope: Slope steepness, values greater than 1 return a steeper slope. Using a slope of 0 would be equivalent to obtaining levels.
Slope Calculation Method: Determines how the slope is calculated.
Backpaint: Determine whether trendlines are backpainted, that is offset to past.
Linear Regression Fan [LuxAlgo]This indicator displays a fan using a linear regression fit to the price as a base. All lines are equidistant and are drawn from the first point of the linear regression to the most recent point of the linear regression plus the root-mean-square deviation (RMSD) multiplied by a certain factor.
Settings
Length: Lookback period for the linear regression.
Mult: Multiplier for the RMSD, allows returning wider fans.
Lines Per Side: Number of lines on each side of the fan.
Src: Input source of the indicator.
Usage
Traders often use the lines of fans to determine significant points of support or resistance at which they might expect price variations to reverse.
The length can be adjusted so that the starting point of the linear regression is located at a pivot high/low.
Some technical analysts use the measure rule of broadening wedges with fans when price breaks one of the extremities. This allows setting precise take-profits/stop-losses.
To learn more about the measure rule see:
Natural Market Slope [CC]The Natural Market Slope was created by Jim Sloman and this is one of his many Ocean Indicators which I'm publishing thanks to receiving source materials from @altcoinz and @tmac87. I did completely rewrite the formula for this indicator but I commented out the original calculation so you can compare or just for study purposes. I like this version better because it is very smooth and the original formula is a bit faster with response but is very choppy in comparison.
This indicator was the basis for his Natural Market Combo which I will be publishing very soon so stay tuned for that. The idea behind all of his Natural indicators was to use the natural log of the current price in different ways. This indicator obviously focuses on the slope and it essentially becomes another momentum indicator which peaks when the upward momentum is gone and vice versa. Buy when the line turns green and sell when it turns red. I have added strong buy and sell signals in addition to the normal ones and strong signals are darker in color in comparison to the original lighter colors.
Let me know if there are any other indicators you would like to see me publish!
Raff Regression Channel by DGTRᴀꜰꜰ Rᴇɢʀᴇꜱꜱɪᴏɴ Cʜᴀɴɴᴇʟ (RRC)
This study aims to automate Raff Regression Channel drawing either based on ZigZag Indicator or optionally User Preference
The Raff Regression Channel , developed by Gilbert Raff, is based on a linear regression, which is the least-squares line-of-best-fit for a price series, with evenly spaced trend lines above and below . The width of the channel is set by determining the high or low that is the furthest from the linear regression.
Because the channel distance is based off the largest pullback or highest peak within a trend, for effectively drawing and using a Raff Regression Channel it is recommend/required that a Raff Regression Channel is applied to “mature” trends. Knowing this requirement, for better automated drawing results this study benefits from the Zig Zag Indicator, where the Zig Zag indicator is used to help identify price trends and changes in price trends. Option to manually adjust lengths for drawing a Raff Regression Channel is also made available.
Using a Raff Regression Channel
Once The Raff Regression Channel is drawn, covering an existing trend, Exᴛᴇɴꜱɪᴏɴ Lɪɴᴇꜱ are drawn to identify ᴛʜᴇ ꜱᴜᴘᴘᴏʀᴛ﹐ʀᴇꜱɪꜱᴛᴀɴᴄᴇ ᴏʀ ʀᴇᴠᴇʀꜱᴀʟ ᴘᴏɪɴᴛꜱ
The trend is up as long as prices rise within this channel. An uptrend may be reversing (not always, but likely) when price breaks below the channel extension . The trend is down as long as prices decline within the channel. Similarly, a downtrend may be reversing (not always, but likely) when price breaks above the channel extension . Moves outside the channel extensions can be indication of a reversal or can denote overbought or oversold conditions
For further details please refer to education post Raff Regression Channel
█ FEATURES
- AUTO or MANUALLY adjusted Raff Regression Channel and Channel Extentions drawing
- ALERTs, for Linear Regression Line, Raff Regression Upper and Lower Channel Extentions
- LSMA , Least Squares Moving Average, in other words Linear Regression Curve
█ SETTINGS
Setting Loopback and Number of Bars are the most important part for The Raff Regression Channel, where ;
- Lookback, defines where the Raff Regression Channel is starting, it is recommended to set to a trend begining
- Number of Bars, defines how many bars to be assumed for calculation, or simply stated the end of the Raff Regression Channel drawing (not extentions but the main channel, extentions by default will be drawn till the last bar)
Setting of Loopback and Number of Bars is performed eigher automatically based on Zig Zag indicator or users may prefer to set them manually. If selected automatically then
- Deviation and Depth values of Zig Zag indicator are used for calculations (enabling visually plotting of ZigZag Lines will help to identify better visually the points), where ;
Deviation, is a multiplier that affects how much the price should deviate from the previous pivot in order for the bar to become a new pivot.
Depth, affects the minimum number of bars that will be taken into account when building
Short-term traders may wish to apply the channel to small waves of a trend so they can reduce the value of the Deviation and Depth
█ OTHER CHANNEL CONSEPTS
Linear Regression Channels, , what linear regression channels are? and linear regression channel/curve/slope study
Fibonacci Channels, how to apply fibonacci channels and automated fibonacci channels study
Andrews’ Pitchfork, how to apply pitchfork and automated pitchfork study
Special Thanks to @Kiss66000 for his kind suggestion, je vous remercie beaucoup @Kiss66000
Disclaimer :
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
Squeeze Momentum Indicator [LazyBear] vX by DGTModified version of Squeeze Momentum Indicator visualizing on Price Chart
author: LazyBear, modified by KıvançÖZBİLGİÇ
Linear Regression ++Due to public demand
Linear Regression Formula
Scraped Calculation With Alerts
Here is the Linear Regression Script For traders Who love rich features
Features
++ Multi time frame -> Source Regression from a different Chart
++ Customized Colors -> This includes the pine lines
++ Smoothing -> Allow Filtered Regression; Note: Using 1 Defaults to the original line. The default is 1
++ Alerts On Channel/Range Crossing
Usage
++ Use this for BreakOuts and Reversals
++ This Script is not to be used Independently
Risks
Please note, this script is the likes of Bollinger bands and poses a risk of falling in a trend range.
Signals may Keep running on the same direction while the market is reversing.
Requests
If you have any feature requests, comment below or dm me. I will answer when i can.
Feel free to utilize this on your chart and share your ideas
For developers who want to use this on their chart, Please use this script
The original formula for calculation is posted there
❤❤❤ I hope you love this. From my heart! ❤❤❤
Lnear Regression ++Here is another amazing script for you guys
Target Audience
++ Programmers
++ Linear Regression Enthusiasts
Please Use this Indicator If you understand the risk posed by linear regression; ill explain some below
Features
++ Raw Formulae for the linear regression
--I understand that tradingview explanation on how the linreg function works is not clear to many of you and therefore i included this for developers
--Yes its much simpler than you thought, Do Enjoy
++ Alerts
--You can get alerts when the lower band is crossed/touched based on your settings
--These alerts are not repainting at all.
Linear Regression Limits
As you traders know, the market changes from time and new levels will get drawn
The alerts are based on these new levels and once we have new ones, we keep updating
Risk
This script is similar to Bollinger Bands style of alerts, If the market moves continuously to one direction after the break of a band, The levels change and you may receive a new signal confirmation
Cheers!! Enjoy!! Feel free to ask me for any improvements
Minkowski Distance Period Linear Regression BandsHello, this script was created by using Linear Regression Bands Function with variable Function Minkowski Distance Adaptive Period.
Function Linear Regression Bands :
Minkowski Distance Function Original Script by RicardoSantos :
Functions saved from overloads . And suitable for mutable variable periods.
Regards.
Function : Linear Regression Bands
Used with Pearson Correlation. It can be used to make sense of the trends. Very successful results can be obtained with a MACD style indicator and volume indicator that gives Buy and Sell orders.Open for adaptive and mutable variable periods of moving averages. Best regards!
Trigonometric OscillatorIts a pretty old script and i have absolutely no idea how i did it, the code kinda look like the phase wrapping/unwrapping formula. This indicator is an oscillator, sometimes its reactivity is impressive so i think its a good idea to post it, feel free to experiment with it.
Fractal Regression Channel V0.1Port of @RicardoSantos' Fractal Regression Channel V0 from pinescript 2 to pinescript 3.
// Source:
// Original Author: @RicardoSantos
BB Forecast PrototypeExperiment to try apply @atrader2's MA Forecast () to bollinger bands - didn't exactly work out how I expected it to, especially with the Upper/Lower forecast projections.
Function for Least Squares Moving AverageThank you to alexgrover for putting me wide to this, after putting up with long conversations and stupid questions. Follow him and behold: www.tradingview.com
What is this?
This is simply the function for a Least Squares Moving Average. You can render this on the chart by using the linreg() function in Pine.
Personally I like to use the slope of the LSMA to help determine what direction to take a trade in, but I'm sure there are other, more exotic ways of using it and, if you know how to get your fingers dirty with Pine, you can create more exotic versions of it by modifying the function provided.
Want to learn?
If you'd like the opportunity to learn Pine but you have difficulty finding resources to guide you, take a look at this rudimentary list: docs.google.com
The list will be updated in the future as more people share the resources that have helped, or continue to help, them. Follow me on Twitter to keep up-to-date with the growing list of resources.
Suggestions or Questions?
Don't even kinda hesitate to forward them to me. My (metaphorical) door is always open.
Average BundleSix (6) average indicators in single package.
All averages have adjustable source, length and type individually
Every average can be enabled or disabled individually.
Color, thickness and other style parameters are adjustable on Style section.
Supported types are:
EMA - Exponential Moving Average
SMA - Simple Moving Average
RMA - Running Moving Average
WMA - Weighted Moving Average
LINREG - Linear Regression
Investopedia is a good source to learn about moving average types.