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!
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.
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.
ORDINARY LEAST SQUARES Slope by @XeL_ArjonaORDINARY LEAST SQUARES Slope by @XeL_Arjona
Ver. 1 by Ricardo M Arjona @XeL_Arjona
DISCLAIMER:
The Following indicator/code IS NOT intended to be a formal investment advice or recommendation by the author, nor should be construed as such. Users will be fully responsible by their use regarding their own trading vehicles/assets.
The embedded code and ideas within this work are FREELY AND PUBLICLY available on the Web for NON LUCRATIVE ACTIVITIES and must remain as is.
WHAT'S THIS?
This is a REAL mathematically approach of an ORDINARY LEAST SQUARES LINE FITTING SLOPE as TradingView currently don't have a native one embedded, neither as a pine function. Other "Sope" indicators from this linear regression model I found on public library are currently based on "momentum" rather tan slope.
Any modifications or additions are quite welcome!
Cheers!
@XeL_Arjona
Standard Error of the Estimate -Composite Bands-Standard Error of the Estimate - Code and adaptation by @glaz & @XeL_arjona
Ver. 2.00.a
Original implementation idea of bands by:
Traders issue: Stocks & Commodities V. 14:9 (375-379):
Standard Error Bands by Jon Andersen
This code is a former update to previous "Standard Error Bands" that was wrongly applied given that previous version in reality use the Standard Error OF THE MEAN, not THE ESTIMATE as it should be used by Jon Andersen original idea and corrected in this version.
As always I am very Thankfully with the support at the Pine Script Editor chat room, with special mention to user @glaz in order to help me adequate the alpha-beta (y-y') algorithm, as well to give him full credit to implement the "wide" version of the former bands.
For a quick and publicly open explanation of this truly statistical (regression analysis) indicator, you can refer at Here!
Extract from the former URL:
Standard Error Bands are quite different than Bollinger's. First, they are bands constructed around a linear regression curve. Second, the bands are based on two standard errors above and below this regression line. The error bands measure the standard error of the estimate around the linear regression line. Therefore, as a price series follows the course of the regression line the bands will narrow, showing little error in the estimate. As the market gets noisy and random, the error will be greater resulting in wider bands.