Polynomial Regression Channels¶
Definition¶
The Polynomial Regression Channels (PRC) is an indicator that draws a best-fit n-degree polynomial regression line to recent price data and creates a channel around it. Bands are drawn above and below the regression line at user-specified multiples of standard deviation, automatically adjusting to reflect changes in volatility. This indicator helps identify the overall trend of a security, as well as potential support and resistance levels.
History¶
The PRC indicator traces its roots to the broader concept of regression analysis, which dates back to the 19th century with the work of Francis Galton and Karl Pearson. Polynomial regression, an extension of linear regression, is a method of analysis that models the relationship between an independent variable and a dependent variable using an n-degree polynomial. Thus, polynomial regression creates a polynomial function that approximates a set of data points.
Calculations¶
Upper Channel of PRC:
\[ SQH = { PRL + ( k \times StdDev ) } \]
Lower Channel of PRC:
\[ SQL = { PRL - ( k \times StdDev ) } \]
\(PRL\) – the polynomial regression line, a polynomial function fitted to the price data over a given period:
\[ y = { a_0 + a_1 x^2 ... a_n x^n } \]
\(y\) – the price (dependent variable)
\(x\) – the time (bar index)
\(a_0\) – the constant term (intercept)
\(a_1, a_2 ... a_n\) – the coefficients for the polynomial terms
\(n\) – the degree of PRL
\(k\) – a user-defined multiplier that determines how far away the channels are from PRL
\(StdDev\) – the Standard Deviation multiples, calculated from the residuals, which are the differences between the actual price data points and the values predicted by the polynomial regression line.
Interpretation¶
Bands will be drawn between two standard deviation multiples on both sides of the polynomial regression line. The default parameter values for the calculation are as follows:
-
The default number of bars to analyse is set to 120. The period specified dictates the number of most recent bars which are used in the computation of the polynomial regression. As new bars form, the polynomial regression will dynamically adjust to the most recent period of bars.
-
The default degree of PRL is set to 3. Traders may choose from the 1st to the 6th degree.
-
The multiplier for the Upper Channel is set to 2, while the multiplier for the Lower Channel is set to 1.62.
The main patterns of the indicator behaviour can be interpreted as follows:
-
Crossovers – when the price crosses above the Upper Channel, it indicates potential upward momentum. Conversely, when the price crosses below the Lower Channel, it suggests downward pressure.
-
Rising and falling – if the PRL is rising, it indicates a bullish trend, suggesting that prices are likely to continue increasing. If the PRL is falling, it signifies a bearish trend, indicating that prices may continue to decline.
-
Divergence and convergence – if the price makes a new high while the PRL does not, it may signal a potential reversal or weakening momentum. This divergence suggests that the trend might be losing strength. If both the price and the PRL make new highs or lows simultaneously, it indicates that the current trend is likely to continue.
-
Shift – by adjusting the shift parameter to alter the alignment of the PRC indicator with price data on the chart, you can explore how the PRC readings correspond to past or future price movements.
Application¶
-
Buy signal – when the low price crosses below the lower regression channel (support), it can be interpreted as a possibility to enter a long position.
-
Sell signal – when the high price crosses above the upper regression channel (resistance), it can be interpreted as a possibility to enter a short position.
-
Stop-loss placement – to protect against a breakout, consider placing a stop loss just below the lower channel line for long positions and above the upper channel line for short positions.
-
Exit strategies – consider exiting when the price reaches the upper channel line, especially if there are signs of reversal, such as bearish candlestick patterns. Similarly, you can exit when the price approaches the lower channel line, particularly if there are indications of a bullish reversal.
-
Confirming trades – to confirm signals generated by the PRC, look for additional indicators such as the Relative Strength Index (RSI) or moving averages. The RSI indicator helps to identify overbought or oversold conditions; for example, an RSI below 30 can support a buy signal at the lower channel line. Also, a price crossing above a moving average while touching the lower channel line may strengthen a buy signal.
Note
You can take advantage of algo trading, with cBots executing trades based on the signals from this indicator, as shown in our examples. Learn more about how to use indicators in cBots.
Limitations¶
The PRC indicator has limitations, including its sensitivity to outliers, which can distort trend lines and lead to false signals. Additionally, the PRC may lag in volatile markets, resulting in delayed entries or exits. It relies heavily on historical price data, making it less effective in predicting sudden market changes or news-driven events.
Summary¶
The Polynomial Regression Channels indicator utilises polynomial regression to create upper and lower channel lines that capture price trends and key support and resistance levels. By analysing historical price data, the PRC helps traders identify potential entry and exit points based on price interactions with the channel lines. It effectively highlights trends and supports informed decision-making, making it a valuable tool when used alongside other indicators for enhanced market analysis.