Index SniperTrade smart, trade sharp! Index Sniper Strategy targets the strongest market moves with surgical entries and strict risk control — designed for traders who want speed, confidence, and consistency in index trading.
Indicatori e strategie
Solace EVO HUDThe Solace EVO HUD (Heads-Up Display) is a cutting-edge, all-in-one TradingView indicator that transforms your chart into a professional trading dashboard. As the pinnacle of the Solace Cipher EVO series, it combines momentum signals, trend filters, volatility bands, and multiple oscillators into a cohesive "HUD" for real-time decision-making. Designed for crypto, forex, stocks, and futures traders, it provides at-a-glance insights to spot high-probability setups without cluttering your screen. Whether you're scalping on 1-minute charts or swinging on daily, the EVO HUD delivers actionable intelligence with precision and style
Solace Evo 50 & 200 EMAOverview
The Solace Evo 50 & 200 EMA is a premium TradingView indicator designed for trend-following traders, combining the timeless simplicity of Exponential Moving Averages (EMAs) with advanced visual aids to identify market trends, crossovers, and potential entry/exit points. Built as an evolution of the Solace Cipher EVO series, this tool focuses on the 50-period and 200-period EMAs – often called the "Golden Cross" and "Death Cross" setup – to provide clear, actionable insights for stocks, crypto, forex, and more. It's ideal for beginners and pros alike, helping you stay on the right side of the market without overcomplicating your charts.
Key Features
50 & 200 EMA Lines: Plots the 50 EMA (short-term trend) and 200 EMA (long-term trend) with customizable colors and thickness. Easily toggle each line on/off for clutter-free analysis.
Golden/Death Cross Alerts & Labels: Automatically detects and labels "Golden Cross" (50 EMA crosses above 200 EMA – bullish) and "Death Cross" (50 EMA crosses below 200 EMA – bearish) with on-chart labels and built-in alerts for real-time notifications.
Background Tint for Trend Bias: Colors the chart background green when 50 EMA > 200 EMA (bullish) or red when 50 EMA < 200 EMA (bearish), giving you an instant visual cue on market direction. Toggleable for clean charts.
High Customization: Adjust EMA lengths (default 50/200), line styles, colors, and alert settings to fit your strategy. Works on any timeframe from 1-minute scalping to daily swings.
Lightweight & Efficient: No lag or repainting – uses TradingView's native ta.ema() for fast calculations. Compatible with mobile and desktop.
How It Works
This indicator leverages the classic EMA crossover strategy:
Bullish Trend: When the 50 EMA is above the 200 EMA, the market is in an uptrend. Look for buys on pullbacks.
Bearish Trend: When the 50 EMA is below the 200 EMA, the market is in a downtrend. Favor shorts.
Crossovers: The Golden Cross signals potential trend reversals to the upside (strong buy), while the Death Cross warns of downside shifts (strong sell).
Integrated with Solace EVO's core logic, it pairs perfectly with momentum oscillators for confluence trades.
HVTC 2HVTC – SMC Market Structure & Trend Indicator
HVTC is a Smart Money Concepts–based tool that helps traders visualize market structure and trend direction with clarity.
Features:
CHoCH & BOS Detection
Automatically identifies structural shifts using true SMC logic and labels them directly on the chart.
Trend Filter
Confirms bullish or bearish conditions using an internal trend system to keep trades aligned with the major direction.
EMA 25 Guide
EMA 25 acts as dynamic support/resistance, helping define momentum and bias.
Alerts (Optional)
Notify traders when CHoCH/BOS or key retests occur—ideal for those who don’t monitor charts continuously.
Use Cases:
Works for Crypto, Forex, Gold, Indices, and Stocks across all timeframes. Helps improve entries, exits, and overall market understanding based on institutional structure.
Not financial advice. Use with proper risk management.
FluxMA ProFluxMA – Mechanical Moving Average Strategy with Risk Control
FluxMA is a backtesting strategy based on price breaking through a configurable moving average. Its purpose is to provide a simple, transparent, and flexible framework to study a trend-following system with clear entries, predefined Stop Loss and Take Profit levels, and no martingale, no grid, and no hidden logic.
This strategy is intended for traders who want to analyze data objectively, test risk management ideas, and explore different moving average, time, and weekday configurations within the TradingView environment.
Core Strategy Logic
The core logic of FluxMA is driven by the relationship between the close price and a configurable moving average:
A moving average is calculated on the close price (SMA, EMA, WMA, or RMA).
When a bar closes above the moving average, a long (buy) signal is generated.
When a bar closes below the moving average, a short (sell) signal is generated.
Trades are simulated at the open of the next bar, avoiding any repainting of signals on the current bar.
At all times, the strategy keeps at most one open position (no pyramiding).
There are no complex patterns or hidden conditions: everything is centered on the clean break of price relative to the moving average.
Main Parameters
FluxMA includes several parameters so you can adapt the behavior of the strategy to the instrument and your preferred style:
Moving Average
Moving average type: SMA, EMA, WMA, or RMA.
Moving average period: fully configurable, so you can make it faster or slower depending on timeframe and instrument.
Basic SL/TP Management
Stop Loss (SL) set at a fixed price distance.
Take Profit (TP) set at a fixed price distance.
The risk–reward ratio is defined by the combination of SL and TP settings.
Trading Filters
Time filter: define a start time and end time for trading to limit the strategy to specific intraday sessions.
Day-of-week filter: choose which days (Monday–Sunday) are allowed to trade.
Direction filter:
Longs only.
Shorts only.
Both directions.
“One trade per day” option: after the first trade of the day, all further signals for that day are ignored.
Suggested Use and Best Practices
FluxMA is meant to be a prototyping and analysis tool, not a ready-made “plug-and-play” system. Some ideas for how to use it:
Test different timeframes (e.g., M5, M15, H1) and see how performance changes as you adjust the moving average speed and the time horizon.
Tune the moving average type and period to study smoother vs. more aggressive trend behavior.
Analyze the impact of the time filter: only European session, only US session, or narrower windows.
Turn specific weekdays on/off to identify which days tend to behave better for each instrument.
Use this strategy as a base layer and later add your own filters (higher timeframe trend, volatility filters, etc.) within TradingView’s testing environment.
It’s a good idea to combine backtest results with manual chart review, especially in highly volatile periods and around major trend reversals.
Disclaimer and Limitations
FluxMA does not use martingale, grid, averaging down, or any aggressive position sizing. Each trade is opened with a clear logic and closed by SL or TP according to fixed rules.
This strategy runs only inside TradingView for historical simulation and analysis purposes. It is not investment advice or financial guidance.
Backtest and historical results do not guarantee future performance in live markets.
Any decision to use similar logic in live accounts or other trading environments is entirely the user’s responsibility, including risk management, position sizing, and instrument selection.
In summary, FluxMA is a simple and transparent foundation to study how a mechanical moving average breakout system behaves under different parameter, session, and weekday configurations, within a controlled testing environment like TradingView.
Kuytrade - Super Scalping Pro V1.0📘 Strategy "Kuytrade - Super Scalping Pro"
What is this strategy?
This is a scalping trading that helps you catch quick profits from short-term price movements. It's perfect for traders who want to make multiple small wins throughout the day.
How does it work?
The strategy uses a 3-level filter system to find high-quality trading signals:
Level 1: CORE Indicators (Must Pass)
- EMA (Moving Averages): Checks if the trend is going up or down
- MACD: Confirms momentum is building in the right direction
Level 2: MOMENTUM Indicators
- RSI: Looks for oversold (ready to bounce up) or overbought (ready to drop) conditions
- Stochastic: Finds reversal points where price might change direction
Level 3: BOOST Indicators
- RSI Divergence: Spots hidden opportunities when price and momentum disagree
- Strong Candles: Identifies powerful price movements
- ATR Filter: Makes sure the market is active enough to trade
Trading Setup
Each Signal Opens 3 Orders:
Order 1: Closes at TP1 (quick small profit)
Order 2: Closes at TP2 (medium profit)
Order 3: Closes at TP3 (big profit target)
Default Settings:
TP1: 1,000 points
TP2: 1,500 points
TP3: 2,500 points
Stop Loss: 1,200 points
Lot Size: 0.01 per order (3 orders total)
Smart Features
- Trailing Stop Loss
- When TP1 hits, the Stop Loss for TP3 automatically moves to breakeven + 150 points, protecting your profit!
- Auto Asset Detection
The strategy automatically recognizes what you're trading:
- Forex pairs (EURUSD, GBPUSD, etc.)
- Gold, Silver, Platinum
- Crypto (Bitcoin, Ethereum)
- Stock Indices (US30, NASDAQ, S&P500)
Indicators:
You can enable/disable each indicator level
Mix and match to find what works for your style
Visuals:
Show/Hide TP/SL lines
Show/Hide entry boxes
Mobile view for smaller screens
When to Use This Strategy?
✅ Best for:
Active markets (London/NY sessions)
Lower timeframes (1m, 5m, 15m)
Volatile pairs with clear trends
❌ Avoid during:
Major news releases
Very quiet markets
Weekends/holidays
----------------------------------------
กลยุทธ์นี้คืออะไร?
Scalping ที่ออกแบบมาให้ช่วยทำกำไรเล็กๆ จากการเคลื่อนไหวของราคาระยะสั้น เหมาะสำหรับเทรดเดอร์ที่ต้องการทำกำไรเล็กน้อยบ่อยๆ ตลอดทั้งวัน
ทำงานยังไง?
กลยุทธ์ใช้ระบบกรองสัญญาณ 3 ระดับ เพื่อหาจุดเข้าที่มีคุณภาพสูง
Level 1: ตัวบ่งชี้หลัก (ต้องผ่าน)
- EMA (เส้นค่าเฉลี่ย): เช็คว่าเทรนด์กำลังขึ้นหรือลง
- MACD: ยืนยันว่าแรงซื้อ/ขายกำลังมาถูกทาง
Level 2: ตัวบ่งชี้โมเมนตัม
- RSI: หาจุด Oversold (ราคาถูกเกินไป พร้อมกลับตัว) หรือ Overbought (ราคาแพงเกิน พร้อมลง)
- Stochastic: หาจุดกลับตัวที่ราคาอาจจะเปลี่ยนทิศ
Level 3: ตัวบ่งชี้เสริม
- RSI Divergence: เจอโอกาสแอบแฝงเมื่อราคาและโมเมนตัมไม่สอดคล้องกัน
- Strong Candles: จับแท่งเทียนที่แรงมาก
- ATR Filter: ตรวจว่าตลาดมีความผันผวนพอจะเทรดไหม
การตั้งค่าการเทรด
แต่ละสัญญาณเปิด 3 ออเดอร์:
ออเดอร์ 1: ปิดที่ TP1 (กำไรเล็กเร็ว)
ออเดอร์ 2: ปิดที่ TP2 (กำไรกลางๆ)
ออเดอร์ 3: ปิดที่ TP3 (กำไรใหญ่)
ค่าเริ่มต้น:
TP1: 800 จุด
TP2: 1,500 จุด
TP3: 2,500 จุด
Stop Loss: 1,200 จุด
ขนาดล็อต: 0.01 ต่อออเดอร์ (รวม 3 ออเดอร์)
ฟีเจอร์พิเศษ
- Trailing Stop Loss (ขยับ SL ตาม)
- เมื่อ TP1 โดน SL ของ TP3 จะเลื่อนมาที่ราคาเข้า + 150 จุด ทำให้คุณไม่ขาดทุน!
- ตรวจจับสินทรัพย์อัตโนมัติ
กลยุทธ์จะจำคู่เงินที่คุณเทรดได้เอง:
คู่เงิน Forex (EURUSD, GBPUSD ฯลฯ)
- ทองคำ, เงิน, แพลตตินั่ม
- คริปโต (Bitcoin, Ethereum)
- ดัชนีหุ้น (US30, NASDAQ, S&P500)
แดชบอร์ดผลงาน (ล่างซ้าย)
- แสดง Win Rate แต่ละ TP
- ติดตามกำไร/ขาดทุนรวม
- แสดงสถิติทั้งหมด
แดชบอร์ดสถานะ Level (บนขวา)
สถานะตัวบ่งชี้แบบเรียลไทม์
เขียว = สัญญาณพร้อม
แดง = รอเงื่อนไข
ตั้งค่าที่ปรับได้
คุณภาพสัญญาณ:
เปิด "Strict Filter" = สัญญาณน้อยแต่คุณภาพสูง
ปิด "Strict Filter" = สัญญาณเยอะแต่อาจเสี่ยงขึ้น
ตัวบ่งชี้:
- เปิด/ปิดแต่ละ Level ได้
- ผสมผสานหาสูตรที่เหมาะกับคุณ
การแสดงผล:
- แสดง/ซ่อนเส้น TP/SL
- แสดง/ซ่อนกล่องข้อมูล Entry
- โหมดมือถือสำหรับจอเล็ก
เมื่อไหร่ควรใช้กลยุทธ์นี้?
✅ เหมาะกับ:
- ตลาดที่คึกคัก (เซสชั่นลอนดอน/นิวยอร์ก)
- ไทม์เฟรมเล็ก (1m, 5m, 15m)
- คู่เงินที่มีความผันผวนและเทรนด์ชัด
❌ หลีกเลี่ยง:
- ช่วงมีข่าวเศรษฐกิจสำคัญ
- ตลาดเงียบมาก
- วันหยุดสุดสัปดาห์
Demand & Supply (3 MTF) + SMC & Alerts by StockFusion 3.2Demand & Supply (3 MTF) + SMC & Alerts by StockFusion 3.2
**Overview**
Demand & Supply (3 MTF) + SMC & Alerts by StockFusion 3.2 is a multi–timeframe institutional-style trading tool that automatically detects high-quality Demand & Supply zones (3 TF), Smart Money Concepts (CHoCH & BOS), institutional volume footprints, Fair Value Gaps (FVG), and structural Premium/Discount levels. It is designed to give traders a clear HTF–MTF–LTF view, with smart alerts and a compact trend meter, so that execution can be done with more clarity and discipline.
**Description**
This indicator combines three core engines in one:
* **3× MTF Demand & Supply Zones**
* Auto-detection of RBR/DBR (DZ) and DBD/RBD (SZ) across TF-1 / TF-2 / TF-3.
* Manual / Normal / Conservative / Analysis modes for zone quality control (explosive/body ratios, ATR multipliers, volume filters).
* Dynamic zone removal on retest/mitigation (first & second-leg logic) with optional historical label retention.
* Multi-TF visibility controls (show HTF zones on LTF, LTF on HTF, etc.) and live “Nearest Zone Table” with Proximal/Distal & proximity %.
* **SMC (CHoCH, BOS, FVG, Premium/Discount)**
* Automatic CHoCH & BOS mapping with swing-based detection, visual lines and labels.
* FVG detection (bullish & bearish) with mitigation tracking, optional opacity reduction and mitigation alerts.
* Auto structure engine (HH/LL, BOS/CHoCH) with configurable lookback and line styles.
* Premium/Discount auto-fib levels (1.0/0.78/0.71/0.5/0.0) + optional “P / D” labels and 0.71 touch alerts when aligned with FVG & volume.
* **Institutional Volume, Trend Meter & Extras**
* Institutional “I/X” footprint detection with volume multipliers, significant & extreme volume spike markers + optional alerts.
* Trend Meter table for 3 higher timeframes using 50-period MAs (D/W/M by default) with quick visual up/down bias.
* 3-in-1 colored SMA/EMA pack, inside-bar detector with optional coloring and high/low lines for price action traders.
All key components are modular: you can toggle zones, SMC, institutional activity, FVG, fib structure, alerts, trend meter, and inside candles as per your trading style (intraday, swing, positional, or pure analysis).
**Disclaimer**
This indicator is for **educational and analytical purposes only** and does **not** constitute financial, investment, or trading advice. No buy/sell/hold recommendations are given, and no profitability or performance is guaranteed. Markets are risky; always do your own research, test on demo first, and consult your financial advisor if needed. By using this script, you accept that you are fully responsible for your own trading decisions and results.
Session Breakout StrategyThis is simple Session Breakout Strategy with Toggles provided to enable different Sessions based on the requirement..
ADX and Volume Filters provided to cut down the Whipsaws..
For BTC in 5 mins works good with the default setting.
For Gold Change ATR TP - 2.5 and ATR SL -1.5 in 5m TF.
VLB Entry TOOL — Dynamic Key Levels & Continuation Behavior ModThe VLB Entry Tool is a behavior-driven analysis system built specifically for XAUUSD.
It focuses on two structural elements that consistently influence gold’s movement:
1. Key Levels
2. Continuation thresholds after expansion
The indicator automatically identifies and displays key levels on the chart—levels that gold frequently reacts to through rejections, breaks, or pullbacks.
Since these levels form the foundation of most intraday movement, the tool removes the need to manually update them each session.
A core observation behind this model is that gold often breaks through a major level, retraces, and then gains continuation strength once price expands beyond the level by a predefined threshold.
This “break → pullback → continuation” behavior is used to plot objective price zones where continuation has historically shown a higher probability of developing.
Dynamic Adaptive Levels
The VLB Entry Tool continuously adjusts its key levels and continuation thresholds as market structure evolves.
As price forms new highs/lows or shifts intraday behavior, the tool automatically recalibrates to the new environment—helping traders stay aligned with real-time market structure without redrawing levels manually.
What the indicator provides:
-Automatically mapped key levels based on gold’s structural behavior
-Highlighted continuation zones after price expansion
-Real-time adaptive recalculation as market conditions change
-Objective, rules-based entry zones
-A consistent framework that reduces guesswork around “where” to enter
-A focus on price behavior rather than predictions
The VLB Entry Tool does not provide guaranteed outcomes or financial advice.
It organizes XAUUSD structure into predefined reference points using historical behavior, volatility characteristics, and a rules-based approach.
Traders remain responsible for their own timing, confirmation, fundamental context, and risk management.
This tool is designed for traders who want a structured, adaptive, and behavior-focused framework for interpreting XAUUSD movement—centered on the key levels that matter most.
SPY Flow + ORBSPY Flow is an intraday overlay indicator combining:
9/21 EMA ribbon calculated on Heikin-Ashi candles
5-minute opening range high/ low with persistent box and breakout detection
Daily VWAP (Heikin-Ashi based)
Unique behavior: master signals fire only on concurrent ORB breakout and EMA ribbon direction alignment. All other conditions are suppressed. Result is extremely low signal frequency with high alignment probability on SPY.
Alpha-Vector Unconstrained [GG_DOGE]
Alpha-Vector: Variance-Weighted Trend Capture Protocol
Authored by: GG_DOGE
Executive Summary
This algorithm represents the culmination of an exhaustive quantitative regression analysis, designed to exploit fat-tail distribution events in the SOL/USD cryptographic pair. By leveraging recursive historical data modeling on the 8-Hour timeframe, the strategy identifies high-probability momentum asymmetry—specifically isolating periods where directional volatility aligns with institutional order flow.
Unlike static heuristic models, this protocol utilizes a Dynamic Variance-Weighted Allocation Engine. This ensures that capital exposure is inversely correlated to market noise (entropy) while maximizing geometric compounding during high-conviction momentum phases. It essentially acts as a volatility filter, capitalizing on the statistical skew of the asset's return profile while enforcing rigorous drawdown mitigation via adaptive liquidity exits.
Key Algorithmic Features
Asymmetric Risk Architecture: The strategy deploys decoupled risk profiles for Long and Short vectors. Through backtest optimization, we have mathematically determined that bullish drift requires aggressive variance targeting, while bearish mean-reversion requires strictly constrained capital exposure to mitigate "short-squeeze" tail risks.
Volatility-Adjusted Position Sizing: Trade depth is not static. The algorithm calculates the instantaneous Average True Range (ATR) to normalize position size based on current market turbulence. This maintains a constant Risk-of-Ruin probability, regardless of price velocity.
Quantitatively Optimized Trend Filter: The entry signal is governed by a proprietary lookback period derived from computational brute-forcing of historical pivot points, designed to filter out Gaussian noise and only execute during significant structural market shifts.
Operational Guide (Strict Adherence Required)
This script comes pre-loaded with the statistically optimal parameters for the analyzed asset. No manual calibration is required.
Deployment Target:
Asset: CRYPTO:SOLUSD (Solana / US Dollar)
Timeframe: 8h (8-Hour Candle)
Exchange: Any major liquidity venue (Binance, Coinbase, Kraken, etc.)
Configuration:
Strategy Mode: Select "Long & Short" for the fully optimized protocol (captures upside momentum and hedges downside crashes).
Risk Parameters: The default values are mathematically tuned for maximum geometric growth (Highest PnL). Do not alter these unless you wish to artificially suppress the algorithm's volatility targeting.
Execution:
Capital Allocation: The logic is designed for compounding growth. It will automatically calculate the maximum lot size allowed based on your account equity, ensuring 100% capital efficiency without crossing into margin-call territory
Alpha Simple Supply/Demand
Alpha Simple Supply/Demand
This indicator's primary function is to plot potential Supply (Resistance) and Demand (Support) zones on the chart by referencing the High and Low price points.
How It Functions
Supply Zones (Red): These are drawn around the Daily Highs and represent areas where selling pressure (resistance) is anticipated.
Demand Zones (Green): These are drawn around the Daily Lows and represent areas where buying pressure (support) is anticipated.
Application on a 30-Minute Chart
This setup helps you see how the current intra-day price action is interacting with the significant daily structural levels established over the past few sessions.
Void Ribbon ProVoid Ribbon Pro is a custom, private TradingView indicator designed to simplify market decision-making by providing clear buy and sell signals based on trend strength, volatility conditions, and price interaction with liquidity “voids.”
Instead of overwhelming traders with dozens of variables, Void Ribbon Pro condenses market structure into a single ribbon-based model that visually shows when the market is shifting into a favorable long or exit condition.
How It Works
Void Ribbon Pro uses a dynamic ribbon composed of multiple adaptive moving averages that expand and contract based on volatility and trend momentum. This ribbon acts as both a trend filter and a signal engine:
BUY signal when price regains strength above the ribbon, momentum flips positive, and the model detects a filled or forming liquidity void beneath price.
SELL signal (or exit signal) when price closes back below the ribbon, trend strength weakens, or momentum reverses.
Key Features
Automatic Buy & Sell Signals
Removes emotional bias by highlighting high-probability entries and exits.
Void Detection
Identifies gaps, inefficiencies, and liquidity voids that often lead to strong continuation or reversal moves.
Adaptive Trend Ribbon
The ribbon thickens during high-volatility expansions and tightens during consolidation, making trend phases visually obvious.
Auto-Filtering for Choppy Markets
Helps avoid false signals by tightening thresholds during sideways conditions.
No Short Signals (Long-Bias Model)
Designed for simplicity — focuses only on high-quality long setups and exit conditions.
Clean, easy-to-read visuals
Perfect for newer traders who need clarity and for experienced traders who want one tool that quickly shows trend + momentum + inefficiencies at a glance.
What Problem It Solves
Most retail traders struggle with:
Information overload
Conflicting indicators
Not knowing when a trend is strong enough to enter
Panic-exiting too early or too late
Void Ribbon Pro solves this by giving a single unified signal system, showing:
When the market is strong, building momentum → Buy
When the push is weakening or reversing → Sell / Exit
When a liquidity void is forming or being filled → Extra confluence
Ideal For
Order flow traders
Trend traders
Momentum traders
Beginners who want simple, clear signals
Traders who can’t afford expensive order-flow tools like Bookmap or Exocharts
Point of Control + Momentum CandlesPOINT OF CONTROL + MOMENTUM CANDLES
A multi-feature indicator combining volume-based POC detection, 6-level momentum candle coloring, higher timeframe buy/sell signals, and order block identification.
FEATURES
Point of Control (POC)
Calculates the price level with highest traded volume over a customizable lookback period. Includes break and rejection detection with visual signals.
Momentum Candle Coloring
Colors candles based on EMA positioning and RSI values across 6 momentum levels:
- Bull 3/2/1: Strong to weak bullish momentum (Blue/Cyan/Green)
- Bear 1/2/3: Weak to strong bearish momentum (Yellow/Orange/Red)
- Neutral: No clear momentum (White)
Buy/Sell Signals
Generates signals from a user-selectable timeframe using EMA crossovers and RSI conditions. Signals appear on your current chart for multi-timeframe analysis.
Order Blocks
Detects potential institutional entry zones:
- Bullish OB: Last bearish candle before bullish impulse
- Bearish OB: Last bullish candle before bearish impulse
Blocks extend forward and optionally delete when mitigated.
Dashboard
Displays POC price, distance, RSI, momentum level, signal timeframe, and active order block count.
ALERTS
10 conditions available: POC breaks, rejections, buy/sell signals, and order block formations.
HOW TO USE
- Trade POC breaks for trend continuation
- Trade POC rejections for reversals
- Use candle colors to gauge momentum strength
- Confirm entries with higher timeframe signals
- Watch for price returning to order blocks
SETTINGS
All parameters are fully customizable including lookback periods, thresholds, timeframes, colors, and visual styles.
DISCLAIMER
For educational purposes only. Not financial advice. Trading involves risk. Always conduct your own analysis before making trading decisions.
Point of Control + Momentum CandlesPOINT OF CONTROL + MOMENTUM CANDLES
A comprehensive technical analysis indicator combining volume-based Point of Control detection, momentum-graded candle coloring, higher timeframe buy/sell signals, and order block identification.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT THIS INDICATOR DOES
This indicator identifies key price levels where the most trading activity has occurred (Point of Control), colors candles based on momentum strength, generates buy/sell signals from a user-selected timeframe, and detects order blocks that may act as future support/resistance zones.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FEATURES
1. POINT OF CONTROL (POC)
The POC represents the price level with the highest traded volume over a lookback period. This indicator calculates a volume profile by distributing volume across price levels and identifying where the most activity occurred.
- Orange horizontal line shows the current POC level
- Yellow box highlights the candles used in the POC calculation
- Break detection identifies when price closes decisively beyond the POC
- Rejection detection identifies when price tests but fails to break the POC
2. MOMENTUM CANDLE COLORING
Candles are colored based on a 6-level momentum system using EMA positioning and RSI values:
Bullish Levels (price above both EMAs):
- Bull Level 3 (Royal Blue): Strong momentum, RSI above 70
- Bull Level 2 (Cyan): Medium momentum, RSI above 60
- Bull Level 1 (Green): Weak momentum, above EMAs
Bearish Levels (price below both EMAs):
- Bear Level 1 (Yellow): Weak momentum, below EMAs
- Bear Level 2 (Orange): Medium momentum, RSI below 40
- Bear Level 3 (Red): Strong momentum, RSI below 30
Neutral (White): No clear directional momentum
3. BUY/SELL SIGNALS
Signals are generated from a user-selectable timeframe (default: 10 minutes) and appear on your current chart. This allows you to see higher timeframe signals while trading on lower timeframes.
Buy Signal Conditions:
- EMA crossover (fast crosses above slow) OR RSI exits oversold
- Bullish candle on the signal timeframe
- Close above both EMAs
Sell Signal Conditions:
- EMA crossunder (fast crosses below slow) OR RSI exits overbought
- Bearish candle on the signal timeframe
- Close below both EMAs
4. ORDER BLOCKS
Order blocks identify potential institutional entry zones that may act as future support or resistance.
- Bullish Order Block (Green zone): The last bearish candle before a bullish impulse move
- Bearish Order Block (Red zone): The last bullish candle before a bearish impulse move
- Blocks automatically extend forward and can be set to delete when mitigated (price closes through the zone)
5. DASHBOARD
A customizable info panel displays:
- Current POC price
- Distance from POC (percentage)
- Position relative to POC (Above/Below/At)
- Lookback period
- Current RSI value
- Current momentum level
- Signal timeframe
- Active order block count
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
POC Trading:
- Watch for breaks above POC for potential long entries
- Watch for breaks below POC for potential short entries
- Rejections at POC can indicate reversal opportunities
Momentum Reading:
- Use candle colors to gauge trend strength at a glance
- Level 3 colors indicate strong momentum (potential continuation)
- Level 1 colors indicate weakening momentum (potential reversal)
- Neutral/white candles suggest consolidation or indecision
Signal Confirmation:
- Use buy/sell signals from a higher timeframe to confirm entries on your trading timeframe
- Combine signals with POC breaks/rejections for higher probability setups
Order Block Strategy:
- Look for price to return to bullish order blocks for potential long entries
- Look for price to return to bearish order blocks for potential short entries
- Mitigated blocks (price closes through) lose their significance
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS OVERVIEW
POC Settings:
- Lookback Period: Number of bars for POC calculation (default: 20)
- Volume Resolution: Price level granularity (default: 50)
- Recalculation Frequency: How often POC updates (default: every 3 bars)
Break/Rejection Detection:
- Break Threshold: Minimum percentage move to confirm a break (default: 0.3%)
- Rejection Wick Ratio: Minimum wick-to-body ratio for rejections (default: 0.5)
Momentum Settings:
- Fast/Slow EMA lengths for trend determination
- RSI length and threshold levels for momentum grading
Buy/Sell Signals:
- Signal Timeframe: The timeframe used for signal calculation
- Separate EMA and RSI parameters for signal generation
Order Blocks:
- Order Block Timeframe: Timeframe for OB detection
- Max Blocks Per Side: Limits displayed order blocks
- Delete Mitigated: Automatically removes invalidated blocks
All visual elements (colors, sizes, line styles) are fully customizable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALERTS
10 alert conditions are available:
- Bullish/Bearish POC Break
- Bullish/Bearish POC Rejection
- Any POC Break
- Any POC Rejection
- Buy Signal
- Sell Signal
- Bullish Order Block Formed
- Bearish Order Block Formed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTES
- The indicator uses request.security() to fetch data from the signal and order block timeframes. This is designed to work when viewing charts at timeframes equal to or lower than your selected signal/OB timeframes.
- POC calculations are based on the visible volume data. Assets with limited volume data may produce less reliable POC levels.
- Order blocks are detected using a simplified algorithm based on candle patterns and displacement. They represent potential zones of interest, not guaranteed support/resistance levels.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DISCLAIMER
This indicator is provided for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any security. Trading involves substantial risk of loss. Past performance is not indicative of future results. Always conduct your own analysis and consider your risk tolerance before making trading decisions. Use this tool as part of a comprehensive trading strategy, not as a standalone signal generator.
microwave weeeingThis algorithmic indicator finds trading opportunities. Its principle is simple: it identifies inflection points where trading volume explodes, groups together multiple inflection points near those points, and then retains only those that actually function as support and resistance. It's recommended to monitor the indicator over at least a 15-minute chart.
매물대를 찾아주는 알고리즘 지표. 원리는 간단하게 거래량이 폭발했던 변곡 구간을 찾고, 그 근처에 여러 번 쌓인 변곡구간만 묶어서 박스로 만들고, 그 박스가 실제로 지지·저항 역할을 한 것만 남기는 지표. 최소 15분봉 이상에서 보는걸 추천합니다.
PD Array Matrix [NINE Θ]PD Array Matrix
A comprehensive ICT-based indicator that combines multiple Premium/Discount Array concepts into a single, unified tool for Smart Money analysis.
Overview
PD Array Matrix provides traders with institutional-grade market structure analysis by integrating key ICT (Inner Circle Trader) concepts. This indicator automatically identifies and displays critical price levels, imbalances, and divergences that smart money uses to execute trades.
Key Features
Change in State of Delivery (CISD)
Automatically detects shifts in market delivery, signaling potential reversals or continuation setups.
Bullish and Bearish detection with directional filtering
Confirmation arrows for visual clarity
Wick-based invalidation for precise risk management
Customizable line styles, colors, and label formats
Order Blocks
Identifies institutional order flow zones where significant buying or selling occurred.
Box or Line display styles
Filter by direction: Both, Bullish, Bearish, or CISD Direction
CISD Direction mode only shows Order Blocks that align with the current market bias
Automatic invalidation when price mitigates the zone
Market Structure Levels
Tracks key liquidity levels that institutional traders target.
Minor Levels: Intermediate swing highs/lows (Buyside/Sellside)
Major Levels: Significant swing points with higher timeframe relevance
Automatic fill detection with optional historical display
Customizable display modes: Label Only, Price Only, Both, or Minimalistic
Fair Value Gaps (FVGs)
Detects price imbalances created by aggressive market moves.
Three display styles: Normal, Minimalist, and Classic
Optional Volume Imbalance detection (body-to-body gaps)
50% Consequent Encroachment line
Proximity-based display showing FVGs closest to current price
Inversion Fair Value Gaps (IFVGs)
Identifies when price inverts through an existing FVG, flipping its directional bias.
Automatic conversion from FVG to IFVG on body close
Configurable lookback period to filter old inversions
Independent display controls from regular FVGs
Invalidation tracking when price closes through the zone
Higher Timeframe FVGs
Displays Fair Value Gaps from higher timeframes on your current chart.
Auto Timeframe selection based on your chart
Manual timeframe override option
Seamless integration with lower timeframe analysis
SMT Divergences
Detects Smart Money Tool divergences between correlated instruments.
Auto SMT Mode: Automatically selects correlated pairs for:
Index Futures (NQ, ES, YM, RTY)
Metals (GC, SI, PL)
Energy (CL, RB, NG)
Forex Majors
Crypto (BTC, ETH)
Manual symbol selection for custom pairs
Dual symbol comparison for confluence
Automatic invalidation tracking
Session Filters
Limit all setups to specific trading sessions.
Two configurable session windows
Multiple timezone support
Applies to: FVGs, IFVGs, CISDs, Order Blocks, and SMTs
Active on timeframes ≤ 1 hour
Customization
Every component offers extensive customization:
Individual toggle controls for each feature
Color settings for bullish/bearish elements
Multiple line styles (Solid, Dashed, Dotted)
Label size and position options
Transparency controls
Historical display limits
This indicator is for educational and informational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always conduct your own analysis and manage risk appropriately.
Kriptano Short IndicatorИндикатор "KRIPTANO SHORT INDICATOR" 🚀 объединяет мощные инструменты для трейдинга: детектирование резких движений (пампов) 🔥 и построение уровней сопротивления с возможностью ручного выбора диапазона 📏.
Он анализирует рост цены выдавая сигнал SHORT⚠️. Уровни сопротивления строятся по таймфреймам от 5 минут до недели, с возможностью настройки цвета и отображения пробитых уровней 🎨. Встроен объёмный профиль с ручным выбором диапазона, который позволяет визуализировать распределение объёма по ценам💹.
Индикатор удобен для поиска точек входа и анализа рыночных структур на различных таймфреймах 📊
The "KRIPTANO SHORT INDICATOR" 🚀 combines powerful tools for trading: detecting sharp moves (pumps) 🔥 and building resistance levels with the ability to manually select the range 📏.
It analyzes price growth and generates a SHORT signal ⚠️. Resistance levels are built on timeframes from 5 minutes up to 1 week, with flexible color settings and the option to display broken levels 🎨. A built‑in volume profile with manual range selection allows you to visualize volume distribution by price 💹.
The indicator is convenient for finding entry points and analyzing market structure across different timeframes 📊.
Session Flow Map [Ambrosia-Prime] – Basic⭐ English Description for Publishing
Session Flow Map – Basic Version
The Session Flow Map is a clean and highly optimized tool designed to visualize the global market sessions in a simple, intuitive way.
It highlights the Asia, Europe, and US trading sessions with dynamic background coloring and a real-time session flag that always reflects the actual active market session – independent of user settings.
This indicator automatically adjusts to the user's preferred region through a built-in Timezone Selector, ensuring accurate session timing anywhere in the world.
🔥 Key Features
✔ Global Session Mapping
Asia Session
Europe Session
US Session
True EU + US Overlap shading (soft white highlight)
✔ Real-Time Session Status
Flag display (🇯🇵 🇪🇺 🇺🇸) shows current active session
Works even if the user hides background colors
Updates automatically based on local timezone selection
✔ User-Configurable Timezone
Choose where you live:
EU (CET)
US East (EST)
US West (PST)
Asia (Tokyo/HK)
Custom offset (−12 to +12 hours)
Session timings adjust instantly to the user’s environment.
🎨 Visual Clarity
Smooth background transitions
Soft color shading for improved readability
High-contrast overlap zone
Compact session flag panel with clean UI
💡 Who Is This For?
Perfect for traders who want:
Clear visibility of global session behavior
Awareness of high-liquidity periods
Better intraday market structure tracking
Simple chart context without clutter
Scalpers, day traders, and algorithmic traders benefit greatly from session awareness.
⚙️ Performance
Extremely lightweight
No repainting
Zero security() calls
Suitable for all timeframes and markets (crypto, forex, indices, futures)
📌 Version
Session Flow Map – Basic v1.0.0
Viel Erfolg & Happy Trading!
Yours truly, Ambrosia-Prime
Trivon LiteTrivon Lite is the simplified version of the Trivon trading system — designed to give traders clean Buy/Sell signals filtered by trend direction.
It is lightweight, beginner-friendly, and perfect for those who want a simple visual system to assist with entries.
✨ Features
Buy/Sell signals based on optimized volatility + trend conditions
Two built-in trend filters (Lite mode uses restricted settings)
Clean TP/SL visualization
Uses a simple risk-reward model
Works on all markets & timeframes
🔓 What's Included in Lite
Basic core entry system
Trend filters (limited customization)
Basic TP/SL settings
🔒 What's in Trivon Pro (Paid Version)
Fully adjustable trend filter periods
Optional higher-timeframe confirmation
Trend Table (multi-timeframe strength overview)
Backtesting Dashboard for performance insights
Additional filtering options for cleaner signals
ATR-based TP/SL customization
More advanced signal refining tools
If you enjoy Trivon Lite, the premium version Trivon Pro is coming out soon...
KRIPTANO SHORT INDICATORИндикатор "KRIPTANO SHORT INDICATOR" 🚀 объединяет мощные инструменты для трейдинга: детектирование резких движений (пампов) 🔥 и построение уровней сопротивления с возможностью ручного выбора диапазона 📏.
Он анализирует рост цены выдавая сигнал SHORT⚠️. Уровни сопротивления строятся по таймфреймам от 5 минут до недели, с возможностью настройки цвета и отображения пробитых уровней 🎨. Встроен объёмный профиль с ручным выбором диапазона, который позволяет визуализировать распределение объёма по ценам
💹. Индикатор удобен для поиска точек входа и анализа рыночных структур на различных таймфреймах 📊
The "KRIPTANO SHORT INDICATOR" 🚀 combines powerful tools for trading: detecting sharp moves (pumps) 🔥 and building resistance levels with the ability to manually select the range 📏.
It analyzes price growth and generates a SHORT signal ⚠️. Resistance levels are built on timeframes from 5 minutes up to 1 week, with flexible color settings and the option to display broken levels 🎨. A built‑in volume profile with manual range selection allows you to visualize volume distribution by price 💹.
The indicator is convenient for finding entry points and analyzing market structure across different timeframes 📊.
River 4.0River 4.0 is a visual system designed to help traders read market direction, trend-shift momentum, and high-quality entry zones through a combination of the River Cloud, three key structural lines, and a dedicated scalp zone system.
Key Features
1. River Cloud (Dynamic Daily Flow)
A dynamic zone formed between two daily-derived levels that represents market balance and directional flow.
The cloud color changes based on market conditions (Bullish, Bearish, or Neutral), including smooth gradient transitions whenever a trend shift occurs.
2. High Line, Mid Line, Low Line
Three structural reference levels that help users identify buy zones, sell zones, and neutral zones without needing any technical calculations.
– Price above the High Line = Buy Zone
– Price below the Low Line = Sell Zone
– Price between the lines = Neutral Zone
3. Trend State Display
A compact panel on the bottom-right showing the current trend state, the values of all three structural lines, and the volume condition (Rising / Falling).
4. Buy & Sell Triggers
Visual markers that appear when price breaks specific structural levels, providing confirmation for entries aligned with the prevailing trend.
5. Scalp Zone Box
A special zone that forms whenever a trend shifts, giving traders a premium early-entry window during the initial momentum of a new trend.
Ideal for aggressive entries or re-entry confirmation after a retest.
6. Clean Visuals & Lightweight Logic
The system avoids heavy calculations or complex indicators.
All components are designed for a clean, fast, and easy-to-interpret chart experience.
Purpose of River 4.0
To give traders a clear visual understanding of market flow, transition phases, and real-price-action-based entry opportunities — suitable for scalpers, intraday traders, swing traders, and beginners alike.
Fortunato Lead-Lag Multi-Asset (POC) v5_fix2//@version=6
indicator("Fortunato Lead-Lag Multi-Asset (POC) v5_fix2", shorttitle="FLL Multi POC v5_fix2", overlay=false, max_lines_count=200, max_labels_count=200)
// ========== USER CONFIG ==========
res = input.timeframe("1", "Resolution for analysis (ex: 1, 5, 3)")
corr_length = input.int(60, "Rolling window (bars) for correlation", minval=10, maxval=500)
max_lag = input.int(5, "Max lag to test (bars)", minval=1, maxval=20)
corr_threshold = input.float(0.60, "Correlation threshold (abs)", step=0.01)
min_lag_for_signal = input.int(1, "Min lag to consider (bars)", minval=0)
plot_lag_as_columns = input.bool(true, "Plot lag as columns")
// --- symbols (change to the exact tickers your feed uses) ---
sym_ndx = input.symbol("NASDAQ:NDX", "NDX (leader candidate) - change if needed")
sym_spx = input.symbol("SPX:SPX", "SPX (follower candidate) - change if needed")
// Optional add-ons
sym_vix = input.symbol("CBOE:VIX", "VIX (volatility index) - optional")
sym_dxy = input.symbol("ICEUS:DXY", "DXY (Dollar Index) - optional")
sym_xau = input.symbol("OANDA:XAUUSD","Gold (XAU/USD) - optional")
sym_oil = input.symbol("NYMEX:CL1!", "Crude Oil (continuous) - optional")
sym_btc = input.symbol("BINANCE:BTCUSDT","Bitcoin (BTC) - optional")
// ========== DATA FETCH (selected resolution) ==========
ndx = request.security(sym_ndx, res, close)
spx = request.security(sym_spx, res, close)
vix = request.security(sym_vix, res, close)
dxy = request.security(sym_dxy, res, close)
xau = request.security(sym_xau, res, close)
oil = request.security(sym_oil, res, close)
btc = request.security(sym_btc, res, close)
// ========== HELPERS ==========
has_history(len) => bar_index >= len
// rolling Pearson correlation implemented with ta.cum differences (replaces ta.sum)
rolling_corr(a, b, n) =>
if not has_history(n)
na
else
// compute rolling sums via cumulative sums
// sum_ab = sum_{k=0..n-1} a *b
float cum_ab = ta.cum(a * b)
float cum_ab_lag = cum_ab
float sum_ab = cum_ab - cum_ab_lag
float cum_a = ta.cum(a)
float cum_a_lag = cum_a
float sum_a = cum_a - cum_a_lag
float cum_b = ta.cum(b)
float cum_b_lag = cum_b
float sum_b = cum_b - cum_b_lag
float cum_a2 = ta.cum(a * a)
float cum_a2_lag = cum_a2
float sum_a2 = cum_a2 - cum_a2_lag
float cum_b2 = ta.cum(b * b)
float cum_b2_lag = cum_b2
float sum_b2 = cum_b2 - cum_b2_lag
float nn = n * 1.0
float num = sum_ab - (sum_a * sum_b) / nn
float den_part_a = sum_a2 - (sum_a * sum_a) / nn
float den_part_b = sum_b2 - (sum_b * sum_b) / nn
float den = den_part_a * den_part_b
if den <= 0.0
na
else
num / math.sqrt(den)
// ========== COMPUTE CORRELATIONS FOR ALL LAGS (USING rolling_corr) ==========
var float corr_dir1 = array.new_float()
var float corr_dir2 = array.new_float()
// ensure arrays sized correctly each bar
if array.size(corr_dir1) != (max_lag + 1)
array.clear(corr_dir1)
for i = 0 to max_lag
array.push(corr_dir1, na)
if array.size(corr_dir2) != (max_lag + 1)
array.clear(corr_dir2)
for i = 0 to max_lag
array.push(corr_dir2, na)
// fill arrays with correlation values (call rolling_corr every bar for consistency)
for i = 0 to max_lag
float val1 = na
if has_history(corr_length + i) and not na(ndx) and not na(spx)
// ndx aligned with spx shifted by +i (ndx leads spx by i)
val1 := rolling_corr(ndx, spx , corr_length)
array.set(corr_dir1, i, val1)
float val2 = na
if i > 0 and has_history(corr_length + i) and not na(ndx) and not na(spx)
// spx leads ndx by i
val2 := rolling_corr(ndx , spx, corr_length)
array.set(corr_dir2, i, val2)
// ========== FIND BEST ABSOLUTE CORRELATION AND DIRECTION ==========
float best_corr = na
int best_lag = 0
int best_dir = 0 // 1 = ndx -> spx, -1 = spx -> ndx
// scan dir1 (i = 0..max_lag)
for i = 0 to max_lag
float c = array.get(corr_dir1, i)
if not na(c)
if na(best_corr) or math.abs(c) > math.abs(best_corr)
best_corr := c
best_lag := i
best_dir := 1
// scan dir2 (i = 1..max_lag)
for i = 1 to max_lag
float c = array.get(corr_dir2, i)
if not na(c)
if na(best_corr) or math.abs(c) > math.abs(best_corr)
best_corr := c
best_lag := i
best_dir := -1
// ========== MULTI-ASSET LIGHT CONFIRMATION (explicit calls with rolling_corr) ==========
float sum_corr = 0.0
int count_corr = 0
// VIX
float local_best_vix = na
if not na(vix)
for j = 0 to max_lag
if has_history(corr_length + j)
float cc = rolling_corr(ndx, vix , corr_length)
if not na(cc)
if na(local_best_vix) or math.abs(cc) > math.abs(local_best_vix)
local_best_vix := cc
if not na(local_best_vix)
sum_corr := sum_corr + local_best_vix
count_corr := count_corr + 1
// DXY
float local_best_dxy = na
if not na(dxy)
for j = 0 to max_lag
if has_history(corr_length + j)
float cc = rolling_corr(ndx, dxy , corr_length)
if not na(cc)
if na(local_best_dxy) or math.abs(cc) > math.abs(local_best_dxy)
local_best_dxy := cc
if not na(local_best_dxy)
sum_corr := sum_corr + local_best_dxy
count_corr := count_corr + 1
// XAU
float local_best_xau = na
if not na(xau)
for j = 0 to max_lag
if has_history(corr_length + j)
float cc = rolling_corr(ndx, xau , corr_length)
if not na(cc)
if na(local_best_xau) or math.abs(cc) > math.abs(local_best_xau)
local_best_xau := cc
if not na(local_best_xau)
sum_corr := sum_corr + local_best_xau
count_corr := count_corr + 1
// OIL
float local_best_oil = na
if not na(oil)
for j = 0 to max_lag
if has_history(corr_length + j)
float cc = rolling_corr(ndx, oil , corr_length)
if not na(cc)
if na(local_best_oil) or math.abs(cc) > math.abs(local_best_oil)
local_best_oil := cc
if not na(local_best_oil)
sum_corr := sum_corr + local_best_oil
count_corr := count_corr + 1
// BTC
float local_best_btc = na
if not na(btc)
for j = 0 to max_lag
if has_history(corr_length + j)
float cc = rolling_corr(ndx, btc , corr_length)
if not na(cc)
if na(local_best_btc) or math.abs(cc) > math.abs(local_best_btc)
local_best_btc := cc
if not na(local_best_btc)
sum_corr := sum_corr + local_best_btc
count_corr := count_corr + 1
float confirm_avg = na
if count_corr > 0
confirm_avg := sum_corr / count_corr
// ========== SIGNAL LOGIC ==========
bool lead_detected = false
string lead_direction_text = "NoLeader"
if not na(best_corr) and math.abs(best_corr) >= corr_threshold and best_lag >= min_lag_for_signal
lead_detected := true
lead_direction_text := best_dir == 1 ? "NDX -> SPX" : (best_dir == -1 ? "SPX -> NDX" : "NoLeader")
// ========== PLOTS (GLOBAL) ==========
plot_best_corr = best_corr
plot_best_lag = (lead_detected ? best_lag : na)
plot_confirm_avg = confirm_avg
plot(plot_best_corr, title="Best Corr (signed)", linewidth=2)
hline(0, "zero", linestyle=hline.style_dashed)
hline(corr_threshold, "threshold +", linestyle=hline.style_solid)
hline(-corr_threshold, "threshold -", linestyle=hline.style_solid)
plot(plot_lag_as_columns ? plot_best_lag : na, title="Best Lag (bars)", style=plot.style_columns, linewidth=2)
plot(not na(plot_confirm_avg) ? plot_confirm_avg : na, title="Multi-asset confirm (avg)", linewidth=1, style=plot.style_line)
// ========== LABEL MANAGEMENT ==========
var label lbl = na
if lead_detected and barstate.isconfirmed
if not na(lbl)
label.delete(lbl)
lbl := label.new(bar_index, plot_best_corr, text="Lead: " + lead_direction_text + " lag:" + str.tostring(best_lag) + " corr:" + str.tostring(best_corr, "#.##"),
style=label.style_label_left, color=color.new(color.green, 75), textcolor=color.white, size=size.small)
// ========== ALERTS ==========
alertcondition(lead_detected and best_dir == 1, title="NDX leads SPX detected", message="NDX leads SPX — lag: {{plot_1}} corr: {{plot_0}}")
alertcondition(lead_detected and best_dir == -1, title="SPX leads NDX detected", message="SPX leads NDX — lag: {{plot_1}} corr: {{plot_0}}")
// ========== INFORMATION TABLE ==========
var table t = table.new(position.top_right, 1, 5, border_width=1)
if barstate.islast
table.cell(t, 0, 0, "Resolution: " + res)
table.cell(t, 0, 1, "Best corr: " + (na(best_corr) ? "na" : str.tostring(best_corr, "#.##")))
table.cell(t, 0, 2, "Best lag: " + (na(best_lag) ? "na" : str.tostring(best_lag)))
table.cell(t, 0, 3, "Direction: " + lead_direction_text)
table.cell(t, 0, 4, "Confirm avg: " + (na(confirm_avg) ? "na" : str.tostring(confirm_avg, "#.##")))






















