Periodic Linear Regressions
By LuxAlgoSep 25, 2024
The Periodic Linear Regressions (PLR) indicator offers traders an insightful way to analyze market trends by calculating linear regressions based on customizable time intervals, similar to the VWAP indicator. This feature allows traders to uncover potential supports and resistances in the market by aligning the regressions with underlying price trends.
How to Trade the Periodic Linear Regressions Indicator?
The PLR indicator operates by calculating a linear regression within a user-defined "Anchor Period." This adjustable interval is crucial for tailoring the analysis to different trading strategies, whether short-term or long-term. The indicator can display the regression line either as a static line, which readjusts for new data points until the period ends, or as a rolling average, where new values are derived from the latest point on a regression line fitted over the interval. The static method may repaint but is valuable for highlighting the linearity of trends and for suggesting future price directions.
An innovative feature of the PLR indicator is its extremities, defined by the root mean squared error (RMSE) between the price and the regression line. The Multiple setting allows traders to adjust the distance between these extremities, which can be critical for identifying support and resistance levels in price channels.
The PLR provides significant value in identifying trading opportunities within price ranges or channels, making it a versatile tool for various market conditions.
For ease of tracking, the PLR indicator marks where a new analysis period begins (the anchor), often visible in the top right of the chart.
The indicator also includes a display for extremities, accessible by enabling the Show Extremities option in settings, applicable to both the Rolling and Static methods.
Additionally, users can opt for a gradient background color in the bands, though this is exclusive to the Rolling method. The color changes within the bands also serve as trend indicators: green hues suggest upward trends while red hints at downward momentum.
Technical Details of the Periodic Linear Regressions Indicator
Anchor Type Explained
The Anchor Type setting is pivotal in determining how the PLR indicator resets and recalculates. When set to Periodic, the indicator resets with each new Anchor Period. If set to anchor at First Bar, the rolling line continues its calculation across the entire session, aiding in detecting long-term potential highs and lows.
Traders should note that a minimum of two values is required for linear regression, which explains why static lines don't appear from the first bar of a session. The rolling regression starts displaying on the third bar due to its requirement for a preceding value.
Rolling vs. Static Methods
When using a Periodic Anchor Type, the indicator calculates linear regressions from the session's starting point to the current bar, seeking the best fit line.
In the rolling method, the script connects the most recent calculated point to the previous one, while in the static method, it displays the most recent line.
Remember that two values are essential for calculating linear regression, influencing how and when lines appear within a session.
Customizing PLR Indicator Settings
- Method: Choose between "Static" (straight line) or "Rolling" (rolling linear regression).
- Anchor Type: Select "Periodic" or "First Bar" ("First Bar" works exclusively with "Rolling" method).
- Anchor Period: Applicable when "Anchor Type" is set to Periodic.
- Source: Options include open, high, low, close, and more.
- Multiple: Adjusts the width of the bands when extremities are shown.
- Show Extremities: Toggles the display of upper and lower extremities.
Color and Display Options
- Mono Color: Used when "Bicolor" is off.
- Bicolor: On/Off toggle and color selection.
- Gradient: Applies a background color to extremities.
Dashboard Customization
- Show Dashboard
- Location: Choose where the dashboard appears.
- Text Size: Adjust to preference.
FAQ About Periodic Linear Regressions Indicator
How can I access the Periodic Linear Regressions Indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What is the purpose of the extremities in the PLR indicator?
The extremities based on RMSE help identify support and resistance zones, key for range-bound trading.
Why doesn’t the static line show from the session start?
Linear regression calculations require at least two points, which is why the static line doesn't appear at the session's start.
Free indicator
Get free access to this indicator on the platforms below.
The Library is free. Quant makes it yours.
Pull any concept or indicator into Quant: rebuild it, retune it, or turn it into a backtested strategy of your own.
