Neighboring Price Dispersion [LuxAlgo]The Neighboring Price Dispersion indicator calculates the standard deviation of historical prices within a specific price-based neighborhood of the current market level, providing a unique perspective on local price density and volatility within a long-term distribution.
🔶 USAGE
The indicator is displayed in a separate pane and represents the volatility of prices immediately surrounding the current market price based on a historical buffer. Unlike standard volatility indicators that measure price change over time, this tool measures the spread of prices across "price space."
Users can use this tool to identify "Price Discovery" zones or areas where the current price is trading in historical voids. When the indicator line disappears and the background is highlighted, it indicates that the current price has few or no "neighbors" within the historical distribution, suggesting the market is exploring new price levels.
🔹 Interpreting Dispersion
High Dispersion: Indicates that historical price points near the current level are widely spread out. This often suggests a lack of historical agreement on value at that level or a "thin" market area.
Low Dispersion: Suggests high price density, where many historical data points (OHLC values) are clustered together. These areas often act as "fair value" zones or high-liquidity regions where the market has spent significant time.
Background Highlights: When the background is colored, it signifies a "Discovery" phase. This occurs when the current price is at an extreme (all-time high/low within the buffer) or in a gap where there aren't enough historical neighbors to calculate a valid dispersion.
Signal Components: The indicator includes an orange Signal MA to help identify trends in dispersion and a white Cumulative Mean line to represent the long-term average dispersion of the current session.
🔶 DETAILS
The script maintains a historical buffer of OHLC values (up to 20,000 data points) which are stored in a sorted array. This allows the indicator to construct a "Global Price Distribution" that evolves with every new bar.
Instead of calculating volatility over a lookback period of bars, the script finds the position of the current closing price within the sorted distribution and calculates the standard deviation of the K nearest neighbors.
If the current price is trading in a range it has rarely or never visited within the defined buffer, the indicator will stop plotting. This visual cue signifies that the asset is currently in a state of "discovery," as there is insufficient historical data in that specific price range to determine a local dispersion.
🔶 SETTINGS
Historical Buffer (Bars): The number of historical bars used to build the price distribution. A higher value provides a longer-term memory of price levels.
Neighboring Range (K): The number of neighboring price points to include in the standard deviation calculation. Smaller values respond more quickly to local gaps, while larger values provide a broader view of density.
Smoothing: Applies a Simple Moving Average (SMA) to the dispersion calculation to filter out noise and produce smoother visual transitions.
MA Length: Sets the period for the signal moving average (orange line). This helps smooth the dispersion data to identify broader shifts in price density.
CMean Multiplier: A multiplier applied to the cumulative mean of the dispersion. This adjusts the level of the white baseline relative to the current dispersion values. インジケーター

Price-Point Volume Oscillator [LuxAlgo]The Price-Point Volume Oscillator indicator estimates the volume distribution at the current price level by analyzing historical bars that intersect with the current market price.
🔶 USAGE
This tool provides a unique perspective on volume by filtering historical price action to show only the volume that occurred when the price was at its current level. This helps traders identify whether the current price point has historically been a zone of high buying pressure, heavy selling, or balanced distribution.
The indicator consists of several visual components:
Buy/Sell Volume Areas: The background shows the estimated buying volume (green area) and selling volume (red area) accumulated at the current price over the lookback period.
Volume Delta Histogram: The central histogram represents the net difference (Delta) between buy and sell volume. A green histogram indicates a net positive buying bias at the current price, while a red histogram indicates a net negative selling bias.
Dashboard: A real-time table providing specific metrics, including estimated Buy/Sell totals, the net Delta, and the Delta Percentage.
Traders can use this oscillator to confirm support or resistance levels. For example, if the price approaches a previous level and the Delta Histogram shows significant buying volume at that specific price point, it may suggest strong historical demand.
🔶 DETAILS
The script operates by looping through a user-defined lookback window. For every historical bar, it checks if the current close price falls within that bar's High-Low range. If it does, the volume from that historical bar is "allocated" to the current price level.
To differentiate between buying and selling volume, the script uses a ratio based on where the historical bar closed relative to its range. If a historical bar closed near its high, a larger portion of its volume is attributed to "Buy Volume" at the current price.
🔶 SETTINGS
🔹 Settings
Lookback Window: Determines the number of historical bars the indicator analyzes to find price intersections. A larger window provides a more comprehensive historical view but requires more calculations.
🔹 Visuals
Show Dashboard: Toggles the visibility of the real-time statistics table.
Position: Controls where the dashboard is anchored on the chart (Top Right, Bottom Right, or Bottom Left).
Size: Adjusts the text and table size of the dashboard to fit different screen resolutions.
インジケーター

Hidden Markov Model Market Regimes [LuxAlgo]The Hidden Markov Model Market Regimes indicator uses a mathematical framework to identify whether the current market environment is in a Trending or Ranging state. By analyzing log returns and volatility through a Hidden Markov Model (HMM) approach, the tool provides real-time probability estimates for each regime to help traders adapt their strategies to changing market conditions.
🔶 USAGE
The indicator is displayed in a separate pane below the price chart, showing two oscillating lines representing the probability (0% to 100%) of the market being in a "Trending" or "Ranging" regime.
Trending Regime (Blue): High values indicate a directional market with expanding volatility and persistent returns.
Ranging Regime (Gray): High values indicate a mean-reverting environment with lower volatility and compressed price action.
Neutral Zone: When both lines are near the 50% level, the model is uncertain about the current regime, suggesting a potential transition.
Traders can use these regimes to filter signals: trend-following strategies (like moving average crosses) typically perform better when the Trending probability is high, while mean-reversion strategies (like oscillators) are often more effective during high Ranging probability periods.
🔶 DETAILS
The script implements a simplified version of the HMM Forward Algorithm to estimate "hidden" market states from observable price data.
🔹 Observation Data
The model processes two main inputs:
Log Returns: Used to detect directional movement and momentum.
Volatility: Calculated via standard deviation to differentiate between high-activity trends and low-activity ranges.
🔹 The Forward Algorithm
The indicator calculates "Emission Likelihoods" based on Gaussian heuristics. It assumes that a Ranging state is characterized by low volatility and returns near zero, while a Trending state is characterized by higher volatility and significant price displacement.
The algorithm then combines these likelihoods with the "Transition Matrix" (which assumes regimes tend to persist over time) to calculate the posterior probability of each state. The Learning Rate setting determines how much weight is given to the newest bar's data versus the previous state's probability.
🔶 SETTINGS
🔹 HMM Settings
Lookback Period: Determines the window used to calculate mean returns and volatility benchmarks. A longer lookback provides more stable regime detection, while a shorter lookback is more reactive.
Learning Rate: Controls the sensitivity of the probability updates. A higher value makes the indicator switch between regimes faster, while a lower value filters out market noise.
🔹 Dashboard
Enable Dashboard: Toggles the visibility of the on-screen information table.
Position: Moves the dashboard to different corners of the chart (Top Right, Bottom Right, or Bottom Left).
Size: Adjusts the scale of the dashboard text and cells.
インジケーター

TICK Arbitrage Toolkit [LuxAlgo]The TICK Arbitrage Toolkit is a specialized institutional internal analysis tool designed to track market breadth and identify high probability reversal zones through TICK and TICKQ index monitoring. It provides real time visualization of market sentiment and internal extremes to assist traders in index scalping and mean reversion strategies.
🔶 USAGE
The indicator identifies three distinct extension levels to signal when market internals are reaching extreme overbought or oversold conditions. Traders use these extensions to anticipate potential price exhausts or trend reversals in major indices like the S&P 500 or Nasdaq 100.
The toolkit maps the NYSE TICK or NASDAQ TICKQ values directly onto the price chart by colorizing bars and providing visual markers. A gradient system transitions bar colors based on the intensity of the TICK value, allowing for a clear interpretation of internal momentum without needing a separate pane.
🔹 Extension Levels
The script utilizes three configurable extension levels (defaulting to 800, 1000, and 1200) to categorize the strength of the internal move.
Extension 1: Displays a single marker and begins tracking for new session highs or lows.
Extension 2: Displays two vertical markers to indicate increasing internal pressure.
Extension 3: Displays three vertical markers and reaches maximum color opacity, signaling an extreme arbitrage opportunity.
🔹 Session Tracking
The toolkit automatically tracks the session high and low for the selected TICK source. When the market reaches a New High of Day (NHOD) or New Low of Day (NLOD) in the internals, a professional label is printed to highlight the breakout.
🔶 DETAILS
The toolkit includes a Refresh Frequency setting that allows the script to process data at a higher resolution than the chart timeframe. By selecting a sub minute frequency such as 1S or 5S, the indicator can react to internal spikes that occur within a single chart bar.
The Include High/Low Extremes feature ensures that brief intrabar spikes are captured. Rather than only looking at the close of the TICK bar, the script evaluates the high and low to find the maximum magnitude, providing a more accurate representation of true market stress.
🔶 SETTINGS
🔹 Settings
TICK Source: Select between NYSE TICK for S&P 500 analysis or NASDAQ TICKQ for Nasdaq 100 analysis.
Refresh Frequency: Determines how often the internal data is sampled. Lower values provide more granular intrabar detail.
Include High/Low Extremes: When enabled, the script uses the absolute highest or lowest value within the sampling period to capture spikes.
Extension 1, 2, 3: Numeric thresholds for the three levels of arbitrage intensity.
🔹 Style
Positive TICK Color: The color used for positive internal readings (typically associated with overbought/reversal zones).
Negative TICK Color: The color used for negative internal readings (typically associated with oversold/reversal zones).
Marker Style: Choose between Circles, Triangles, or None for the extension level markers.
🔹 Dashboard
Dashboard: Toggles the visibility of the on screen data table.
Position: Moves the dashboard to different corners of the chart.
Size: Adjusts the scale of the dashboard text and cells.
インジケーター

Stochastic Adaptive %D [LuxAlgo]The Stochastic Adaptive %D Difference Oscillator indicator provides a sophisticated alternative to classic momentum oscillators, prioritizing a balance between high-grade smoothing and adaptive reactivity. By calculating the divergence between a pre-smoothed Stochastic %D and a specialized Adaptive %D signal line, this tool highlights momentum shifts with significantly reduced noise while maintaining the ability to react quickly to trend accelerations.
🔶 USAGE
This indicator is designed for traders who require the clarity of a smooth oscillator without the lag typically associated with heavy filtering. The "Difference Oscillator" component serves as the primary visual guide, representing the spread between momentum and its adaptive average.
🔹 Signal Generation
The indicator features three main visual components:
Standard %D Line: A dual-smoothed stochastic calculation that acts as the core momentum measure, plotted as a dotted line.
Adaptive %D Line: A reactive signal line that adjusts its smoothing alpha based on market intensity, plotted as a dashed line.
Difference Oscillator: A histogram-style fill centered at the 50 midline. This represents the momentum "delta"—when price velocity accelerates away from the adaptive baseline, the oscillator expands, providing earlier warning of trend strength or exhaustion.
When the Standard %D leads the Adaptive %D, the oscillator fills green, suggesting bullish momentum. When it lags, it fills red, suggesting bearish momentum. The expansion and contraction of this fill help identify whether a trend is gaining or losing "torque" relative to its adaptive mean.
🔶 DETAILS
The script achieves its unique balance through a specialized architectural approach that focuses on conserving smoothness while remaining reactive to volatile shifts.
🔹 Smoothness Conservation
To eliminate the "jaggedness" often found in standard Stochastics, the indicator applies a pre-smoothing filter (SMA) to the High, Low, and Close sources. This ensures that the foundation of the calculation is filtered for noise before the Stochastic formula is even applied, resulting in much cleaner oscillations.
🔹 Adaptive Reactivity
The Adaptive %D signal line employs a variable alpha smoothing mechanism. The "speed" of the signal line is dynamically linked to the position of the %D relative to the 50 midline.
Trend Extremes: As momentum reaches overbought (80) or oversold (20) zones, the alpha increases. This allows the signal line to track the %D more aggressively, capturing the peak of the move.
Mean Reversion/Ranging: Near the 50 midline, the alpha decreases, making the signal line more "stubborn" and less prone to whipsaws during low-conviction market phases.
🔶 SETTINGS
🔹 Stochastic Settings
Stochastic Length: The lookback period used for the raw stochastic range calculation.
%K Smoothing: Determines the internal smoothing applied to produce the standard %D line.
Price Pre-Smoothing: The length of the SMA applied to price sources before the oscillator is calculated to ensure foundational smoothness.
🔹 Adaptive Smoothing Settings
Attenuation Factor: A sensitivity multiplier that controls the reactivity of the Adaptive %D. Higher values increase the "inertia" of the adaptive calculation, making the signal line more conservative.
🔹 Colors
Standard %D Color: Sets the color for the core momentum dotted line.
Adaptive %D Color: Sets the color for the reactive signal dashed line.
Bullish/Bearish Color: Defines the colors used for the Difference Oscillator's gradient fill.
インジケーター

KDE Value Clouds [LuxAlgo]The KDE Value Clouds indicator is a quantitative tool that uses Kernel Density Estimation (KDE) to visualize the statistical distribution of price action, identifying high-density "Value Clouds" where the market has spent the most time.
🔶 USAGE
The indicator highlights areas of price " fair value " by calculating the probability density of price across a user-defined lookback period. Traders can use these density clusters to identify significant support and resistance levels that are often invisible to standard trend-following indicators.
🔹 Value Clouds
The " Value Clouds " appear directly on the price chart as gradient boxes. These clouds highlight regions where the density of price action exceeds the 50th percentile of the total distribution.
High Density (Bright Colors): Indicates a "Balance Area" where the market has reached a temporary equilibrium. These often act as magnets for price.
Low Density (Gaps): Indicates "Inefficiency" or fast moves where the market did not spend much time. These areas are often revisited or "filled" later.
🔹 KDE Profile & POC
On the right side of the chart, a smooth horizontal profile represents the continuous density function. The KDE POC (Point of Control) is the single price level with the highest calculated density within the lookback period, serving as the ultimate "anchor" for the current market regime.
🔹 How to use
Traders can look for price to "stall" or range within the bright Value Clouds, as these represent accepted price levels. When price moves into a "Gap" (a low-density area), it often moves quickly until it reaches the next cloud.
The KDE POC can be used as a primary support or resistance level; a breakout above a high-density cloud often signals a shift in market sentiment, while a rejection at the edge of a cloud suggests the market is still in a balanced state.
🔶 DETAILS
🔹 KDE vs. Volume Profile
A standard Volume Profile relies on "bins" (rectangles) to count volume at specific price steps. This can create "jagged" profiles that change drastically depending on the chosen row size.
The KDE Value Clouds approach is different because it uses a continuous probability function. Every price point in the lookback period contributes a small "bell curve" of influence to the total profile. This allows for a much smoother and more mathematically sound representation of where " Value " actually resides, regardless of arbitrary bin sizes.
The core of this indicator relies on two primary mathematical concepts:
Gaussian Kernel Estimation: Instead of simply counting occurrences, the script applies a Gaussian weight to every price point. This results in a "smooth" profile that captures the true shape of the price distribution.
Silverman’s Rule of Thumb: To prevent the clouds from being too noisy or too blurry, the indicator uses Silverman’s rule to calculate an optimal " Bandwidth ." This bandwidth adapts based on the standard deviation of the price data, ensuring the visualization stays relevant across different volatility regimes.
🔶 SETTINGS
🔹 Main Settings
Lookback Period: The number of bars used to calculate the price density. A higher lookback provides a "macro" view of value, while a lower lookback focuses on recent rotations.
Bandwidth Multiplier: Adjusts the "smoothness" of the KDE curve. Increasing this value will make the clouds broader and smoother; decreasing it will make them more granular.
Precision (Steps): Defines the vertical resolution of the density calculation. Higher values result in a more detailed profile.
🔹 Visualization
High/Low Density Colors: Customizes the gradient used for both the side profile and the on-chart clouds.
Profile Width (%): Controls how far the KDE profile extends horizontally across the right side of the chart.
Show Value Cloud on Chart: Toggles the visibility of the background "clouds" that highlight high-density price zones.
インジケーター

Adaptive Bounds RSI [LuxAlgo]The Adaptive Bounds RSI indicator utilizes online 1D K-Means clustering to dynamically adapt RSI overbought and oversold bounds based on evolving market conditions. Unlike traditional RSI thresholds (70/30) that remain static, this tool identifies five shifting clusters to better categorize price action into regimes ranging from deep discount to extreme premium.
🔶 USAGE
The indicator provides a more responsive way to identify overextended market conditions by learning from recent RSI distributions. Instead of relying on fixed levels that may be irrelevant in strong trends, the adaptive bounds expand and contract based on the volatility and momentum of the asset.
🔹 Regime Classification
The tool classifies the market into five distinct regimes based on five internal centroids (clusters):
Extreme Premium (Upper Bound): Represents highly overextended bullish conditions.
Bullish: The zone between the center and the upper bound.
Neutral: The area surrounding the 50-level midline.
Bearish: The zone between the center and the lower bound.
Deep Discount (Lower Bound): Represents highly overextended bearish conditions.
🔹 Signal Markers
The indicator plots circular markers directly on the RSI line when the oscillator crosses the adaptive bounds:
A Bullish Marker appears when the RSI crosses below the adaptive lower bound (Deep Discount).
A Bearish Marker appears when the RSI crosses above the adaptive upper bound (Extreme Premium).
To prevent signal clutter, these markers only reappear once the RSI has returned to cross the 50-level midline, ensuring the market has "reset" before a new overextended signal is generated.
🔶 DETAILS
The core of this indicator is an Online 1D K-Means algorithm. Unlike standard clustering which requires a full dataset, this online version updates its centroids bar-by-bar.
When a new RSI value is calculated, the algorithm determines which of the five centroids is closest to that value. It then shifts that "winning" centroid toward the RSI value by a factor determined by the Learning Rate. This allows the boundaries to "breathe" with the market; in a persistent uptrend, the upper bound will naturally migrate higher to avoid premature overbought signals.
🔶 SETTINGS
🔹 Oscillator Settings
RSI Length: Determines the lookback period for the underlying Relative Strength Index calculation.
🔹 K-Means Settings
Learning Rate (K-Means): Controls how quickly the adaptive bounds react to new data. A higher value makes the bounds move faster, while a lower value provides more stable, "sticky" boundaries.
🔹 Visuals
Lower Bound Color: Sets the color for the lower adaptive boundary and bullish signals.
Upper Bound Color: Sets the color for the upper adaptive boundary and bearish signals.
Auto RSI Color: When enabled, the RSI line matches the chart's foreground color.
RSI Color: Sets the color of the RSI line when "Auto RSI Color" is disabled.
🔶 ALERTS
Regime Flip: Triggers when the market transitions from a Neutral state into a trending cluster (Bullish or Bearish).
Lower Bound Cross: Triggers when the RSI crosses into the Deep Discount zone.
Upper Bound Cross: Triggers when the RSI crosses into the Extreme Premium zone.
インジケーター

Rolling SSA Oscillator [LuxAlgo]The Rolling SSA Oscillator indicator is a cycle-analysis tool that utilizes Singular Spectrum Analysis (SSA) to decompose price action into its most significant periodic components, providing a real-time view of underlying market rhythms. Unlike traditional lagging oscillators, this script uses eigendecomposition to isolate dominant trends and noise-reduced oscillations for better market timing.
🔶 USAGE
The indicator provides two primary components derived from the price's spectral signature: a Long-Term Periodic component and a Short-Term Periodic component. These can be used to identify trend direction, cyclical reversals, and momentum exhaustion.
🔹 Trading Signals
Trend Direction: When the Long-Term Periodic component (solid line) is above the zero level and colored green, the primary underlying cycle is in an upward phase. Conversely, a red line below zero indicates a downward phase.
Cycle Crosses: Traders can look for the Short-Term Periodic component (dotted line) crossing the Long-Term component or the zero line to anticipate shorter-term shifts in momentum.
Normalization: When the "Normalize" setting is enabled, the components are scaled relative to their combined absolute magnitude. This is particularly useful for identifying extreme cycle peaks regardless of absolute price volatility.
🔶 DETAILS
Singular Spectrum Analysis (SSA) is a powerful non-parametric technique used in time-series analysis. This indicator implements a rolling version of SSA through the following mathematical steps:
Embedding: The price data is mapped into a trajectory matrix using the "Window" length defined in the settings.
Decomposition: A covariance matrix is computed, followed by eigendecomposition to find the eigenvalues and eigenvectors.
Grouping & Reconstruction: The eigenvectors are sorted by their energy (eigenvalues). The script specifically reconstructs the first two components to form the Long-Term trend/cycle and the subsequent two components to form the Short-Term cycle.
Because this script uses matrix.eigenvalues() and matrix.eigenvectors() , it requires significant computation. The "Window" input determines the "resolution" of the cycles; a larger window can capture longer-term rhythms but increases the lag and computational load.
🔶 SETTINGS
Window: Controls the embedding dimension (L). This defines the maximum cycle length the indicator can effectively resolve.
Long Term Periodic: Toggles the visibility of the primary trend-following cycle (Components 1 & 2).
Short Term Periodic: Toggles the visibility of the faster, more reactive cycle (Components 3 & 4).
Normalize: If enabled, adjusts the output so that the combined amplitude of both components stays within a consistent range, making it easier to spot cyclical extremes.
🔹 Dashboard
Dashboard: Toggles the on-screen statistics table.
Position: Determines where the dashboard is displayed (Top Right, Bottom Right, or Bottom Left).
Size: Adjusts the text size within the dashboard.
インジケーター

Protected Swings [LuxAlgo]The Protected Swings indicator identifies and confirms high-probability structural levels based on the interaction between liquidity sweeps, Fair Value Gaps (FVG), and Change in State of Delivery (CISD) logic. This tool aims to highlight "protected" highs and lows that are expected to remain intact during trend continuations or market reversals.
🔶 USAGE
The Protected Swings tool is designed to provide clear invalidation levels for stop placement and to help traders avoid false reversals by waiting for candle-body confirmation through specific price series.
🔹 Trend Reversals
A reversal setup occurs when the market sweeps a major liquidity level (such as a previous swing high or low) or taps into a high-timeframe FVG.
A Protected Swing High (PSH) forms after a sweep of a high followed by a close below the opening price of the up-close candle series that created that high. This suggests a shift to a bearish regime.
A Protected Swing Low (PSL) forms after a sweep of a low followed by a close above the opening price of the down-close candle series that created that low. This suggests a shift to a bullish regime.
🔹 Trend Continuation
Once Protected Swings are established, subsequent "stepping stones" often form. In a bearish trend, new PSHs will form as price wicks into internal FVGs and then closes back below the candle series that created the retracement high. These levels serve as trailing stop-loss points or areas to look for refined lower-timeframe entries.
🔹 Entry Refinement
Traders can use Protected Swings to refine Risk:Reward. When a higher-timeframe protected level is confirmed, users can drop to a lower timeframe and wait for a secondary protected swing to form. The "Confirmation Level" shown by the indicator represents the exact price point that must be breached to validate the "protected" status of that swing.
🔶 DETAILS
The script follows a multi-step logic to confirm Protected Swings:
🔹 Liquidity Sweeps
The indicator tracks structural pivots (Fractals) based on the "Sweep Sensitivity" setting. A sweep is detected only when the price wick exceeds a previous pivot high or low, but the candle body remains within the previous extreme. This "wick-only" break suggests liquidity is being grabbed (Stop Run) rather than a displacement break of structure occurring.
🔹 FVG Mitigations
The script detects Fair Value Gaps (3-candle imbalances). If enabled, a swing point is considered a candidate for a Protected Swing if it trades into an active FVG, even if a liquidity sweep of a major pivot did not occur.
🔹 Change in State of Delivery (CISD)
The core confirmation logic (CISD) requires the price to close through the "series."
For a Bullish Protected Swing , the script identifies the series of consecutive down-close candles leading into the low. The opening price of the first candle in that down-series becomes the Confirmation Level.
For a Bearish Protected Swing , it identifies the consecutive up-close candles. The opening price of the first candle in that up-series becomes the level.
The labels (PSL/PSH) only appear once a candle body closes past this level, ensuring the "State of Delivery" has shifted.
🔶 SETTINGS
🔹 Logic Settings
Sweep Sensitivity: Defines the number of bars required on both sides to confirm a structural pivot level to be used for detecting sweeps.
Include FVG Mitigations: When enabled, swings that tap into imbalances can trigger protected swing labels.
FVG Search Lookback: Determines how many bars back the script searches for active imbalances to use as context.
🔹 Visualization
Show Labels: Toggles the PSL (Protected Swing Low) and PSH (Protected Swing High) labels.
Show Confirmation Levels: Displays the horizontal lines representing the candle series opening price that triggered the confirmation.
Show Fair Value Gaps: Visualizes active imbalances on the chart.
Highlight Liquidity Sweeps: Highlights the specific portion of the wick that exceeded the previous structural pivot.
Colors: Customization for bullish and bearish elements and transparency for zones.
インジケーター

Auto Trend Drawing [LuxAlgo]The Auto Trend Drawing indicator summarizes price action into a smooth, continuous curve that highlights the primary market direction and structure.
It is mostly a fun and silly experiment in reproducing users attempts at drawing trends on the chart using the brush tool.
This indicator is subject to repainting and is displayed retrospectively based on the most recent price data.
🔶 USAGE
The Auto Trend Drawing tool provides a clean, visual representation of the current market "flow" by stripping away minor price noise and focusing on significant pivot points. Traders can use this indicator to quickly identify the prevailing trend, potential trend reversals, and the overall rhythm of the market.
Unlike standard trendlines that connect two specific points, this indicator creates a dynamic curve that adapts to the most significant price movements within a user-defined window.
🔹 Trend Identification
Bullish Flow: When the curve is sloping upward and the price generally stays above or near the curve's trajectory.
Bearish Flow: When the curve is sloping downward and the price remains below or near the curve's trajectory.
Consolidation: When the curve flattens out, indicating a lack of clear directional momentum.
🔶 DETAILS
The script employs a multi-step process to generate the trend curve:
Normalization: Price data is normalized using the Average True Range (ATR). This ensures that the simplification process remains consistent across different assets and timeframes regardless of their volatility.
Ramer-Douglas-Peucker (RDP) Algorithm: This algorithm identifies the most "important" anchor points in the price series by recursively simplifying the path. It removes points that deviate less than a certain threshold (set by the Simplification Multiplier) from a straight line.
Catmull-Rom Splines: Once the key anchor points are identified, the script uses Catmull-Rom spline interpolation to connect them. This creates a smooth, aesthetic curve that passes through every identified anchor point, providing a more "organic" look than jagged lines.
🔶 SETTINGS
Window Size: Determines the number of recent bars the indicator analyzes to build the curve.
Simplification Multiplier: Controls the sensitivity of the trend detection. Higher values filter out more noise, resulting in a smoother, more "macro" curve. Lower values allow the curve to follow price more closely.
ATR Length: The period used for the ATR normalization process.
Curve Tension: Adjusts how tightly the spline curve follows the anchor points. A value of 0.5 is centripetal, while higher or lower values change the curvature between points.
Curve Resolution: Sets the number of sub-points calculated between each anchor. Higher values result in a smoother-looking line.
Line Color: Changes the color of the trend curve.
Line Width: Adjusts the thickness of the displayed curve.
インジケーター

Neighboring Price Bands [LuxAlgo]The Neighboring Price Bands indicator provides dynamic support and resistance levels based on the local statistical distribution of historical prices relative to the current market position. Unlike traditional volatility bands that rely on fixed standard deviations, this tool identifies "price neighbors" within a sorted historical buffer to determine where the market has previously found friction.
🔶 USAGE
The indicator helps traders identify potential reversal zones and breakout opportunities by analyzing the density of price action around the current level.
🔹 Support and Resistance
The bands act as flexible zones of interest. The upper (green) band represents a bullish boundary derived from historical prices slightly higher than the current price, while the lower (red) band represents a bearish boundary from prices slightly lower. When the price interacts with these bands, it is entering a zone where historical price density suggests a potential reaction.
🔹 Price Discovery & Breakouts
A unique feature of this tool is the "Discovery" mechanism. If the current price moves beyond the range of its historical "neighbors" (e.g., reaching a new multi-period high or low), the corresponding band will disappear, and a background highlight will appear.
Bullish Discovery: A green background highlight indicates the price is entering uncharted territory relative to the historical buffer, suggesting a strong bullish breakout.
Bearish Discovery: A red background highlight indicates the price is dropping below its local historical distribution, suggesting a strong bearish breakdown.
🔶 DETAILS
The script maintains a historical buffer of prices, which it constantly sorts to create a price distribution. For every new bar, the algorithm performs the following:
It locates the current price within the sorted distribution.
It identifies a specific number of "neighbors" (K) above and below that position.
It calculates a specific percentile within those neighbors to plot the bands.
Because the bands are derived from actual price frequency rather than a calculation like standard deviation (Bollinger Bands) or Average True Range (Keltner Channels), they adapt more specifically to "sticky" price levels where the market has historically spent time.
🔶 SETTINGS
Historical Buffer (Bars): The total number of past bars used to build the price distribution. A larger buffer includes more historical context, while a smaller buffer makes the bands more reactive to recent local ranges.
Neighboring Range (K): Determines how many samples from the sorted distribution are used to calculate the bands. A smaller K makes the bands tighter and more sensitive to the immediate price position.
Percentile: Controls the width of the bands within the neighbor groups. Higher values push the bands further away from the current price.
Smoothing: Applies an SMA to the resulting bands to reduce noise and provide a cleaner visual output.
インジケーター

Volume Energy Reservoirs [LuxAlgo]The Volume Energy Reservoirs indicator is a physics-inspired momentum tool based on a "capacitance" model that treats the market as a system storing potential energy during stability and releasing it as kinetic flow during high-volume trends.
🔶 USAGE
The indicator helps traders identify periods of market compression (Squeezes) and subsequent expansion. It provides a dual-view approach with an oscillator tracking energy flow and on-chart visuals highlighting price consolidation ranges and trend climaxes.
Energy Accumulation (The Box): When the yellow Energy Reservoir fills in the oscillator, a filled Squeeze Box appears on the chart. This represents the "charging" phase where the market is storing potential energy within a tight range.
Range Extension (The Lines): Once the energy building phase completes, the filled box stops, and two horizontal dashed Squeeze Extension Lines project from the box's high and low. These lines define the critical support and resistance levels established during the squeeze.
The Breakout: A breakout is confirmed when a candle closes above or below the extension lines. At this moment, the lines stop drawing, signaling that the stored energy has been released into kinetic momentum.
Trend Monitoring: Follow the Conviction Gradient on the background (default 75% transparency) and the vibrant Kinetic Aura in the oscillator to gauge the strength of the move.
Exhaustion (The Exit): Look for Exhaustion Bubbles on the chart. A Red bubble at a bullish peak or a Green bubble at a bearish trough indicates the trend's "fuel" is spent. Larger bubbles represent higher-volume climaxes.
🔶 DETAILS
The script utilizes a unique "Energy Reservoir" logic to quantify market state by using relative displacement math rather than absolute price values, making it adaptive across different asset classes.
🔹 Squeeze Mechanism
The system transitions through three distinct visual states:
Active Squeeze: A filled yellow box that dynamically expands its high and low boundaries as long as the "Energy Reservoir" is charging (Reservoir > 5).
Post-Squeeze Extension: Once the reservoir level drops, the box is locked. Two horizontal dashed lines extend to the right from the box's maximum high and minimum low.
Breakout Termination: The extension lines persist until the market price closes outside of the defined range, providing a clear visual of the "Range to Beat."
🔹 Exhaustion & Conviction
Exhaustion Bubbles: These signals are specifically coded to ignore consolidation zones, only appearing during active trends when momentum begins to fade at an extreme. Size is determined by relative volume.
Conviction Gradient: A thermal background heatmap (Teal for Bullish, Red for Bearish) that tracks trend conviction directly on the price chart. The default transparency is set to 75 to ensure a balance between visibility and chart clarity.
Kinetic Aura: A vertical gradient glow in the oscillator that scales with the asset's recent volatility and volume-weighted flow.
🔶 SETTINGS
🔹 Main Settings
Energy Horizon: The lookback period used to calculate the price midpoint and range stability for energy accumulation.
Energy Sensitivity: Adjusts how quickly energy is released during volume spikes. Higher values require more significant volume to discharge the reservoir.
🔹 Visual Settings
Highlight Squeeze Range: Toggles the drawing of the filled box and the subsequent extension lines on the chart.
Show Exhaustion Bubbles: Toggles the volume-weighted bubbles that appear during momentum extremes.
Show Conviction Gradient on Chart: Toggles the thermal background gradient on the main price chart.
Background Transparency: Adjusts the maximum opacity of the on-chart conviction gradient (Default: 75). インジケーター

SuperTrend Recovery [LuxAlgo]The SuperTrend Recovery indicator provides a modified version of the classic SuperTrend algorithm that incorporates a dynamic "recovery" mechanism designed to adjust the trailing stop when price action moves significantly against the current trend. This script aims to help traders manage volatile environments by tightening the trend band when the market experiences deep pullbacks without triggering a full trend reversal.
🔶 USAGE
The indicator can be used similarly to a standard SuperTrend to identify market direction and potential trailing stop-loss levels. However, the unique recovery logic allows for a more adaptive response to price deviations.
🔹 Trend Detection
When the price is above the band, the indicator signals a BULL trend.
When the price is below the band, the indicator signals a BEAR trend.
Trend switches are marked with "BULL" or "BEAR" labels and a colored circle at the switch point.
🔹 Recovery Mechanism
In a standard SuperTrend, the band stays flat if price moves against the trend (but doesn't break it). In the SuperTrend Recovery version, if the price drops significantly below the "Switch Price" (for a bull trend) or rises above it (for a bear trend), the band begins to move toward the price based on the Recovery Alpha . This allows the trailing stop to "catch up" during high-volatility pullbacks, potentially securing a faster exit if the recovery fails.
🔶 DETAILS
The core of this indicator lies in its two-stage calculation: the Base SuperTrend and the Recovery Logic.
🔹 Base Logic
The indicator calculates a base upper and lower band using the Average True Range (ATR) multiplied by a user-defined factor. Under normal conditions, the band follows the classic rules: it can only move up during a bull trend and only down during a bear trend.
🔹 Recovery Logic
When price enters a "loss" state relative to the price where the trend initially started (the Switch Price), the script checks if the deviation exceeds the Recovery Threshold .
If the threshold is met, the band is calculated as an exponential moving average (EMA) of the current price and the previous band value, weighted by the Recovery Alpha :
targetBand = alpha * close + (1.0 - alpha) * prevBand
This creates a "tapering" effect where the band aggressively tightens toward the price during deep retracements, helping to mitigate drawdown by providing an earlier exit signal compared to the standard static band.
🔶 SETTINGS
🔹 Supertrend Settings
ATR Length : The lookback period used to calculate market volatility.
Base Multiplier : The factor applied to the ATR to determine the distance of the band from the price.
🔹 Recovery Logic
Recovery Alpha (%) : Determines how quickly the band adjusts toward the price when the recovery logic is active. Higher values make the band more reactive.
Recovery Threshold (xATR) : The distance (in ATR units) the price must deviate from the switch price before the recovery mechanism activates.
🔹 Visualization
Show Gradient Fills : Toggles the background gradient between the price (source) and the SuperTrend band.
Show Signal Labels : Toggles the "BULL" and "BEAR" labels at trend reversal points.
インジケーター

インジケーター

Monte Carlo Mean Reversion Heatmap [LuxAlgo]The Monte Carlo Mean Reversion Heatmap indicator is a statistical forecasting tool that uses Geometric Brownian Motion (GBM) to simulate 100+ potential future price paths and visualize the mathematical probability of price returning to a specific mean.
🔶 USAGE
The indicator provides a visual "probability cloud" projecting from the current price into the future. It helps traders identify statistical overextensions and the likelihood of a trend reversal toward a long-term average.
🔹 1. Assessing Mean Reversion Probability
The dashboard shows a Mean Reversion % . This tells you how many of the 100 simulated paths "touched" or "crossed" the EMA ribbon within the projection window (e.g., the next 30 bars).
High Probability (>70%): If the current price is far from the EMA but the probability of reversion is high, it suggests the market is "overextended." You might look for a counter-trend trade back toward the EMA.
Low Probability (<30%): This suggests that volatility is so high or the trend is so strong that price is statistically unlikely to return to the mean anytime soon. This often happens during "parabolic" runs.
🔹 2. Trading the "Probability Fan"
The dotted lines (5%, 50%, 95%) represent the statistical boundaries of where price is expected to stay.
Overbought/Oversold: If price moves outside the 5% or 95% lines, it is making a move that only happens in 1 out of 20 scenarios. This is a "statistical extreme." Traders often look for reversals or profit-taking when price enters these outer edges of the cone.
The Median Path (50%): This dashed line represents the "most likely" path based on current momentum (drift). It serves as a realistic target for trend-following trades.
🔹 Heatmap Density
The heatmap represents the density of the simulated paths. Darker areas indicate a higher concentration of paths, marking the price zones with the highest mathematical probability of being reached according to the model.
🔶 DETAILS
The engine behind this script is the Geometric Brownian Motion (GBM) model. GBM is a continuous-time stochastic process used in mathematical finance to model stock prices.
The model assumes that price changes follow a random walk with two components:
Drift: The deterministic trend of the mean (directional bias).
Volatility: The random "noise" or shocks based on historical log-returns.
By running 100 individual simulations simultaneously, the script generates a distribution of outcomes rather than a single linear prediction. This allows the user to see the "width" of uncertainty in the current market environment.
🔶 SETTINGS
🔹 Mean Calculation
Mean Length: The period of the EMA used as the target for mean reversion analysis.
Mean Color: The color of the target EMA line on the chart.
🔹 Monte Carlo Simulation
Simulations: The number of random paths to calculate (higher values increase accuracy but may impact performance).
Projection Length: How many bars into the future the simulation projects.
Volatility Lookback: The window used to calculate historical log-volatility for the simulation.
Include Drift: When enabled, the simulation accounts for the slope (trend) of the Mean EMA.
🔹 Visuals
Price Bins: Determines the vertical resolution of the heatmap.
Heatmap Color: The base color used for the probability density cloud.
Show Percentile Lines: Toggles the visibility of the 5%, 50%, and 95% projection lines.
🔹 Dashboard
Show Dashboard: Toggles the statistical information table.
Position/Size: Controls the location and scale of the dashboard on the chart.
インジケーター

Anchored Clusters Volume Profile [LuxAlgo]The Anchored Clusters Volume Profile indicator utilizes K-Means clustering to categorize historical price action into distinct groups within a user-defined range and generates individual volume profiles for each detected cluster. This tool provides a unique perspective on volume distribution by isolating price behaviors based on proximity rather than strictly chronological order.
🔶 USAGE
The indicator identifies "clusters" of price activity within a selected range defined by a starting and ending date. Each cluster is assigned a unique color and its own horizontal volume profile, allowing traders to see where liquidity is most concentrated within specific price regimes.
🔹 Identifying Institutional Zones
Traders can use the Point of Control (POC) of high-volume clusters to identify significant institutional interest. Because the K-Means algorithm groups price action by density rather than time, a cluster's POC often represents a "fair value" level where significant exchange occurred. These dashed POC lines frequently act as robust support or resistance levels when price returns to them in the future.
🔹 Market Regime Detection
By observing the vertical distribution and overlap of clusters, traders can identify market phases. Overlapping clusters with high volume often indicate accumulation or distribution phases (sideways markets), whereas distinct, vertically separated clusters with lower volume gaps between them suggest a trending environment. A shift from multiple overlapping clusters to a new, isolated cluster can signal a breakout or the start of a new trend.
🔹 Precision Entry & Exits
Cluster boundaries and POC lines provide concrete levels for trade management. An entry can be sought when price retests a high-volume cluster POC, while stops can be placed outside the total price range of that specific cluster (the area covered by its volume profile). Conversely, targets can be set at the POC of the next major cluster above or below current price action.
🔹 Volume Conviction
The tool provides specific volume metrics that allow traders to gauge conviction. By comparing the "Total" volume label of one cluster against another, a trader can determine which price regime had more participation. A breakout into a price zone with a high-volume cluster suggests stronger conviction and a higher probability of the level holding compared to a zone with low total volume.
🔶 DETAILS
Unlike traditional anchored volume profiles that provide a single histogram, this script employs a K-Means clustering algorithm to segment the range. This process involves:
Identifying the specific range of bars between the user-selected Start Time and End Time .
Initializing "centroids" across the price range of that period.
Iteratively assigning each price bar to the nearest centroid based on the HLC2 (median) price.
Recalculating centroids based on the volume-weighted average price of the assigned bars.
Finalizing assignments after the specified number of iterations to ensure stable clusters.
By separating price action into these clusters, the tool helps identify high-interest zones that might be obscured by a single, traditional Volume Profile.
🔶 SETTINGS
🔹 Anchor Settings
Start Time / End Time : Sets the beginning and end of the analysis range. These use the "Confirm" feature, allowing you to select the range directly on the chart after adding the indicator or changing settings.
Range Highlight : Adjusts the color and transparency of the background shading that identifies the analyzed range.
🔹 Clustering Settings
Number of Clusters : Sets how many distinct price groups the algorithm should attempt to find (2 to 10).
K-Means Iterations : Controls the number of times the algorithm refines the cluster centers. Higher values can lead to more stable results.
🔹 Volume Profile Settings
Rows per Cluster VP : Defines the vertical resolution (number of bins) for each individual cluster's profile.
Max VP Width (Bars) : Sets the maximum horizontal length of the volume profile histograms.
VP Offset : Adjusts the horizontal spacing between the current bar and the start of the volume profiles.
Highlight Price Dots : Toggles the visibility of the colored dots on the price action to identify cluster assignments.
Dot Size : Adjusts the size of the cluster assignment dots on the chart, ranging from tiny to huge.
インジケーター

HTF PO3 [LuxAlgo]The HTF PO3 indicator is a professional visualization tool designed to project Higher Timeframe (HTF) Power of 3 (Accumulation, Manipulation, Distribution) price action directly onto your current chart by "grid-locking" HTF candle structures to the price scale.
🔶 USAGE
The indicator is primarily used by SMC (Smart Money Concepts) and Price Action traders to identify the state of a higher timeframe candle without switching charts. By projecting the HTF candle into the right margin, traders can observe the development of the Open, High, Low, and Close (OHLC) in real-time.
🔹 Mapping & Origin Lines
A standout feature of this tool is the direct mapping system. Dashed lines originate from the exact lower timeframe (LTF) bars that established the HTF Open, High, and Low. This allows you to see precisely where the "Manipulation" (wick) and "Accumulation" (body) phases occurred within the HTF cycle.
🔹 Running Volume Delta
Below each projected candle, the indicator displays the "Running Delta." This calculates the cumulative difference between buying and selling volume (based on bar polarity) throughout the HTF period, providing an extra layer of confluence for directional bias.
🔶 DETAILS
The indicator is engineered to be "grid-locked" to the chart's native coordinate system. Unlike standard overlays that might appear to "float," this tool uses absolute price and bar index anchoring.
Vertical Synchronization : The HTF candle wicks and bodies are tied to the Y-axis. If you stretch or compress the price scale, the projected candle scales perfectly in sync with your chart.
Horizontal Anchoring : Mapping lines are pinned to the specific bar_index where levels were created, ensuring they stay "glued" to the correct candles even when scrolling or zooming.
Projection Logic : The tool projects the current forming candle and a customizable number of previous candles into the future space (right offset), keeping your main workspace clean.
🔶 SETTINGS
🔹 Higher Timeframe Settings
HTF Timeframe : Sets the timeframe for the projected candles (e.g., 60m, 4H, Daily).
Candles to Show : Determines how many historical HTF candles are projected alongside the live one.
Right Offset (Bars) : Controls how far into the right margin the projection is drawn.
🔹 Visual Style
Bullish/Bearish Color : Customizes the colors for the HTF candle bodies and wicks.
Live Body Transparency : Adjusts the opacity of the current developing candle.
Show Price Labels : Toggles the visibility of the OHLC price tags next to the live projection.
Show Running Delta : Toggles the cumulative volume delta display below the candles.
インジケーター

LOWESS Channel & Extrapolation [LuxAlgo]The LOWESS Channel & Extrapolation indicator calculates a Locally Weighted Scatterplot Smoothing (LOWESS) curve to define a non-linear trend and projects it into future bars using local regression slopes. It provides a dynamic channel based on the standard deviation of residuals, helping traders identify overextended price levels and potential mean-reversion points.
The LOWESS Channel & Extrapolation indicator is subject to repainting and displayed retrospectively.
🔶 USAGE
This tool is primarily designed for trend analysis and identifying exhaustion points. Because the LOWESS algorithm recalculates based on the most recent data window, the entire historical curve can adjust, making it a powerful tool for backtesting and analyzing past market structures rather than for real-time signal generation without confirmation.
🔹 Trend Identification
The central fit line represents the smoothed local trend. When the curve is sloping upward, the local market sentiment is considered bullish; conversely, a downward slope indicates bearish sentiment.
🔹 Overbought/Oversold Conditions
The dashed outer channels represent a volatility-adjusted boundary. When price moves outside these boundaries, it is statistically overextended relative to the local trend, often preceding a move back toward the mid-line.
🔹 Extrapolation
The indicator extends the most recent local regression slope into the future. This provides a "path of least resistance" projection based on the current momentum of the smoothed curve.
🔶 DETAILS
The LOWESS (Locally Weighted Scatterplot Smoothing) algorithm works by performing a separate weighted linear regression for every data point in the window.
It uses a "tricube" weighting function, which ensures that data points closer to the focal point have a higher influence on the fit than points further away. This results in a curve that is much more flexible than a simple moving average and can adapt to complex price cycles without the lag associated with traditional filters.
The channel width is determined by calculating the Standard Deviation of the residuals (the difference between the actual price and the LOWESS fit). This ensures the channel expands during high volatility and contracts during consolidation.
🔶 SETTINGS
Length : Determines the number of historical observations used to fit the LOWESS curve. Larger values result in a smoother, more macro trend. Span : The fraction of data points used for each local regression. A higher span (closer to 1.0) creates a smoother line, while a lower span allows the curve to follow price more tightly. Channel Multiplier : Multiplier applied to the standard deviation of residuals to define the distance of the upper and lower bands from the mid-line. Extrapolation Bars : The number of bars to project the current trend into the future. Fit Color : Sets the color and transparency of the central LOWESS line. Channel Color : Sets the color of the dashed outer bands and the background fill. Line Width : Adjusts the thickness of the central fit line. インジケーター

Rolling Trendline [LuxAlgo]The Rolling Trendline indicator provides a dynamic, self-adjusting trendline that tracks price action using linear regression slope projections and automatically resets when price deviates beyond a specific threshold.
🔶 USAGE
The indicator is designed to provide a continuous trend bias without the "lag" often associated with static linear regression lines. It projects a line forward based on a calculated slope and only shifts its trajectory when the market demonstrates a significant change in momentum.
The addition of ATR-based volatility zones allows traders to visualize a range of expected price action around the projected trend, providing a buffer that accounts for market volatility at the time of each trend reset.
🔹 Interpreting the Line and Zones
Bullish Phase (Green): Indicates an upward-sloping trajectory. The trendline and its surrounding ATR zones will be colored green, suggesting a bullish bias.
Bearish Phase (Red): Indicates a downward-sloping trajectory. The trendline and its surrounding ATR zones will be colored red, suggesting a bearish bias.
ATR Zones: These shaded areas represent a volatility-adjusted range. As long as price remains within the deviation threshold, the zones follow the trendline's trajectory.
Reset Points: Visualized by a small circle and a break in the line, these occur when price moves too far from the projection. At this moment, the indicator re-anchors to the current price and recalculates both the slope and the ATR zone width.
🔶 DETAILS
The indicator follows a specific logic flow to maintain its "Rolling" characteristic:
1. Slope Calculation: It calculates the Linear Regression slope over a user-defined lookback period. This slope represents the average rate of change in price.
2. Projection: On every new bar, the indicator projects the next value of the trendline by adding the active slope to the previous trendline value.
3. Deviation Check: The indicator calculates a Standard Deviation threshold. If the distance between the current price and the projected trendline value exceeds this threshold, a reset is triggered.
4. Re-Anchoring: Upon a reset, the trendline "rolls" to the current price and adopts the most recent linear regression slope. Simultaneously, it captures the current ATR to set the width of the new trend zones.
🔶 SETTINGS
🔹 Trend Settings
Slope Lookback: The period used to calculate the linear regression slope. Higher values result in a slope that considers more historical data.
Deviation Multiplier: Determines how far price can deviate from the trendline before a reset occurs.
Slope Divisor: This setting allows you to tame the trajectory of the line. Higher values divide the captured slope, resulting in flatter trendlines.
Source: The price data used for all calculations (default is Close).
🔹 ATR Zones
ATR Length: The lookback period used for the Average True Range calculation, which determines the width of the volatility bands.
ATR Multiplier: Controls the width of the shaded zones around the trendline.
🔹 Visuals
Bullish/Bearish Trend Colors: Customizes the colors for the trendline and zones based on the slope direction.
Zone Color: Sets the base color for the ATR area fills.
Line Width: Adjusts the thickness of the primary rolling trendline.
インジケーター

インジケーター

Adaptive Centric Moving Average [LuxAlgo]The Adaptive Centric Moving Average indicator provides a dynamic smoothing tool that adjusts its reactivity based on where the price sits relative to its recent trading range midpoint.
🔶 USAGE
The Adaptive Centric Moving Average (AMA) is designed to filter out noise during periods of consolidation while remaining highly responsive during trending moves. When the price is near the center of its recent high-low range, the indicator becomes flatter and less prone to "whipsaws." As price moves toward the extremes of its range, the indicator accelerates to catch the emerging trend.
Users can utilize the AMA for trend identification and trailing stop-loss levels. The visual gradient fill between the source price and the AMA line helps traders quickly identify the current trend strength and the distance between price and the smoothed average.
🔶 DETAILS
The core logic of the script relies on a normalized relative position (similar to a Stochastic calculation) to determine how far the price is from its range midpoint.
🔹 Adaptive Smoothing Logic
The indicator calculates a smoothing factor (alpha) based on the absolute distance from the 50% level of the range.
When price is at the midpoint (50%), the alpha is zero, causing the moving average to stay flat.
As price moves toward the upper or lower boundaries (0% or 100%), the alpha increases, making the average more reactive.
🔹 The Centric Calculation
Unlike standard moving averages that track the source price directly, this indicator centers its target around the range midpoint. The Attenuation Factor scales the distance between the source and the midpoint, while the Power Factor applies an exponent to the smoothing factor, allowing for non-linear reactivity.
🔶 SETTINGS
🔹 Price Settings
Source: The price series used for calculations (default is Close).
Length: The window size used for pre-smoothing the source and determining the highest highs and lowest lows for the range.
🔹 Adaptive Settings
Attenuation Factor: Controls the intensity of the price input relative to the midpoint. Lower values increase reactivity, while higher values provide a more stable, base smoothing speed.
Power Factor: Exponents the smoothing factor. Higher values make the moving average significantly flatter when the price is near the range midpoint, requiring stronger moves to trigger a reaction.
🔹 Colors
AMA Color: The color of the main Adaptive Centric Moving Average line.
Bullish Fill: The color used for the gradient fill when the price is above the AMA.
Bearish Fill: The color used for the gradient fill when the price is below the AMA.
インジケーター

Correlated Sine Oscillator [LuxAlgo]The Correlated Sine Oscillator indicator identifies and isolates cyclical components within price action to generate a normalized, phase-aligned sinusoid that fluctuates between -1 and 1.
🔶 USAGE
The Correlated Sine Oscillator is designed to help traders visualize the underlying rhythm of the market by projecting price data onto a mathematical sine wave. Unlike standard momentum oscillators, this tool uses quadrature components to determine the current "phase" of the market cycle, allowing the oscillator to stay synced with price swings.
🔹 Identifying Cycle Direction
The oscillator fluctuates within a fixed range of -1 to 1, centered around a zero line. Signals are generated based on the crossing of this midpoint to identify shifts in the dominant cycle.
Bullish Signals: When the oscillator crosses above the zero line, a bullish triangle (▲) appears below the price bar, signaling the start of a rising phase in the cycle. Bearish Signals: When the oscillator crosses below the zero line, a bearish triangle (▼) appears above the price bar, signaling the start of a falling phase in the cycle. Cycle Extremes: While signals occur at the midline, values approaching 1 or -1 represent the peak and trough of the identified cycle, respectively.
🔹 The Phase Multiplier
The Phase Multiplier setting is a unique feature that controls how responsively the oscillator adapts to changes in price direction. Since the indicator uses an average of the real and imaginary components to find the phase, increasing this multiplier will result in a smoother, more stable oscillator that is less prone to noise but slightly more lagging. Lowering the multiplier makes the oscillator react faster to price shifts, which can be useful for identifying quick reversals.
🔶 DETAILS
The construction of the Correlated Sine Oscillator follows a sophisticated signal processing workflow:
Detrending: The script first removes the trend by subtracting a Simple Moving Average (SMA) from the closing price. This isolates the high-frequency fluctuations (cycles) around a mean of zero. Quadrature Projection: The detrended price is projected onto both a Sine and Cosine wave (real and imaginary components) based on the user-defined Cycle Period . Phase Estimation: By calculating the arctangent of these components, the script derives the "Dynamic Phase." This tells us exactly where the current price sits within the theoretical cycle. Correlation: Finally, the script generates a synthetic sine wave that is shifted by the calculated phase, ensuring the output is perfectly correlated with the dominant frequency of the price action.
🔶 SETTINGS
Cycle Period: Determines the primary wavelength (in bars) that the indicator looks for in the price data. Setting this to 20 means the oscillator is tuned to find cycles that repeat every 20 bars. Phase Multiplier: A multiplier applied to the Cycle Period to determine the smoothing length of the internal phase components. A higher value leads to a "cleaner" wave, while a lower value follows price more aggressively. Bullish Color: Controls the color of the oscillator and gradient fill when the value is above zero. Bearish Color: Controls the color of the oscillator and gradient fill when the value is below zero. インジケーター

インジケーター
