Predictive Monte Carlo Engine [LuxAlgo]The Predictive Monte Carlo Engine tool is a high-performance forecasting suite that uses probabilistic simulations to project future price paths based on historical volatility and market regimes.
🔶 USAGE
The indicator generates hundreds of potential price paths starting from the current bar (or an anchored point) to visualize the most likely price distribution over a user-defined projection length. It serves as a powerful volatility and support/resistance mapping tool, providing traders with an "expected value" range rather than a single fixed forecast.
Users can choose between three distinct mathematical methods to generate these paths, apply regime filters to isolate specific market conditions, and utilize a real-time dashboard that renders a visual "forecasted candle" for the next period.
🔹 Anchor Mode
By default, the simulation recalculates and updates on every new bar. By enabling Anchor Mode , users can lock the projection starting point. The engine will then only update every X bars (e.g., every 100 bars). This allows traders to observe how price actually reacted against historical Monte Carlo projections and Support/Resistance levels as the chart progresses.
🔶 DETAILS
The engine utilizes three primary simulation methodologies:
Geometric Brownian Motion (GBM): A stochastic process that assumes returns follow a log-normal distribution. This is the industry standard for modeling asset prices, ensuring prices remain positive and incorporating both drift and volatility.
Simple Random Walk (SRW): A basic additive model where price changes are sampled from a normal distribution based on historical mean and standard deviation.
Historical Shuffle (Bootstrapping): Instead of using random numbers, this method randomly samples actual historical price returns from the lookback period. This preserves the "fat tails" and unique characteristics of the specific asset being traded.
🔹 Regime Filtering
To improve accuracy, the engine can filter the historical data used for simulations. If "Trend" or "Momentum" regimes are selected, the indicator only calculates volatility and drift from past bars that match the current market environment (e.g., only using data from previous uptrends to forecast a current uptrend).
🔹 Fading S/R Zones
The tool identifies four key levels based on the simulation distribution: Max, R1 (90th percentile), S1 (10th percentile), and Min. These are rendered as horizontal zones that feature a unique horizontal gradient, fading as they extend into the future to represent the increasing uncertainty of the projection over time.
🔶 SETTINGS
🔹 Monte Carlo Settings
Simulation Method: Choose between GBM, SRW, or Historical Shuffle.
Regime Filter: Filter historical data by Trend (SMA) or Momentum (RSI).
Historical Lookback: The number of past bars used to calculate volatility.
Projection Length: How many bars into the future the paths extend.
Simulation Count: Number of individual paths to calculate (max 200).
Volatility Multiplier: Scales the historical volatility to simulate "stress-test" scenarios.
Anchor Mode: When enabled, locks the projection to update only at specific intervals.
🔹 Style
Path Percentiles: Adjust the thresholds for coloring the "Top" and "Bottom" path groups.
Colors: Customize the colors for bullish, bearish, and neutral paths, as well as the average projection line.
Show S/R Levels: Toggles the visibility of the horizontally fading Support and Resistance zones.
🔹 Dashboard
Show Dashboard: Toggles the statistical metrics table.
Next Candle Prediction: Enables the "Forecasted Candle" visual, which uses the 1-bar-ahead expected mean and distribution to render a text-based candlestick on the dashboard.
Pine Script® インジケーター






















