Eccodax Robust k-NN Machine Learning LorentzianHere is the complete, final, corrected, and clean code, already including:
✅ Fixed shadowing of the variable d
✅ No compilation warnings
✅ No temporal leaks
✅ Target = real future return
✅ Robust Lorentzian distance
✅ Correct Matrix structure
✅ Consistent feature engineering
✅ Min-Max normalization
✅ Weighted k-NN inference
✅ Correct price reconstruction
1. What this code is
It is a predictive indicator based on classic Machine Learning (k-Nearest Neighbors), fully implemented in PineScript v6, designed to:
Learn historical market patterns
Compare the current state with similar past states
Estimate the expected future price movement
Reconstruct a projected price consistent with the current level
It is not an oscillator, it is not a traditional technical indicator, and it does not react only to the immediate past.
2. What the Model Learns (Supervised Learning)
2.1 Features (Input Variables)
The model uses three dimensions of information, all normalized by Z-score:
Return
Measures the percentage change in price
Captures the immediate momentum of the market
Momentum (ROC)
Measures acceleration or deceleration of the movement
Differentiates trends from consolidations
Volatility
Measures the degree of market uncertainty
Adjusts the weight of strong movements vs. noise
These three variables form a market state vector.
2.2 Normalization (Z-Score)
Each feature is converted to:
Mean ≈ 0
Standard deviation ≈ 1
This ensures that:
No variable dominates the distance
The statistical comparison is valid
The model is stable in different price regimes
2.3 Target (Predicted Variable)
The model does not predict absolute price. It learns:
Observed future return after forecastBars
That is:
Learns movement, not level
Eliminates historical bias
Avoids predictions inconsistent with the current price
3. How the model makes the prediction
3.1 Search for similar patterns (k-NN)
For each current candle, the model:
Analyzes the last lookback candles
Calculates the Euclidean distance between the current state and each past state
Selects the k most similar states
Observes what happened after them
3.2 Inference
The predicted return is calculated as:
Weighted average of the future returns of the neighbors
Weights inversely proportional to the distance
More similar states → greater influence.
4. Price Reconstruction (Key Information)
From the predicted return, the model reconstructs:
Predicted Price = Current Close × (1 + Predicted Return)
Predicted Price = Current Close × (1 + Predicted Return)
This ensures that:
The forecast respects the current market level
The output is visually interpretable
There is no regression to past regimes
5. Relevant Information the Indicator Delivers
5.1 Predicted Price (Green Line)
What it is: Estimated price after forecastBars.
How to use:
Above the current price → bullish bias
Below → bearish bias
Large distance → expectation of strong movement
5.2 Predicted Return (Implicit)
Even though not plotted directly, it is the most important information in the model.
Positive → expectation of appreciation
Negative → expectation of decline
Negative → expectation of decline
Near zero → sideways market
5.3 Directional Classification (optional)
The model also acts as a binary classifier:
High if expected return > 0
Low if expected return < 0
This is used as:
Noise filter
Trend confirmation
False signal reduction
5.4 Implicit statistical context
The indicator carries information that is not visual, but is fundamental:
Market regime (trending vs. sideways)
Statistical similarity with the past
Relative confidence (via distance from neighbors)
6. What this indicator does NOT do
It is important to align expectations:
❌ Does not predict exogenous events
❌ Does not anticipate gaps
❌ Does not work well on illiquid assets
❌ Does not extrapolate long trends
k-NN replicates patterns, does not create scenarios Unprecedented.
7. Where this model works best
Markets with repetitive structure
Medium timeframes (5m – 1D)
Liquid assets
Environments with alternating regimes
8. How to use it in practice (professional recommendation)
Ideal use:
k-NN direction → bias
Technical indicator → timing
Risk management → execution
Never use it in isolation for entry.
9. Executive summary
This code delivers:
A functional supervised ML model in Pine
Prediction consistent with the current price
Statistical market direction
Reduction of historical bias
Solid foundation for quantitative strategies
รูปแบบชาร์ต
Flexible S/R Channels🟩 Flexible S/R Channels is a visualization tool that draws curved support and resistance boundaries through user-defined anchor points. Unlike traditional trendlines and channels that force linear interpretation onto price action, this indicator captures the curved structures that markets frequently form—rounded tops and bottoms, parabolic advances and declines, arcing rallies and pullbacks. Three anchor points per curve define the shape; the indicator fits a smooth mathematical curve through these points and projects it forward. The approach is simple: draw what you see. Curved market structure that resists precise definition with traditional tools can now be rendered with mathematical accuracy.
The indicator bridges the gap between static drawing tools and programmable indicators. TradingView's arc tool draws curves but produces only visual pixels with no analytical value. Flexible S/R Channels creates live data series that integrate with other analysis tools. Four curve-fitting methods—Quadratic, Quadratic-Linear, Weighted Linear, and Natural Cubic Spline—accommodate different market structures. The curved levels naturally lend themselves to breakout and reversion strategies—applications left to the trader's discretion. The open-source code invites experimentation and customization.
💡 THEORY AND CONCEPT 💡
Traders have long relied on horizontal levels and diagonal trendlines to define support and resistance. Linear tools assume constant slope—a property rarely exhibited by actual market movement. When momentum accelerates or decelerates, price trajectories curve rather than hold to fixed angles. The resulting structures—parabolic advances during expansion phases, arcing pullbacks during consolidation, rounded formations at reversal points—represent changes in the rate of change itself. Traditional drawing tools cannot accommodate this variable geometry without sacrificing mathematical precision..
Flexible S/R Channels extends familiar support and resistance concepts into curved space. The approach is simple: draw what you see. When the eye recognizes a curved boundary in price action, this indicator provides the means to define it precisely. Three anchor points per curve—an initial point, an intermediate point, and a recent point—are all that is required. The indicator fits a smooth mathematical curve through these points and extends it forward as a projection.
This indicator represents a blend of human pattern recognition and algorithmic precision. Fully automated indicators make decisions without user input—efficient but detached from trader discretion. Manual drawing tools rely entirely on freehand skill—expressive but imprecise. Flexible S/R Channels occupies the middle ground. The trader identifies the curved structure; the algorithm renders it mathematically. The result is human insight expressed with computational accuracy—for traders who recognize curved structure in price action but lack precise tools to define it.
This projection is not a prediction. It is a visual hypothesis—a structured way of asking "if this trajectory continues, where would price be?" The underlying assumption is simple: like Newton's first law of motion, a trajectory in motion tends to continue unless acted upon by an external force. Future price action validates or invalidates the projection, just as it does with any trendline or channel.
TradingView offers an arc drawing tool for freehand curved lines, but these are purely visual—static pixels on a screen with no programmable value. Flexible S/R Channels bridges this gap. The fitted curves exist as data series that can generate alerts, trigger signals, and interact with other analysis tools. The visual drawing becomes operational structure.
🔁 CURVE METHODS 🔁
The indicator offers four curve-calculation methods, each producing different shapes suited to different market structures:
Quadratic — Fits a parabolic arc through the three anchor points. Best for smooth, continuous curves such as rounded tops and bottoms. It captures the natural "swing" of the market, assuming the momentum will maintain its current rate of acceleration or deceleration.
Quadratic-Linear — Uses a parabolic curve through the anchor points, then transitions to a straight line after the final anchor. Useful when curved structure gives way to linear trend continuation. This is the "bridge" between a turning market and a steady, directed move, preventing the projection from curving back on itself when the price begins to run.
Weighted Linear — Connects anchor points with straight line segments rather than a smooth curve. Suited for angular market structures with distinct inflection points. It treats the market as a series of rigid shifts, providing a clear "corridor" when the price is bouncing between sharp, diagonal levels.
Natural Cubic Spline — Produces the smoothest curve by minimizing abrupt directional changes. Ideal for organic, flowing market movements. It acts as a flexible spine that adapts to complex transitions without the rigid constraints of a fixed geometric shape.
Quadratic Fitting : A smooth, parabolic arc defines a curved resistance boundary. By fitting a mathematical path through three anchor points, the curve captures rounded structures and arcing price action that traditional linear trendlines fail to represent.
Weighted Linear Fitting : This method produces an angular, segmented path by connecting anchor points with distinct linear slopes. Unlike the continuous smoothness of a quadratic arc, the weighted linear approach creates a more jointed geometry, allowing for a precise match to market structures that exhibit sharp, localized changes in trajectory.
Natural Cubic Spline Fitting : This method creates a highly fluid, elastic curve that can accommodate complex price oscillations. In this instance, the curves define a narrowing range as support and resistance converge, highlighting the volatility compression that often precedes a significant breakout or breakdown from established structures.
🖱️ HOW IT WORKS 🖱️
1️⃣ Initial Setup
Unlike traditional indicators that calculate values automatically from price data, Flexible S/R Channels requires user-defined anchor points. This is intentional. The trader's eye is the pattern recognition engine—no algorithm can see the curved structure that experience and intuition reveal. The indicator waits for this input, then applies mathematical precision to render what the trader has identified.
The Recognition of Natural Structure : Effective analysis begins when a curved rhythm becomes visible within price action that traditional trendlines cannot satisfy. Identifying the specific swing highs and swing lows that define these boundaries is the first step in organizing a chart. By isolating three key pivots for resistance and three for support, the underlying framework of the market's trajectory is established, providing the necessary coordinates to accurately map the path.
Interactive Setup Workflow : Upon loading, the indicator prompts for the sequential selection of six points—three swing highs and three swing lows—to serve as the raw data for the calculation. While the chart remains blank during this initial phase, the curves generate instantly once the final anchor is confirmed. These points are not permanent; they appear as interactive grips that can be dragged in real time to refine the boundaries as the market structure evolves.
The indicator prompts for six sequential selections—three for resistance, three for support. The first three selections define the resistance boundary; the final three define support. This sequential grouping is distinct from zigzag-style selection patterns. Within each group, clicking order is flexible—the algorithm automatically sorts points chronologically, allowing traders to select visually prominent pivots in whatever sequence feels natural.
Structural Anchor Identification : Identifying three key swing highs and three key swing lows provides the foundation for the dual-curve geometry. These specific structural peaks and troughs serve as the coordinates for the mathematical models, ensuring that the resulting boundaries accurately reflect the underlying skeleton of the market action.
2️⃣ Interactive Adjustment
After the initial setup, all six anchor points are fully adjustable:
Points are automatically sorted chronologically regardless of selection order
Grip handles appear at each anchor location
Any point can be repositioned by clicking and dragging its grip handle
The curves recalculate instantly as points are adjusted
The algorithm produces a mathematically perfect curve based on the anchor points provided. If the result does not match the trader's vision, adjustments are immediate. This iterative refinement—see, adjust, refine—continues until the rendered curve represents what the trader sees in the price action. The user remains in control; the algorithm remains in service.
Interactive Channel Boundaries : Six user-defined anchor points—three for resistance and three for support —establish a non-linear range that moves beyond the constraints of a flat, horizontal channel. This configuration captures the arcing trajectory of the market while showing price action respecting the curved boundaries in a classic reversion pattern. By manually positioning these anchors, a dynamic dimension is added to the chart that maintains structural integrity even as the price follows a rounded path.
🛠️ SETTINGS 🛠️
Customizable Visual Feedback : Beyond the core geometry, the visualization offers various user-defined settings to tailor the chart's information density. From identifying specific price targets to toggling structural labels, these options allow the trader to adjust the level of detail to suit their personal analysis style while maintaining a clear view of the non-linear boundaries.
Configuration Options
Curve Method — Select the curve-fitting algorithm: Quadratic, Quadratic-Linear, Weighted Linear, or Natural Cubic Spline.
Projection Length — Number of bars to project the curves beyond current price action. Projections appear as dashed lines.
Visual Settings
Grip Size — Size of the draggable handles displayed at each anchor point. Set to zero to hide grips entirely.
Line Width — Thickness of the support and resistance curves.
Support Color / Resistance Color — Color settings for each curve.
Show Info Table — Toggle display of the info table showing the current curve method in the chart corner.
Advanced: Time/Price Coordinates
The settings panel includes precise time and price values for each of the six anchor points, grouped under Resistance Time/Price and Support Time/Price. These values are populated automatically when points are selected on the chart.
Adjusting anchor points by dragging the grip handles directly on the chart is faster and more intuitive. The time/price fields are available for situations requiring exact coordinate entry—such as aligning an anchor to a specific candle timestamp or a precise price level. These fields can be safely ignored unless fine-tuning is necessary.
🖼️ CHART EXAMPLES 🖼️
The Flexible S/R Channels indicator adapts to diverse market structures across multiple timeframes and instruments. Curved boundaries can define subtle momentum shifts in near-linear trends, dramatic reversals in rounding formations, or volatility compression as channels converge toward breakout points. The four curve-fitting methods accommodate different geometries—smooth parabolic arcs for continuous momentum changes, segmented linear paths for angular structures, and elastic splines for complex oscillations. Each anchor point adjustment instantly recalculates the curves, allowing iterative refinement until the rendered boundaries align with the trader's interpretation of market structure. Forward projections extend these mathematical relationships into future territory, providing visual context for hypothetical support and resistance levels if current trajectories persist.
Subtle Curve Alignment : Even in structures that appear linear, subtle curvature allows the channel boundaries to breathe with the market’s internal momentum. By utilizing three anchor points rather than two, the channel adapts to the slight acceleration of a trend, providing a more precise fit than a rigid, straight corridor.
Decelerating Momentum and Convergence : This classic rounding structure illustrates a transition where the initial wide oscillations between highs and lows begin to contract. As the boundaries converge, the curve captures the diminishing volatility and the shift in market energy, providing a clear visual representation of a trend losing its expansive momentum as it approaches a potential turning point.
Organic Trend Modeling : In an accelerating uptrend, the Natural Cubic Spline provides a highly adaptable boundary that mirrors the organic flow of momentum. This non-traditional approach allows the channel to follow complex price pulses that a standard linear trendline would likely cut through, maintaining a precise fit even as the angle of the trend shifts over time.
Non-Linear Projections : Unlike standard trendlines that converge at a fixed rate, curved projections adapt to the historical momentum of the move. This allows the indicator to map a dynamic squeeze, capturing the subtle nuances of how price action tightens toward an apex. It provides a more sophisticated view of future convergence points that traditional linear channels often fail to anticipate.
The "Draw What You See" Philosophy : Market structures are rarely perfect, and this example highlights the indicator’s ability to map unconventional rhythms. Rather than forcing price into a predefined category, the tool remains flexible enough to define any structural path the trader identifies. If you can see a trend's trajectory, the indicator can provide the mathematical framework to support it.
Comparative Projection Modeling : Using identical anchor points as above, this example demonstrates how selecting a different calculation method can alter the projected path. While the historical fit remains precise, the variation in the forward-looking trajectory allows traders to explore multiple mathematical interpretations of the same market structure, choosing the model that best aligns with the current volatility and trend behavior.
Extended Timeframe Channel Definition : This multi-year perspective demonstrates the indicator's ability to define curved channel boundaries across extended timeframes spanning hundreds of bars and multiple market cycles. The resistance curve captures the rounded distribution of swing highs while the support curve follows the accelerating base formation, creating a non-linear channel that frames long-term structural trends more precisely than traditional parallel channels or static trendlines.
Rounding Bottom Reversal and Channel Convergence : This example captures a classic rounding bottom formation—a reversal pattern that linear tools cannot adequately define. The Quadratic method produces a smooth parabolic arc through the resistance anchors, tracing the deceleration of the downtrend, the capitulation low, and the subsequent re-acceleration upward as a single continuous curve. The support boundary mirrors this momentum shift from below, creating a curved channel that narrows toward current price. This convergence represents structural compression—the boundaries tightening as volatility contracts and directional resolution approaches. Price action oscillates within these non-linear boundaries, demonstrating that channel behavior persists even when the geometry is curved rather than parallel. The projection extends both curves forward, mapping the hypothetical trajectory if the current momentum structure continues, providing visual context for potential breakout or breakdown levels as the channel reaches its apex.
Built-in Precision vs. Algorithmic Power : While TradingView offers basic curve drawing tools (shown here as dashed lines), the Flexible S/R Channels indicator elevates this concept into a functional analytical framework. By converting manual observations into mathematical models, it moves beyond mere drawing to provide a data-driven structure that can be utilized for advanced technical analysis and future Pine Script trading logic.
⚙️ TECHNICAL DETAILS ⚙️
Curve Fitting vs. Overfitting: The term curve fitting often carries negative connotations in quantitative analysis due to its association with overfitting—the practice of adjusting a model until it perfectly matches historical data, producing an illusion of accuracy that fails when applied to new data. The application here is fundamentally different. Flexible S/R Channels does not optimize parameters to maximize historical fit; it constructs a mathematical curve through user-selected anchor points, then projects that curve into unknown territory. The curve is not fitted to price data—it is fitted to structural pivots identified by the trader. The projection represents a hypothesis about trajectory continuation, not a prediction derived from statistical optimization. Future price action validates or invalidates this hypothesis in real time, exactly as it does with any trendline or channel. The anchor points remain fixed unless manually adjusted, ensuring the curve does not adapt to new data retroactively.
Non-Repainting Behavior: The indicator does not repaint historical bars. The mathematical coefficients that define each curve are calculated once—when the final anchor point is set—and stored as fixed values. These coefficients remain constant unless an anchor point is manually repositioned. The backfit polyline is drawn once using these coefficients, spanning the known range from the first to last anchor point. The plot() function applies the same coefficients to each subsequent bar, updating in real-time as new bars form but never altering previously plotted values. The projection polyline extends forward from the current bar using the same fixed coefficients, projecting a user-defined number of future bars (maximum 500). This projection redraws on each tick to maintain its position relative to the moving current bar, but the mathematical trajectory remains constant—only the starting point advances. The current bar's curve value will update tick-by-tick as price develops, which is standard real-time behavior, not repainting. Once a bar closes, all curve values on that bar are permanent. The hybrid architecture (backfit polyline for known history, plot() for unlimited real-time range, projection polyline for controlled forward extension) prevents overflow errors while maintaining non-repainting integrity across all components.
🗒️ NOTES 🗒️
The indicator renders curves based on any anchor points provided without validation. Unusual anchor placement produces mathematically accurate but potentially non-useful results. Adjustment is iterative—if the curve doesn't match expectations, reposition the anchors.
Because anchor points are stored as specific time and price coordinates, a new instance of the indicator should be added when analyzing a different chart or timeframe.
Grip handles can be hidden by setting Grip Size to zero in the settings. This is useful for clean chart screenshots or presentations where interactive elements are not needed.
Projection length can be set to zero if forward-looking curves are not desired. The indicator will still render the backfit curves through the anchor points and continue plotting in real-time without the dotted projection extensions.
Anchor points remain fixed at their selected time-price coordinates as new bars form. The curves extend forward automatically from these historical anchors, allowing observation of how projected trajectories align with developing price action.
⚠️ DISCLAIMER ⚠️
The Flexible S/R Channels indicator is a visual analysis tool designed to illustrate geometric market inertia and serve as a framework for understanding dynamic support and resistance. While the indicator generates structural channels and projected paths, no guarantee is made regarding the accuracy or profitability of these projections. Like all technical indicators, the curves and boundaries generated by this tool may appear to align with favorable trading opportunities in hindsight. However, these visualizations are not intended as standalone recommendations for trading decisions. This indicator is intended for educational and analytical purposes, complementing other tools and methods of market analysis.
🧠 BEYOND THE CODE 🧠
Flexible S/R Channels is part of a broader collection of tools designed to provide structured market analysis. This includes the Grid Bot Simulator , the Grid Bot Auto , the Grid Bot Parabolic , and the Gridbot Ping Pong . While each tool serves a distinct purpose, they all utilize dynamic anchor mechanics and non-linear boundaries to adapt to evolving market conditions.
This indicator shares the same educational philosophy as the Fibonacci Time-Price Zones and the Fibonacci Geometry Series - providing frameworks for understanding market concepts through visualization and experimentation rather than black-box signals.
The Flexible S/R Channels indicator, like other xxattaxx indicators , is designed to encourage both education and community engagement. Feedback and insights are invaluable to refining and enhancing this tool. We look forward to the creative applications, observations, and discussions this indicator inspires within the trading community.
SApex - DWM & KZ (SarahFX)Indicator that marks custom sessions and also PDL/PDH PWL/PWH PML/PMW and changes color when it reaches any of those levels
IV Volatility History v1.2# Realized Volatility History - Quick Start Guide
## What This Does
Displays historical realized volatility (RV) calculated directly from price movements. Compare it against your current implied volatility to identify options trading opportunities and gauge whether premium is expensive or cheap.
## How to Use
1. **Get Current IV**: Check your broker's options chain and find the ATM (at-the-money) implied volatility for your ticker
2. **Input the Value**: Open indicator settings and enter the current IV (e.g., `0.15` for 15%) - this creates a reference line
3. **Read the Chart**:
- **Purple line** = Historical realized volatility from actual price movements
- **Red dashed line** = Your current ATM IV (reference)
- **Orange line** = 30-day moving average (optional)
4. **Interpret the Data**:
- **RV below IV** → Options premium is relatively expensive (consider selling premium)
- **RV above IV** → Options premium is relatively cheap (consider buying options)
- **IV Rank > 70%** → High volatility environment
- **IV Rank < 30%** → Low volatility environment
## Settings You Can Adjust
- **Current ATM IV**: Reference line for comparison (update periodically)
- **RV Rolling Window**: Calculation window for realized volatility (default: 10 days)
- **Lookback Period**: Period for IV rank calculation (default: 60 days)
- **Show 30-Day Average**: Toggle moving average line
## Limitations
This indicator requires manual IV updates since TradingView doesn't have direct access to options data. You'll need to check your broker periodically and update the input for accuracy.
---
*Method: Calculates annualized realized volatility using rolling standard deviation of log returns, providing a comparison baseline for evaluating implied volatility levels.*
AI Gamma Levels - Options Flow Signals v1.1# AI Gamma Levels - Options Flow Signals
## 📊 Overview
An educational indicator that estimates institutional options positioning using price action, volume analysis, and technical indicators. Designed to help traders identify key support and resistance zones based on gamma exposure concepts commonly used by market makers and institutional traders.
## 🎯 Key Features
**Gamma Flip Level (⚡)**
- Neutral zone where market maker hedging behavior changes
- Calculated using VWAP and price action
- Acts as dynamic pivot point for intraday trading
**Call Wall (🔴)**
- Resistance zone from heavy call seller positioning
- Identifies where upward price movement may stall
- Based on recent highs + ATR-adjusted volatility
**Put Support (🟢)**
- Support zone from put seller positioning
- Shows where downward moves may find buyers
- Calculated from recent lows with volatility adjustment
**AI Trade Signals (🔮)**
- Multi-factor confluence detector with confidence scoring
- Only triggers on high-probability setups (70%+ confidence)
- Provides clear entry, stop loss, and target levels
- Combines gamma regime, RSI, volume, and price proximity
**Regime Detection**
- Identifies Positive Gamma (bullish bias) vs Negative Gamma (volatile) environments
- Background coloring shows current market regime
- Helps adapt trading strategy to market conditions
**Trading Zone Visualization**
- Shaded area between Call Wall and Put Support
- Shows expected trading range based on gamma positioning
- Zone width indicates market compression or expansion
## 🧠 How AI Signals Work
The AI signal layer analyzes multiple factors simultaneously:
1. **Gamma Regime Alignment** - Price position relative to Gamma Flip
2. **Level Proximity** - Distance to Put Support or Call Wall
3. **Momentum Extremes** - Fast RSI showing oversold/overbought
4. **Volume Confirmation** - Above-average volume on the setup
5. **Price Action Quality** - Bar range and volatility characteristics
Signals only trigger when ALL conditions align, reducing noise and false signals.
**BUY Signal Requirements:**
- Price above Gamma Flip (positive regime)
- Near Put Support (within 0.5%)
- RSI < 35 (oversold)
- Volume spike (1.4x average)
- Confidence ≥ 70%
**SELL Signal Requirements:**
- Price below Gamma Flip (negative regime)
- Near Call Wall (within 0.5%)
- RSI > 65 (overbought)
- Volume spike (1.4x average)
- Confidence ≥ 70%
## 📈 How to Use
**For Day Trading:**
- Watch for bounces at Put Support in positive gamma regime
- Look for resistance at Call Wall in negative gamma regime
- Use AI signals for high-conviction entries with clear risk levels
**For Swing Trading:**
- Monitor zone width for compression/expansion cycles
- Enter when price returns to zone edges with AI confirmation
- Use Gamma Flip as trailing stop reference
**For Options Traders:**
- Identify where institutional gamma is concentrated
- Anticipate pinning behavior near expiration
- Understand market maker hedging flow impact on price
## ⚙️ Customization
**Display Settings:**
- Toggle individual levels on/off
- Show/hide trading zone shading
- Enable/disable AI signals
**Calculation Parameters:**
- Lookback Period (5-100 bars) - adjusts level sensitivity
- Volatility Multiplier (0.5-3.0) - widens/tightens zones
- AI Confidence Threshold (60-90%) - signal selectivity
**Visual Customization:**
- Custom colors for all levels
- Adjustable transparency for zones
- Label size and positioning
## 📊 Info Table
Real-time dashboard showing:
- Current Gamma Flip price
- Call Wall resistance level
- Put Support level
- Active gamma regime
- Trading zone width (%)
- AI signal status and confidence
## 🔔 Built-in Alerts
Set alerts for:
- Gamma Flip crossovers
- Price approaching Call Wall
- Price approaching Put Support
- AI BUY signal triggered
- AI SELL signal triggered
## 📚 Educational Background
**What is Gamma Exposure?**
Gamma measures how fast market makers must hedge their options positions as price moves. Large gamma concentrations create support/resistance as dealers buy into weakness and sell into strength.
**Positive vs Negative Gamma:**
- **Positive Gamma** (above Gamma Flip): Market makers hedge by stabilizing price
- **Negative Gamma** (below Gamma Flip): Market makers hedge by amplifying moves
**Call Walls & Put Supports:**
Heavy open interest at specific strikes creates "walls" where price tends to gravitate toward or bounce away from, especially near expiration.
## ⚠️ Important Notes
**This indicator uses price and volume approximations**, not real options chain data. It demonstrates gamma exposure concepts for educational purposes.
**For true options flow analysis**, consider using platforms with access to real-time open interest, options volume, and Greeks data.
**Risk Management:** Always use proper position sizing, stop losses, and never risk more than you can afford to lose. This indicator should be one tool in your complete trading strategy.
**Not Financial Advice:** This is an educational tool. Past performance does not guarantee future results. Always do your own research and consider consulting with a qualified financial advisor.
## 💡 Best Practices
1. Combine with your existing strategy - don't trade signals blindly
2. Use on liquid stocks/indices with active options markets
3. Pay attention to regime changes at Gamma Flip crossovers
4. Higher timeframes (15m, 1H, 4H) tend to be more reliable
5. Adjust parameters based on the asset's typical volatility
6. Wait for AI signals with 75%+ confidence for highest quality setups
## 🎓 Who This Is For
- Options traders seeking to understand institutional positioning
- Day traders looking for high-probability support/resistance
- Swing traders identifying key zone boundaries
- Anyone interested in learning about gamma exposure impact on price
- Traders wanting AI-assisted trade signal confirmation
---
**Happy Trading! If you find this indicator helpful, please leave a like and comment with your feedback.**
MES Fakeout with Target LinesHow this works for your trading:
The Trigger: When the MES "pokes" above the 15-min high on low volume and closes back inside, the "FAKE UP" label appears.
The Target: A Green Dotted Line (or circles) will immediately appear on your chart 10 points below the High. This is your mathematical exit for a "reversion" trade.
Risk/Reward: Since the stop loss for a fakeout trade is usually just above the "poke" wick, a 10-point target on the MES often provides a solid 2:1 or 3:1 Reward-to-Risk ratio.
Weekly Open / Close S&R (Last 4 Weeks)Weekly open and close of candles from the last 4 weeks for major support and resistance.
Stable MES Fakeout AlertHow to read the new Dashboard
Bright Red Cell: The market is at +1000 or higher. This is your "Don't Buy/Start Shorting" zone.
Bright Green Cell: The market is at -1000 or lower. This is your "Don't Sell/Start Buying" zone.
Faded Green/Red: The market is trending but not yet at a mathematical extreme.
A Strategy Secret for the Reversal
When the Dashboard turns Bright Red (TICK > 1000) and the price hits the Red VWAP Band, don't just market sell.
Wait for the TICK value to start dropping (e.g., from 1100 down to 900).
Wait for the first Red Candle to close on your 1-minute chart.
Place your stop loss just a few ticks above the "swing high" created at the band.
This "waiting for the turn" ensures you aren't trying to catch a speeding freight train.
XAUUSD Scalping D JoseAn indicator that signals trend changes and marks them on the chart with a sticker.
XAUUSD scalpin D JoseThis indicator signals trend changes, helping you determine in which direction the market will move.
Vilantro Swing Points & Swing Failure Patterns (SFP) V1.0Vilantro Swing Points & Swing Failure Patterns (SFP) V1.0
Overview
The Vilantro Swing Points & SFP indicator is a comprehensive Price Action tool designed for traders utilizing Smart Money Concepts (SMC) and Liquidity trading strategies.
Based on the "Daily Sweep" methodology, this tool automates the identification of structural swing points, draws dynamic liquidity zones (boxes), and generates real-time signals for Swing Failure Patterns (SFP)—a high-probability reversal setup where price sweeps liquidity but fails to sustain the breakout.
Key Features
1. Automated Swing Point Detection
Identifies market structure using a classic 3-Candle Swing logic (as defined in standard price action theory).
Swing High: A candle high surrounded by lower highs on the immediate left and right.
Swing Low: A candle low surrounded by higher lows on the immediate left and right.
2. Dynamic Liquidity Zones (Boxes)
Automatically draws Support (Green) and Resistance (Red) boxes extending from valid swing points to the right.
These boxes represent untapped liquidity pools (stop losses and buy/sell limit orders) that institutional algorithms often target.
Smart Cleanup: The indicator keeps your chart clean. Once a price level is interacted with (either swept or broken), the box stops extending automatically.
3. Swing Failure Pattern (SFP) Signals
This is the core execution trigger of the indicator. It monitors the Liquidity Boxes for specific price behavior:
Bearish SFP: Price wicks above a Resistance Box (sweeping the highs) but the candle closes back below the level.
Interpretation: Buyers were trapped, liquidity was grabbed, and sellers are stepping in.
Bullish SFP: Price wicks below a Support Box (sweeping the lows) but the candle closes back above the level.
Interpretation: Sellers were trapped, liquidity was grabbed, and buyers are stepping in.
How to Trade with Vilantro SFP V1.0
Identify the Trend: Use the automatically drawn boxes to see where the market has left "resting liquidity."
Wait for the Sweep: Do not enter just because price touches a box. Wait for the candle to close.
The Signal: Look for the "Bearish SFP" or "Bullish SFP" label.
If the candle closes OUTSIDE the box: This is a Break of Structure (BOS) or continuation. Do not fade this.
If the candle closes INSIDE the box (SFP): This is your rejection signal.
Execution: As discussed in "The Daily Sweep" strategy:
Once the SFP alert fires on a higher timeframe (e.g., Daily or 4H), drop to a lower timeframe to find a precision entry (such as a Fair Value Gap).
Settings
Swing Lookback: Defines the sensitivity of the swing points. Default is 1 (Standard 3-candle pattern). Increasing this number identifies only larger, macro pivot points.
Extend Box Limit: Controls how far back the script looks for unmitigated levels.
Colors: Fully customizable colors for Bull/Bear boxes and SFP labels to match your charting theme.
Disclaimer
This tool is for educational purposes only. Trading financial markets involves risk. Always combine this indicator with your own analysis and risk management.
Ale tonkis Swing failure (mejora)“Swing Failure Pattern (SFP) indicator for detecting bullish and bearish reversals on the chart.”
It’s short and to the point for TradingView or documentation.
Blockcircle Waveform BandsThe Blockcircle Waveform Bands is a comprehensive trend-following indicator built around a layered moving average ribbon system. The core idea is simple: when shorter-term averages stack above longer-term ones in proper sequence, the trend is healthy. When they compress, cross, or invert, something is changing.
This indicator was developed to solve a common problem. Traders often clutter their charts with multiple moving averages, each added separately, each requiring manual tweaking. Waveform Bands consolidates everything into a single, unified view.
You get fast, medium, and slow bands that expand and contract with momentum, change color based on trend direction, and provide clear reference points for entries, exits, and trend assessment.
Also included is a configurable higher-timeframe bias band, which allows you to track the macro trend without switching timeframes. Most useful is following the 21W EMA and 20W SMA crosses.
What Makes This Indicator Different
While moving average ribbons are a well-known concept, this indicator extends beyond simple MA plotting in several meaningful ways that justify its protected source status.
First, the indicator calculates a proprietary confluence score ranging from negative 100 to positive 100. This score is not just counting crossovers. It uses weighted contributions from band alignment, price position across multiple timeframe zones, and momentum confirmation via rate of change integration. The specific weighting logic and calculation method represent original development work not available in standard MA ribbon indicators.
Second, the summary scoring system evaluates trend quality on a 0 to 100 scale using a multi-factor algorithm. Trend state contributes up to 35 points, band alignment contributes up to 30 points, price position contributes up to 20 points, and momentum confirmation contributes up to 15 points. This weighted approach provides objective trend measurement rather than relying solely on visual interpretation.
Third, the signal generation framework offers five distinct signal methods, each with three sensitivity levels, creating fifteen unique configurations. This is a complete signal system with filtering logic, not simply MA crossover alerts. The interaction between signal type, sensitivity, and the optional trend filter creates a flexible framework that traders can calibrate to their specific style.
Fourth, the optional smoothing layer applies additional processing after the base MA calculations are complete. This reduces noise and whipsaws during choppy conditions while maintaining responsiveness during genuine trend moves.
These proprietary elements, particularly the scoring algorithms and signal framework, represent the original work that distinguishes this from standard open-source MA ribbons available elsewhere.
Key Features
Multi-Band Ribbon System: Three distinct bands covering short, medium, and long-term trend structure. The fast band uses configurable MAs with default periods of 8, 13, and 16 for immediate price action. The mid band spans 21 to 42 periods, capturing the intermediate swing structure. The slow band covers 50 to 60 periods, representing the underlying trend foundation. Each band can be independently toggled, colored, and adjusted.
Flexible Moving Average Types: Choose from eight MA calculation methods including EMA, SMA, WMA, VWMA, HMA, DEMA, TEMA, and ZLEMA. Set a default type for all bands or override individually per band. Useful for those who prefer Hull MA smoothness or the responsiveness of DEMA and TEMA.
Major Moving Averages: Built-in 200-period MA for institutional-level support and resistance. Pi cycle MA using 314 periods for longer-term cycle analysis. Fully customizable additional MA with adjustable length, type, and color. Clear visual distinction with configurable line widths.
Higher Timeframe Bias Band: Dual MA system pulled from any higher timeframe you choose. Default configuration mirrors the popular 21-week EMA versus 20-week SMA setup. Both MAs are fully adjustable in length, type, and timeframe. Automatic bullish or bearish fill coloring based on which MA leads. Keeps macro context visible without leaving your current chart.
Dynamic Trend Coloring: All bands automatically shift color based on detected trend state. Bullish alignment shows green spectrum, bearish shows red, neutral shows yellow.
Trend Detection and Scoring: Algorithmic trend state detection based on band alignment and price position. Confluence scoring system weighing multiple factors from negative 100 to positive 100. Band alignment tracking showing whether each band is internally bullish or bearish. Band expansion and contraction monitoring for momentum assessment. Strength percentage calculation for trend conviction measurement.
Signal Generation: Multiple signal type options including band crosses, price crosses, and full alignment signals. Three sensitivity levels to match different trading styles and timeframes. Optional filtering to show only signals confirmed by the slow band.
Dashboard Display: Comprehensive table with summary score, bias direction, and trend status. Compact mode available for reduced screen footprint.
Alerts: Pre-configured alerts for buy and sell signals. Trend change notifications when bias shifts bullish or bearish. Major MA cross alerts for the 200 MA and Pi MA. Band alignment alerts when all bands synchronize. Confluence threshold alerts for strong directional readings.
How To Use
Identifying Trend Direction: Look at the overall band structure first. In a healthy uptrend, the fast band sits above the mid band, which sits above the slow band. Price should be trading above the fast band or at least within it.
The dynamic coloring gives you an instant read. If everything is green, the trend structure is bullish. Red means bearish. Yellow or mixed colors indicate transition or consolidation.
Check the dashboard summary row for a quick score. Above 60 suggests a solid trend, while below 40 indicates weakness or chop.
Using the Bias Band for Macro Context: The higher timeframe bias band tells you whether the larger trend supports your trade idea. If you are looking to buy on a daily chart, check whether the weekly bias band is bullish, meaning the fast MA is above the slow MA.
When the price is above both bias MAs and the band is bullish, conditions favor long positions. When the price is below both and the band is bearish, conditions favor shorts or staying out.
The fill color between the bias MAs changes automatically. Green fill indicates bullish macro bias and red indicates bearish. This is visible at a glance without checking numbers.
Finding Entry Points: Look for pullbacks into the mid band during established trends. When the fast band compresses toward the mid band and then expands again, this often marks a continuation entry.
Band crossings can signal new trend initiations. When the fast band crosses above the mid band with confirming price action, it suggests a potential long entry. The opposite applies for shorts.
Use the signal markers as alerts to potential opportunities, but confirm with price action. A signal appearing while the price is holding above a key band carries more weight than one appearing in isolation.
Managing Risk and Exits: The slow band often acts as a trailing stop reference during trends. As long as price holds above the slow band on pullbacks, the trend remains intact. This is not always true, but it serves as a helpful general guideline.
Losing the mid band on a closing basis often warns that the move is weakening. This might prompt partial profit-taking or tightening stops.
The 200 MA serves as a major support or resistance level. Trends that break below the 200 after an extended move often accelerate to the downside.
Reading Momentum Through Band Width: When all bands are tightly compressed, expect a directional move soon. Compression represents energy building up.
Expanding bands confirm momentum is present in the current move. Watch for continued expansion on trend days.
Contracting bands during a trend may warn that momentum is fading, even if the price has not reversed yet.
Combining Multiple Timeframes: Enable multi-timeframe mode to see higher timeframe MAs plotted on your current chart. Be careful with this as it can crowd the display, but it is useful for seeing different timeframes stacked together.
This helps identify where significant support or resistance exists above your normal view.
The bias band already provides macro context, but you can set it to different timeframes for different purposes. Day traders might use daily bias bands while swing traders might prefer weekly.
How To Read The Table
The summary row gives you the overall picture. A high score with bullish bias and strong trend status represents ideal conditions for trend-following entries.
Individual band status rows tell you if any divergence exists between timeframes. If the fast band is bearish but mid and slow are bullish, you might be seeing a pullback rather than a reversal.
Price position percentages show how extended the price is from each band. Extreme readings in either direction suggest potential mean reversion or exhaustion.
Limitations
This indicator is designed for trending markets and performs best when clear directional movement exists. During extended consolidation or ranging conditions, the confluence score may oscillate near zero and signals may produce mixed results.
Like all moving average based systems, signals are lagging by nature. The indicator confirms trends rather than predicting them. Early entries require additional confirmation from price action or other methods.
The default settings are optimized for daily and higher timeframes on crypto and forex markets. Intraday traders and those analyzing other asset classes may need to adjust the band lengths to match their specific conditions.
This indicator should be used as part of a complete trading approach that includes proper risk management and position sizing. It is not intended as a standalone system.
Getting Started
Start with the default settings and observe how the indicator behaves on your preferred instruments and timeframes before customizing.
The indicator works on all markets and timeframes, but the default MA lengths are optimized for daily and higher charts. For intraday trading, consider reducing the band lengths proportionally.
Use the compact table mode if the full dashboard feels cluttered. The essential information remains visible while using less screen space.
Set up alerts for trend changes and major MA crosses so you do not need to watch charts constantly. Let the indicator notify you when conditions change.
FXG Elite Signals | FXG v2.0.8 [Daily Limit]Reversal Zone Trading With Scalp , Intraday and Swing setups
Anurag -Alpha Pro (NIFTY/BANKNIFTY) CALL/PUT Boxes Trend BadgeThis indicator gives CALL (buy) and PUT (sell) signals for Nifty and BankNifty using trend + confirmation filters.
It trades only during NSE market hours and avoids noisy periods like the opening minutes and mid-day lull.
It confirms direction using EMA trend, VWAP, ADX (trend strength) and RVOL (volume push) to reduce fake signals.
It plots clear Entry, Stop Loss, and Target using ATR-based risk so levels adjust automatically to volatility.
The green/red boxes show your target zone and stop zone visually, keeping the chart clean with only one active setup.
The Trend Badge shows the current market state (Bullish / Bearish / Ultra) so you know the bias before taking a trade.
Ale Tonkis Swing Failure + TP RRSwing Failure Pattern (SFP) indicator with multi-timeframe confirmation and dynamic Take Profit logic.
It detects bullish and bearish SFP setups, confirms them using 5m and 15m timeframes, and automatically plots Take Profit targets with a 1:2 or 1:3 risk–reward ratio, based on previous highs and lows (market structure pivots).
Designed for Forex and Crypto trading, fully visual and non-repainting.
EMA 6/16 Zone (Simple)This is to know when to long and when to short. these are ema bands. when they touch either it goes up or down. has background shade to indicate if its uptrend or down.
Opening Range Breakout (ORB) with Dual Timezones + Auto-OffOpening Range (Dual TZ) + Auto-Off (Clean)
This indicator plots a clean Opening Range Box (ORB) with ORH/ORL levels and a midline, built for traders who want structure without clutter.
The main feature is Dual Timezone support, meaning you can run two separate Opening Ranges in parallel (TZ1 + TZ2) on the same chart — ideal if you track multiple market opens (e.g., NY + London) from one workspace.
Key Features
• Dual ORB sessions (TZ1 + TZ2)
• Customization of both timezones, ORB principles (that suits you the best)
• Run two independent opening range sessions simultaneously
• Each has its own range calculation, box, ORH/ORL lines, labels, fill, and midline
• Clean output (no targets, no breakout signals)
• Focused on the core OR structure only
• Great for discretionary trading and level-based execution
• Separate Auto-Off for TZ1 and TZ2
• Automatically removes ALL drawings after a user-defined time (minutes after OR end)
• Helps keep charts clean during the rest of the day
• TZ1 and TZ2 can be disabled on different timers
• Historical toggle
• If Show Historical Data = OFF, the script deletes previous session drawings at the next session start
• If ON, prior sessions remain visible
What’s Drawn
• Opening Range box (high/low during session)
• ORH (Opening Range High) line + label
• ORL (Opening Range Low) line + label
• Midline (average of ORH/ORL)
• Highlight fill between ORH/ORL
Typical Use Cases
• Track NY ORB + London ORB at the same time
• Use ORH/ORL as intraday support/resistance anchors
• Keep your chart clean with Auto-Off after your active trading window
Notes
• Works best on the 1/5 minute timeframes (the OR is session-based).
• If both sessions overlap, drawings may overlap as well — that’s expected since both ORBs are active simultaneously.
Daily MA Rank Ladder: Signals EditionDaily MA Rank Ladder: Signals Edition is a daily trend overlay that turns moving averages into a ranked ladder and adds trade signals and live statistics on each symbol.
The script is built to help you answer three questions at a glance
1. Where is price relative to the key daily averages and VWAP
2. What is the current trend and momentum state
3. How has the signal model behaved on this symbol in the recent past
On the chart you get
• A clean stack of daily moving averages and VWAP
• Background trend shading that reflects bullish bearish or neutral conditions
• Clear visual markers for entries exits and stop levels when signals are enabled
On the right side you get a ranked ladder table
• All key levels sorted by price with their current value
• Direction arrows and daily percentage change
• Short term and long term trend rows
• RSI state row
• Current stop level
• Open PnL and secured PnL based on your position size settings
• The next potential long and short levels the model is watching
At the bottom of the table the script summarizes recent behavior
• Number of trades in the chosen back test window
• Hit rate overall
• Long and short results separated
• Total PnL in currency terms
All calculations are anchored to daily data and the script is designed as an overlay you can run on any timeframe. You can use it purely as a dashboard or you can follow the signals that the model produces.
The internal rules for entries exits and stop management are intentionally not documented in the description. They are based on daily moving averages volatility and momentum but the exact recipe is part of the signal engine and is not meant to be reverse engineered from this text.
Inputs and options
The key controls are
1. Moving average and RSI lengths
2. Back test window for statistics
3. Base position size
4. Scaling mode
• How many legs the model can build into a position
5. Stop loss execution
• Daily close only or intraday plus daily with optional buffer
6. Table placement and text size
Signals and statistics can be disabled so that the script behaves as a pure moving average ladder without any trade prompts.
⸻
How to use it
Typical use
• Scan symbols with the script applied and look for clean alignment in the ladder and trend rows
• Use the table to understand where price is relative to the major levels and how stretched or compressed the move is
• Let the signals and the PnL stats support your decision making without treating them as orders from an automatic system
You remain in full control of entries exits and position sizing. The script is there to give you structure and context every day.
⸻
Disclaimer
This indicator is provided for educational and informational purposes only.
It is not financial advice. It is not a recommendation to buy or sell any asset. There is no guarantee that any signal or model will be profitable.
All trading and investing involves risk including the risk of losing all invested capital. Past performance and any statistics shown by this script do not guarantee future results.
By using this script you accept that
• You are fully responsible for your own decisions
• You should thoroughly test any approach in a back test and in paper trading before risking real money
• You should size positions according to your own risk tolerance and financial situation
Use this script as one input in your process not as an automatic system and not as a substitute for your own judgement.
Fair Value Gap (FVG) RFF001I dont what to say here but i need to write studd apparently, its really just fvgs
StockExploder Volumes The Volume Indicator measures the number of shares or contracts traded in a security over a specific period. It helps traders assess the strength of a price movement, as rising volume often confirms trends, while declining volume may signal weakening momentum or potential reversals.
Central Time Opens (9 AM/Midnight Open)Time opening prices for midnight open and 10 AM key open, but for central timezone.






















