All indicators

Logistic Regression ICT FVG

Jul 5, 2025

Static chart image
Support and ResistanceSignalsMachine LearningFVG

The Logistic Regression ICT FVG indicator identifies Fair Value Gaps (FVGs) and applies a machine learning model to score each gap based on its probability of being respected by price. This tool aims to filter market noise by using statistical analysis to prioritize high-impact liquidity zones over standard imbalances.

Usage

The indicator identifies bullish and bearish imbalances based on volatility-aware candle logic. Once a gap is detected, the script monitors price action to see if the zone is respected or invalidated.

A key feature is the Probability-Based Filtering. Every Fair Value Gap is assigned a confidence score (displayed as a percentage). Only gaps that meet the user-defined "Logistic Threshold %" are plotted on the chart. This allows traders to focus on setups that the model deems high-probability based on historical performance and current context.

The script also includes Real-Time Retest Tracking. It observes how many times price enters a gap without breaking it. If a gap is respected a specific number of times (defined by the "Max Retried FVG Count"), it is marked as "respected" and used to further train the internal model.

Details

The script implements a Logistic Regression model using gradient descent. For every detected FVG, the script captures three primary features:

  1. RSI: The Relative Strength Index at the time of gap formation.
  2. MACD: The MACD line value at the time of gap formation.
  3. Body Size: The absolute size of the candle body that created the imbalance.

These features are normalized and passed through a logistic function to predict whether the gap will be respected. The model is "self-learning," meaning it updates its internal weights (B0, B1, B2, B3) on every bar based on the error between its predictions and actual price behavior around historical gaps.

Settings

Logistic Regression

  • Max Retried FVG Count: The minimum number of times price must enter and be rejected by a zone for the model to consider it a "respected" gap for training purposes.
  • Logistic Threshold %: The minimum probability score (0-100%) required for an FVG to be displayed on the chart.
  • Learning Rate: Controls the speed at which the model updates its weights. Higher values make the model adapt faster to recent data, while lower values provide more stability.

View

  • Show Historic FVGs: Toggles whether to display gaps that have already been invalidated or reached their maximum lifetime.
  • Max FVG Length (bars): The maximum duration a gap remains active on the chart before expiring.
  • Bullish/Bearish FVG Color: Customizes the visual appearance of the identified zones.

FAQ

How do I use the probability scores?

The scores represent the model's confidence that a specific FVG will act as a support or resistance zone. Higher percentages indicate that the current market context (RSI, MACD, and Volatility) aligns with historical instances where gaps were respected.

Why do some FVGs disappear?

Gaps will disappear if they are "broken" (price moves entirely through them), if they exceed the "Max FVG Length," or if they do not meet the minimum "Logistic Threshold %" set in the inputs.

How can I access this tool?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.