Nadaraya-Watson: Rational Quadratic Kernel (Non-Repainting)What is Nadaraya–Watson Regression?
Nadaraya–Watson Regression is a type of Kernel Regression, which is a non-parametric method for estimating the curve of best fit for a dataset. Unlike Linear Regression or Polynomial Regression, Kernel Regression does not assume any underlying distribution of the data. For estimation, it uses a kernel function, which is a weighting function that assigns a weight to each data point based on how close it is to the current point. The computed weights are then used to calculate the weighted average of the data points.
How is this different from using a Moving Average?
A Simple Moving Average is actually a special type of Kernel Regression that uses a Uniform (Retangular) Kernel function. This means that all data points in the specified lookback window are weighted equally. In contrast, the Rational Quadratic Kernel function used in this indicator assigns a higher weight to data points that are closer to the current point. This means that the indicator will react more quickly to changes in the data.
Why use the Rational Quadratic Kernel over the Gaussian Kernel?
The Gaussian Kernel is one of the most commonly used Kernel functions and is used extensively in many Machine Learning algorithms due to its general applicability across a wide variety of datasets. The Rational Quadratic Kernel can be thought of as a Gaussian Kernel on steroids; it is equivalent to adding together many Gaussian Kernels of differing length scales. This allows the user even more freedom to tune the indicator to their specific needs.
The formula for the Rational Quadratic function is:
K(x, x') = (1 + ||x - x'||^2 / (2 * alpha * h^2))^(-alpha)
where x and x' data are points, alpha is a hyperparameter that controls the smoothness (i.e. overall "wiggle") of the curve, and h is the band length of the kernel.
Does this Indicator Repaint?
No, this indicator has been intentionally designed to NOT repaint. This means that once a bar has closed, the indicator will never change the values in its plot. This is useful for backtesting and for trading strategies that require a non-repainting indicator.
Settings:
Bandwidth. This is the number of bars that the indicator will use as a lookback window.
Relative Weighting Parameter. The alpha parameter for the Rational Quadratic Kernel function. This is a hyperparameter that controls the smoothness of the curve. A lower value of alpha will result in a smoother, more stretched-out curve, while a lower value will result in a more wiggly curve with a tighter fit to the data. As this parameter approaches 0, the longer time frames will exert more influence on the estimation, and as it approaches infinity, the curve will become identical to the one produced by the Gaussian Kernel.
Color Smoothing. Toggles the mechanism for coloring the estimation plot between rate of change and cross over modes.
Regressions
Nasdaq DowJones STOCH+RSIAlternative & UPDATED version of my previous indicator for spread trading.
This indicator can work pretty well also with other indices or correlated assets such as nasdaq100 and dax40.
The spikes from one side of the channel or the orizzontal lines signal a possible entry signal for a spread trading strategy.
Regression Channel, Candles and Candlestick Patterns by MontyRegression Candles by ugurvu
Regression Channel by Tradingview
All Candlestick Patterns By Tradingview
This script was combined for a friend of mine who needed this.
This Script has regression candles by ugurvu, Regression channel and Candlestick patterns by tradingview.
The intention was to fuse these together so more information can be processed on the cost of a single indicator.
Faytterro EstimatorWhat is Faytterro Estimator?
This indicator is an advanced moving average.
What it does?
This indicator is both a moving average and at the same time, it predicts the future values that the price may take based on the values it has taken before.
How it does it?
takes the weighted average of data of the selected length (reducing the weight from the middle to the ends). then draws a parabola through the last three values, creating a predicted line.
How to use it?
it is simple to use. You can use it both as a regression to review past prices, and to predict the future value of a price. uptrends are in green and downtrends are in red. color change indicates a possible trend change.
T.O/REG/Gauss LineHi Dear Traders/Dealers!
I present you here 3 lines that I developed myself base on statistical issues.
+Reg. Line
+Gauss Line
+T.O Line
-Reg. Line based on linear regression of previous inputs to make an average value.
-Gauss Line based on Gaussian mean value, Standard Deviation and it uses previous inputs to make an average value.
-T.O Line based on Gaussian and RMA methods generate an average value.
Hopefully useful for you!
Best regards and happy trading
Shakib
Oscillating SSL Channel Strategy - 3m & 5m Time FramesThis script is pretty self-explanatory. I will suggest trying some different exits to get that win rate above 20% (I'd start with Take Profit and Stop Loss percentages).
Enjoy!
TASC 2022.09 LRAdj EMA█ OVERVIEW
TASC's September 2022 edition of Traders' Tips includes an article by Vitali Apirine titled "The Linear Regression-Adjusted Exponential Moving Average". This script implements the titular indicator presented in this article.
█ CONCEPT
The Linear Regression-Adjusted Exponential Moving Average (LRAdj EMA) is a new tool that combines a linear regression indicator with exponential moving averages . First, the indicator accounts for the linear regression deviation, that is, the distance between the price and the linear regression indicator. Subsequently, an exponential moving average (EMA) smooths the price data and and provides an indication of the current direction.
As part of a trading system, LRAdj EMA can be used in conjunction with an exponential moving average of the same length to identify the overall trend. Alternatively, using LRAdj EMAs of different lengths together can help identify turning points.
█ CALCULATION
The script uses the following input parameters:
EMA Length
LR Lookback Period
Multiplier
The calculation of LRAdj EMA is carried out as follows:
Current LRAdj EMA = Prior LRAdj EMA + MLTP × (1+ LRAdj × Multiplier ) × ( Price − Prior LRAdj EMA ),
where MLTP is a weighting multiplier defined as MLTP = 2 ⁄ ( EMA Length + 1), and LRAdj is the linear regression adjustment (LRAdj) multiplier:
LRAdj = (Abs( Current LR Dist )−Abs( Minimum LR Dist )) ⁄ (Abs( Maximum LR Dist )−Abs( Minimum LR Dist ))
When calculating the LRAdj multiplier, the absolute values of the following quantities are used:
Current LR Dist is the distance between the current close and the linear regression indicator with a length determined by the LR Lookback Period parameter,
Minimum LR Dist is the minimum distance between the close and the linear regression indicator for the LR lookback period ,
Maximum LR Dist is the maximum distance between the close and the linear regression indicator for the LR lookback period .
Polynomial Regression Derivatives [Loxx]Polynomial Regression Derivatives is an indicator that explores the different derivatives of polynomial position. This indicator also includes a signal line. In a later release, alerts with signal markings will be added.
Polynomial Derivatives are as follows
1rst Derivative - Velocity: Velocity is the directional speed of a object in motion as an indication of its rate of change in position as observed from a particular frame of reference and as measured by a particular standard of time (e.g. 60 km/h northbound). Velocity is a fundamental concept in kinematics, the branch of classical mechanics that describes the motion of bodies.
2nd Derivative - Acceleration: In mechanics, acceleration is the rate of change of the velocity of an object with respect to time. Accelerations are vector quantities (in that they have magnitude and direction). The orientation of an object's acceleration is given by the orientation of the net force acting on that object.
3rd Derivative - Jerk: In physics, jerk or jolt is the rate at which an object's acceleration changes with respect to time. It is a vector quantity (having both magnitude and direction). Jerk is most commonly denoted by the symbol j and expressed in m/s3 (SI units) or standard gravities per second (g0/s).
4th Derivative - Snap: Snap, or jounce, is the fourth derivative of the position vector with respect to time, or the rate of change of the jerk with respect to time. Equivalently, it is the second derivative of acceleration or the third derivative of velocity.
5th Derivative - Crackle: The fifth derivative of the position vector with respect to time is sometimes referred to as crackle. It is the rate of change of snap with respect to time.
6nd Derivative - Pop: The sixth derivative of the position vector with respect to time is sometimes referred to as pop. It is the rate of change of crackle with respect to time.
Included:
Loxx's Expanded Source Types
Loxx's Moving Averages
Polynomial Regression Bands w/ Extrapolation of Price [Loxx]Polynomial Regression Bands w/ Extrapolation of Price is a moving average built on Polynomial Regression. This indicator paints both a non-repainting moving average and also a projection forecast based on the Polynomial Regression. I've included 33 source types and 38 moving average types to smooth the price input before it's run through the Polynomial Regression algorithm. This indicator only paints X many bars back so as to increase on screen calculation speed. Make sure to read the tooltips to answer any questions you have.
What is Polynomial Regression?
In statistics, polynomial regression is a form of regression analysis in which the relationship between the independent variable x and the dependent variable y is modeled as an nth degree polynomial in x. Polynomial regression fits a nonlinear relationship between the value of x and the corresponding conditional mean of y, denoted E(y |x). Although polynomial regression fits a nonlinear model to the data, as a statistical estimation problem it is linear, in the sense that the regression function E(y | x) is linear in the unknown parameters that are estimated from the data. For this reason, polynomial regression is considered to be a special case of multiple linear regression .
Related indicators
Polynomial-Regression-Fitted Oscillator
Polynomial-Regression-Fitted RSI
PA-Adaptive Polynomial Regression Fitted Moving Average
Poly Cycle
Fourier Extrapolator of Price w/ Projection Forecast
Polynomial-Regression-Fitted RSI [Loxx]Polynomial-Regression-Fitted RSI is an RSI indicator that is calculated using Polynomial Regression Analysis. For this one, we're just smoothing the signal this time. And we're using an odd moving average to do so: the Sine Weighted Moving Average. The Sine Weighted Moving Average assigns the most weight at the middle of the data set. It does this by weighting from the first half of a Sine Wave Cycle and the most weighting is given to the data in the middle of that data set. The Sine WMA closely resembles the TMA (Triangular Moving Average). So we're trying to tease out some cycle information here as well, however, you can change this MA to whatever soothing method you wish. I may come back to this one and remove the point modifier and then add preliminary smoothing, but for now, just the signal gets the smoothing treatment.
What is Polynomial Regression?
In statistics, polynomial regression is a form of regression analysis in which the relationship between the independent variable x and the dependent variable y is modeled as an nth degree polynomial in x. Polynomial regression fits a nonlinear relationship between the value of x and the corresponding conditional mean of y, denoted E(y |x). Although polynomial regression fits a nonlinear model to the data, as a statistical estimation problem it is linear, in the sense that the regression function E(y | x) is linear in the unknown parameters that are estimated from the data. For this reason, polynomial regression is considered to be a special case of multiple linear regression .
Included
Alerts
Signals
Bar coloring
Loxx's Expanded Source Types
Loxx's Moving Averages
Other indicators in this series using Polynomial Regression Analysis.
Poly Cycle
PA-Adaptive Polynomial Regression Fitted Moving Average
Polynomial-Regression-Fitted Oscillator
Polynomial-Regression-Fitted Oscillator [Loxx]Polynomial-Regression-Fitted Oscillator is an oscillator that is calculated using Polynomial Regression Analysis. This is an extremely accurate and processor intensive oscillator.
What is Polynomial Regression?
In statistics, polynomial regression is a form of regression analysis in which the relationship between the independent variable x and the dependent variable y is modeled as an nth degree polynomial in x. Polynomial regression fits a nonlinear relationship between the value of x and the corresponding conditional mean of y, denoted E(y |x). Although polynomial regression fits a nonlinear model to the data, as a statistical estimation problem it is linear, in the sense that the regression function E(y | x) is linear in the unknown parameters that are estimated from the data. For this reason, polynomial regression is considered to be a special case of multiple linear regression .
Things to know
You can select from 33 source types
The source is smoothed before being injected into the Polynomial fitting algorithm, there are 35+ moving averages to choose from for smoothing
This indicator is very processor heavy. so it will take some time load on the chart. Ideally the period input should allow for values from 1 to 200 or more, but due to processing restraints on Trading View, the max value is 80.
Included
Alerts
Signals
Bar coloring
Other indicators in this series using Polynomial Regression Analysis.
Poly Cycle
PA-Adaptive Polynomial Regression Fitted Moving Average
Many Moving AveragesA smooth looking indicator created from a mix of ALMA and LRC curves. Includes alternative calculation for both which I came up with through trial and error so a variety of combinations work to varying degrees. Just something I was playing around with that looked pretty nice in the end.
Regression Channel Alternative MTF█ OVERVIEW
This indicator displays 3 timeframes of parallel channel using linear regression calculation to assist manual drawing of chart patterns.
This indicator is not true Multi Timeframe (MTF) but considered as Alternative MTF which calculate 100 bars for Primary MTF, can be refer from provided line helper.
The timeframe scenarios are defined based on Position, Swing and Intraday Trader.
█ INSPIRATIONS
These timeframe scenarios are defined based on Harmonic Trading : Volume Three written by Scott M Carney.
By applying channel on each timeframe, MW or ABCD patterns can be easily identified manually.
This can also be applied on other chart patterns.
█ CREDITS
Scott M Carney, Harmonic Trading : Volume Three (Reaction vs. Reversal)
█ TIMEFRAME EXPLAINED
Higher / Distal : The (next) longer or larger comparative timeframe after primary pattern has been identified.
Primary / Clear : Timeframe that possess the clearest pattern structure.
Lower / Proximate : The (next) shorter timeframe after primary pattern has been identified.
Lowest : Check primary timeframe as main reference.
█ EXAMPLE OF USAGE / EXPLAINATION
BTC - Novel RPPI IndicatorHey Everyone,
This is a collab effort between me (a statistician) and @Stein3d (A coder). So if you like this indicator, be sure to also give him the credit!
This a novel indicator theorized by me and applied by Stein3d. We are calling it the RPPI indicator, standing for Regression based Price Prediction Indicator.
This is specifically coded for BTC and cannot be used for alt coins or ETH.
This is pretty beta so your feedback and comments are encouraged!
I will keep it brief, but here is the run down:
What does it do:
The indicator does 3 main things:
1. Predicts bullish targets;
2. Predicts bearish targets;
3. Predicts close price
Who is it applicable for:
This is generally targeted to day trades, but it can have swing trade applications as well. Feel free to get creative with combining it with other indicators that you feel complement it well.
How does it work:
It uses statistical based regressive analysis of BTC to compare current price action to previous price action and determine where the natural high and lows will fall intra-day based on the current price action of the day.
How to use it:
This does not omit the need for technical analysis and chart interpretation; however, it sets realistic expectations of intra-day bullish and bearish price targets as well as its best guess of where the current day close is most likely to fall. Take a look at some of the images below:
The image is pretty self explanatory but you see that there are 2 bull and bear targets. The bull targets, of course, are listed in Green and the bear targets are listed in Red.
There is a dummy neutral support and resistance target which is listed in yellow and the close price is in the purple dotted line.
Of course these are all customizable.
I think that pretty much covers it in a nut shell but let us know if you have any other questions and also please provide feedback!
Thanks for checking it out!
RAS.V2 Strength Index OscillatorHeavily modified version of my previous "Relative Aggregate Strength Oscillator" -Added high/low lines, alma curves,, lrc bands, changed candle calculations + other small things. Replaces the standard RSI indicator with something a bit more insightful.
Credits to @wolneyyy - 'Mean Deviation Detector - Throw Out All Other Indicators ' And @algomojo - 'Responsive Coppock Curve'
And the default Relative Strength Index
The candles are the average of the MFI ,CCI ,MOM and RSI candles, they seemed similar enough in style to me so I created candles out of each and the took the sum of all the candle's OHLC values and divided by 4 to get an average, same as v1 but with some tweaks. Previous Peaks and Potholes visible with the blue horizontal lines which adjust when a new boundary is established. Toggle alma waves or smalrc curves or both to your liking. This indicator is great for calling out peaks and troughs in realtime, although is best when combined with other trusted indicators to get a consensus.
Polynomial Regression Extrapolation [LuxAlgo]This indicator fits a polynomial with a user set degree to the price using least squares and then extrapolates the result.
Settings
Length: Number of most recent price observations used to fit the model.
Extrapolate: Extrapolation horizon
Degree: Degree of the fitted polynomial
Src: Input source
Lock Fit: By default the fit and extrapolated result will readjust to any new price observation, enabling this setting allow the model to ignore new price observations, and extend the extrapolation to the most recent bar.
Usage
Polynomial regression is commonly used when a relationship between two variables can be described by a polynomial.
In technical analysis polynomial regression is commonly used to estimate underlying trends in the price as well as obtaining support/resistances. One common example being the linear regression which can be described as polynomial regression of degree 1.
Using polynomial regression for extrapolation can be considered when we assume that the underlying trend of a certain asset follows polynomial of a certain degree and that this assumption hold true for time t+1...,t+n . This is rarely the case but it can be of interest to certain users performing longer term analysis of assets such as Bitcoin.
The selection of the polynomial degree can be done considering the underlying trend of the observations we are trying to fit. In practice, it is rare to go over a degree of 3, as higher degree would tend to highlight more noisy variations.
Using a polynomial of degree 1 will return a line, and as such can be considered when the underlying trend is linear, but one could improve the fit by using an higher degree.
The chart above fits a polynomial of degree 2, this can be used to model more parabolic observations. We can see in the chart above that this improves the fit.
In the chart above a polynomial of degree 6 is used, we can see how more variations are highlighted. The extrapolation of higher degree polynomials can eventually highlight future turning points due to the nature of the polynomial, however there are no guarantee that these will reflect exact future reversals.
Details
A polynomial regression model y(t) of degree p is described by:
y(t) = β(0) + β(1)x(t) + β(2)x(t)^2 + ... + β(p)x(t)^p
The vector coefficients β are obtained such that the sum of squared error between the observations and y(t) is minimized. This can be achieved through specific iterative algorithms or directly by solving the system of equations:
β(0) + β(1)x(0) + β(2)x(0)^2 + ... + β(p)x(0)^p = y(0)
β(0) + β(1)x(1) + β(2)x(1)^2 + ... + β(p)x(1)^p = y(1)
...
β(0) + β(1)x(t-1) + β(2)x(t-1)^2 + ... + β(p)x(t-1)^p = y(t-1)
Note that solving this system of equations for higher degrees p with high x values can drastically affect the accuracy of the results. One method to circumvent this can be to subtract x by its mean.
ATR ChartATR Levels
Calculated by adding ATR to daily low and subtracting ATR from daily high.
Inputs can change ATR timeframe and range, defaults to 6 hr and daily.
Colorful RegressionColorful Regression is a trend indicator. The most important difference of it from other moving averages and regressions is that it can change color according to the momentum it has. so that users can have an idea about the direction, orientation and speed of the graph at the same time. This indicator contains 5 different colors. Black means extreme downtrend, red means downtrend, yellow means sideways trend, green means uptrend, and white means extremely uptrend. I recommend using it on the one hour chart. You can also use it in different time periods by changing the sensitivity settings.
TURK RSI+ICHIMOKUTypical RSI indicators were plotted with candles and expressed wick to resemble a candle chart,
and linear regression was added to predict changes in force intensity,
which allowed us to confirm support and resistance within linear regression .
In addition, divergence signal was marked as an additional basis for the price fluctuation point due to support and resistance .
In other words,
if the diversity signal appears together when the rsi candle is supported and resisted within linear regression ,
this is the basis for predicting that it is a point of change in the existing trend.
Finally, the period value and standard deviation of linear regression can be arbitrarily modified and used.
I hope it will help you with your trading.
--------------------------------------------------------------------------------------------------------------------------------------------------------------
(+ichimoku cloud)
Clouds made of the preceding span 1 and the preceding span 2 of the balance table can predict the trend by displaying the current price balance ahead of the future.
In addition to the role of clouds in the above-described balance sheet , this indicator also shows the cloud band support and resistance of the current RSI value.
TG:- @turk_shariq
Return & Drawdown
ReDraw script calculates the historical returns and drawdown for the given periods.
By default, the return of the linear regression trends is displayed (can be turned off in settings). In this mode, two linear regression trends are being computed for both long and short periods, and the percent value indicates the "return of the trend" for the corresponding period. Observing the dynamic of the linear regression trends can give a great hint if the trend is slowing down.
When the smoothing method is set to "none" or WMA3/5, the real asset return is shown for both periods, using the formula (LastPrice-FirstPrice)/FirstPrice
The script calculates the maximum drawdown for the long period using the formula (max(Price) - LastPrice) / max(Price).
The white line under the zero is the average maximum drawdown over the long period.
When the mode is set to Compare, ReDraw will display the difference in metrics between the current and selected symbol (SPY by default).
Super trend BThis indicator is a mix of 3 well known indicators
the buy point is based on linear regression
the sell points are based on mix of super trend and Bollinger
it try to find best point to sell and buy which are independent from each other
for each time frame you need to try to search for best setting
alerts included
Mocker Market Mean IndicatorThe objective of this indicator is to find the historical mean price of a market ( Intended for Indexes or ETF's). Based off of the concept that Benjamin Graham taught, that Mr. Market is a manic depressive forever oscillating between unjustified pessimism to extreme optimism. The intent of this indicator is to supplement a regular allocation strategy to an index or ETF , to increase that allocation when it's trading below its historical mean and decrease when trading above. It does this by using an exponential regression model to find the closest approximation of the current mean price based on past growth rate, and user defined lookback period.
Relative slopeRelative slope metric
Description:
I was in need to create a simple, naive and elegant metric that was able to tell how strong is the trend in a given rolling window. While abstaining from using more complicated and arguably more precise approaches, I’ve decided to use Linearly Weighted Linear Regression slope for this goal. Outright values are useful, but the problem was that I wasn’t able to use it in comparative analysis, i.e between different assets & different resolutions & different window sizes, because obviously the outputs are scale-variant.
Here is the asset-agnostic, resolution-agnostic and window size agnostic version of the metric.
I made it asset agnostic & resolution agnostic by including spread information to the formula. In our case it's weighted stdev over differenced data (otherwise we contaminate the spread with the trend info). And I made it window size agnostic by adding a non-linear relation of length to the output, so finally it will be aprox in (-1, 1) interval, by taking square root of length, nothing fancy. All these / 2 and * 2 in unexpected places all around the formula help us to return the data to it’s natural scale while keeping the transformations in place.
Peace TV