Selezione editoriale
OPEN-SOURCE SCRIPT

Support and Resistance Logistic Regression | Flux Charts

17 217
💎 GENERAL OVERVIEW
Introducing our new Logistic Regression Support / Resistance indicator! This tool leverages advanced statistical modeling "Logistic Regressions" to identify and project key price levels where the market is likely to find support or resistance. For more information about the process, please check the "HOW DOES IT WORK ?" section.

istantanea

Logistic Regression Support / Resistance Features :
  • Intelligent S/R Identification: The indicator uses a logistic regression model to intelligently identify and plot significant support and resistance levels.
  • Predictive Probability: Each identified level comes with a calculated probability, indicating how likely it is to act as a true support or resistance based on historical data.
  • Retest & Break Labels: The indicator clearly marks on your chart when a detected support or resistance level is retested (price touches and respects the level) or broken (price decisively crosses through the level).
  • Alerts: Real-time alerts for support retests, resistance retests, support breaks, and resistance breaks.
  • Customizable: You can change support & resistance line style, width and colors.


🚩UNIQUENESS
What makes this indicator truly unique is its application of logistic regression to the concept of support and resistance. Instead of merely identifying historical highs and lows, our indicator uses a statistical model to predict the future efficacy of these levels. It analyzes underlying market conditions (like RSI and body size at pivot formation) to assign a probability to each potential S/R zone. This predictive insight, combined with dynamic, real-time labeling of retests and breaks, provides a more robust and adaptive understanding of market structure than traditional, purely historical methods.

📌HOW DOES IT WORK ?

The Logistic Regression Support / Resistance indicator operates in several key steps:

  • First, it identifies significant pivot highs and lows on the chart based on a user-defined "Pivot Length." These pivots are potential areas of support or resistance.

  • For each detected pivot, the indicator extracts relevant market data at that specific point, including the RSI (Relative Strength Index) and the Body Size (the absolute difference between the open and close price of the candle). These serve as input features for the model.

  • The core of the indicator lies in its logistic regression model. This model is continuously trained on past pivot data and their subsequent behavior (i.e., whether they were "respected" as support/resistance multiple times). It learns the relationship between the extracted features (RSI, Body Size) and the likelihood of a pivot becoming a significant S/R level.

  • When a new pivot is identified, the model uses its learned insights to calculate a prediction value—a probability (from 0 to 1) that this specific pivot will act as a strong support or resistance.

  • If the calculated probability exceeds a user-defined "Probability Threshold," the pivot is designated a "Regression Pivot" and drawn on the chart as a support or resistance line. The indicator then actively tracks how price interacts with these levels, displaying "R" labels for retests when the price bounces off the level and "B" labels for breaks when the price closes beyond it.


istantanea

⚙️SETTINGS

1. General Configuration
Pivot Length: This setting defines the number of bars used to determine a significant high or low for pivot detection.

Target Respects: This input specifies how many times a level must be "respected" by price action for it to be considered a strong support or resistance level by the underlying model.

Probability Threshold: This is the minimum probability output from the logistic regression model for a detected pivot to be considered a valid support or resistance level and be plotted on the chart.

2. Style

Show Prediction Labels: Enable or disable labels that display the calculated probability of a newly identified regression S/R level.

Show Retests: Toggle the visibility of "R" labels on the chart, which mark instances where price has retested a support or resistance level.

Show Breaks: Toggle the visibility of "B" labels on the chart, which mark instances where price has broken through a support or resistance level.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.