Market Sentiment Trend Gauge [LevelUp]Market Sentiment Trend Gauge simplifies technical analysis by mathematically combining momentum, trend direction, volatility position, and comparison against a market benchmark, into a single trend score from -100 to +100. Displayed in a separate pane below your chart, it resolves conflicting signals from RSI, moving averages, Bollinger Bands, and market correlations, providing clear insights into trend direction, strength, and relative performance.
THE PROBLEM MARKET SENTIMENT TREND GAUGE (MSTG) SOLVES
Traditional indicators often produce conflicting signals, such as RSI showing overbought while prices rise or moving averages indicating an uptrend despite market underperformance. MSTG creates a weighted composite score to answer: "What's the overall bias for this asset?"
KEY COMPONENTS AND WEIGHTINGS
The trend score combines
▪ Momentum (25%): Normalized 14-period RSI, capped at ±100.
▪ Trend Direction (35%): 10/21-period EMA relationships,
▪ Volatility Position (20%): Price position, 20-period Bollinger Bands, capped at ±100.
▪ Market Comparison (20%): Daily performance vs. SPY benchmark, capped at ±100.
Final score = Weighted sum, smoothed with 5-period EMA.
INTERPRETING THE MSTG CHART
Trend Score Ranges and Colors
▪ Bright Green (>+30): Strong bullish; ideal for long entries.
▪ Light Green (+10 to +30): Weak bullish; cautiously favorable.
▪ Gray (-10 to +10): Neutral; avoid directional trades.
▪ Light Red (-10 to -30): Weak bearish; exercise caution.
▪ Bright Red (<-30): Strong bearish; high-risk for longs, consider shorts.
Reference Lines
▪ Zero Line (Gray): Separates bullish/bearish; crossovers signal trend changes.
▪ ±30 Lines (Dotted, Green/Red): Thresholds for strong trends.
▪ ±60 Lines (Dashed, Green/Red): Extreme strength zones (not overbought/oversold); manage risk (tighten stops, partial profits) but trends may persist.
Background Colors
▪ Green Tint (>+20): Bullish environment; favorable for longs.
▪ Red Tint (<-20): Bearish environment; caution for longs.
▪ Light Gray Tint (-20 to +20): Neutral/range-bound; wait for signals.
Extreme Readings vs. Traditional Signals
MSTG ±60 indicates maximum alignment of all factors, not reversals (unlike RSI >70/<30). Use for risk management, not automatic exits. Strong trends can sustain extremes; breakdowns occur below +30 or above -30.
INFORMATION TABLE INTERPRETATION
Trend Score Symbols
▲▲ >+30 strong bullish
▲ +10 to +30
● -10 to +10 neutral
▼ -30 to -10
▼▼ <-30 strong bearish
Colors: Green (positive), White (neutral), Red (negative).
Momentum Score
+40 to +100 strong bullish
0 to +40 moderate bullish
-40 to 0 moderate bearish
-100 to -40 strong bearish
Market vs. Stock
▪ Green: Stock outperforming market
▪ Red: Stock underperforming market
Example Interpretations:
-0.45% / +1.23% (Green): Market down, stock up = Strong relative strength
+2.10% / +1.50% (Red): Both rising, but stock lagging = Relative weakness
-1.20% / -0.80% (Green): Both falling, but stock declining less = Defensive strength
UNDERSTANDING EXTREME READINGS VS TRADITIONAL OVERBOUGHT/OVERSOLD
⚠️ Critical distinctions
Traditional Overbought/Oversold Signals:
▪ Single indicator (like RSI >70 or <30) showing momentum excess
▪ Often suggests immediate reversal or pullback expected
▪ Based on "price moved too far, too fast" concept
MSTG Extreme Readings (±60):
▪ Composite alignment of 4 different factors (momentum, trend, volatility, relative strength)
▪ Indicates maximum strength in current direction
▪ NOT a reversal signal - means "all systems extremely bullish/bearish"
Key Differences:
▪ RSI >70: "Price got ahead of itself, expect pullback"
▪ MSTG >+60: "Everything is extremely bullish right now"
▪ Strong trends can maintain extreme MSTG readings during major moves
▪ Breakdowns happen when MSTG falls below +30, not at +60
Proper Usage of Extreme Readings:
▪ Risk Management: Tighten stops, take partial profits
▪ Position Sizing: Reduce new position sizes at extremes
▪ Trend Continuation: Watch for sustained extreme readings in strong markets
▪ Exit Signals: Look for breakdown below +30, not reversal from +60
TRADING WITH MSTG
Quick Assessment
1. Check trend symbol for direction.
2. Confirm momentum strength.
3. Note relative performance color.
Examples:
▲▲ 55.2 (Green), Momentum +28.4, Outperforming: Strong buy setup.
▼ -18.6 (Red), Momentum -43.2, Underperforming: Defensive positioning.
Entry Conditions
▪ Long: stock outperforming market
- Score >+30 (bright green)
- Sustained green background
- ▲▲ symbol,
▪ Short: stock underperforming market
- Score <-30 (bright red)
- Sustained red background
- ▼▼ symbol
Avoid Trading When:
▪ Gray zone (-10 to +10).
▪ Rapid color changes or frequent zero-line crosses (choppy market).
▪ Gray background (range-bound).
Risk Management:
▪ Stop Loss: Exit on zero-line crossover against position.
▪ Take Profit: Partial at ±60 for risk control.
▪ Position Sizing: Larger when signals align; smaller in extremes or mixed conditions.
KEY ADVANTAGES
▪ Unified View: Weighted composite reduces noise and conflicts.
▪ Visual Clarity: 5-color system with gradients for rapid recognition.
▪ Market Context: Relative strength vs. SPY identifies leaders/laggards.
▪ Flexibility: Works across timeframes (1-min to weekly); customizable table.
▪ Noise Reduction: EMA smoothing minimizes false signals.
EXAMPLES
Strong Bull: Trend Score 71.9, Momentum Score 76.9
Neutral: Trend Score 0.1, Momentum Score -9.2
Strong Bear: Trend Score -51.7, Momentum Score -51.5
PERFORMANCE AND LIMITATIONS
Strengths: Trend identification, noise reduction, relative performance versus market.
Limitations: Lags at turning points, less effective in extreme volatility or non-trending markets.
Recommendations: View on multiple timeframes, combine with price action and fundamentals.
Volatility
ATR Volatility and Trend AnalysisATR Volatility and Trend Analysis
Unlock the power of the Average True Range (ATR) with the ATR Volatility and Trend Analysis indicator. This comprehensive tool is designed to provide traders with a multi-faceted view of market dynamics, combining volatility analysis, dynamic support and resistance levels, and trend detection into a single, easy-to-use indicator.
How It Works
The ATR Volatility and Trend Analysis indicator is built upon the core concept of the ATR, a classic measure of market volatility. It expands on this by providing several key features:
Dynamic ATR Bands: The indicator plots three sets of upper and lower bands around the price. These bands are calculated by multiplying the current ATR value by user-defined multipliers. They act as dynamic support and resistance levels, widening during volatile periods and contracting during calm markets.
Volatility Breakout Signals: Identify potential breakouts with precision. The indicator generates a signal when the current ATR value surges above its own moving average by a specified threshold, indicating a significant increase in volatility that could lead to a strong price move.
Trend Detection: The indicator determines the market trend by analyzing both price action and ATR behavior. A bullish trend is signaled when the price is above its moving average and volatility is increasing. Conversely, a bearish trend is signaled when the price is below its moving average and volatility is increasing.
How to Use the ATR Multi-Band Indicator
Identify Support and Resistance: Use the ATR bands as key levels. Price approaching the outer bands may indicate overbought or oversold conditions, while a break of the bands can signal a strong continuation.
Confirm Breakouts: Look for a volatility breakout signal to confirm the strength behind a price move. A breakout from a consolidation range accompanied by a volatility signal is a strong indicator of a new trend.
Trade with the Trend: Use the background coloring and trend signals to align your trades with the dominant market direction. Enter long positions during confirmed bullish trends and short positions during bearish trends.
Set Up Alerts: The indicator includes alerts for band crosses, trend changes, and volatility breakouts, ensuring you never miss a potential trading opportunity.
What makes it different?
While many indicators use ATR, the ATR Volatility and Trend Analysis tool is unique in its integration of multiple ATR-based concepts into a single, cohesive system. It doesn't just show volatility; it interprets it in the context of price action to deliver actionable trend and breakout signals, making it a complete solution for ATR-based analysis.
Disclaimer
This indicator is designed as a technical analysis tool and should be used in conjunction with other forms of analysis and proper risk management.
Past performance does not guarantee future results, and traders should thoroughly test any strategy before implementing it with real capital.
Doji @ Simple Areas — Strategy (v7)Twisted FX — Doji @ Simple Areas — Strategy (v7) Educational strategy for standard candles. No financial advice. Use realistic commission + slippage in backtests. For community chat or videos, see the author’s Signature on their profile.
Summary : Doji reversals only where it matters—inside/near ATR-sized supply/demand areas built from swing pivots. Optional quality gating, HTF confluence, and zone-strength scoring help keep the good trades and filter the noise.
What it does
Builds supply/demand areas from swing pivots when the departure is strong enough (ATR-scaled).
Maintains zone lifecycle: tracks touches, confirms retests, expires old zones, and flips a broken zone into the opposite side (optional).
Waits for a doji near/in a zone (strict or loose definition), with optional next-bar confirmation.
Resolves side using (a) which zone you’re closest to, (b) penetration depth, and/or (c) EMA trend.
Optional filters: K-of-4 quality checks, HTF EMA gate, HTF swing-band proximity, and zone strength score.
How signals form
Detect doji (strict: tiny body+both wicks; loose: body ≤ range fraction)
Check near/inside zone (ATR proximity)
Choose side (penetration vs distance; EMA trend optional; prev-candle flip optional)
Optional next-bar confirmation away from the touched zone
Pass quality mode + strength gates; enter at close, stop beyond doji wick (+buffer), TP via RR multiple
Quality modes
Off: widest coverage
Soft: pass K-of-4 (wick rejection, edge-band close, fresh touch, approach impulse)
Strict: auto-tightens thresholds (deeper wick, tighter band, stronger approach, fresher touch) + “rescue” if nearby zone is very strong
Zone strength (0–10)
Based on retests, post-touch reaction, age, and integrity (not broken); separate minimums for Soft/Strict
HTF confluence (optional)
HTF EMA trend gate (longs with uptrend, shorts with downtrend)
HTF swing-band proximity (ATR band around HTF swings)
Defaults are off so you can evaluate the core edge first
Options to play with
Zones/visuals: pivot length, zone half-ATR, min departure, expiry, break tolerance, de-dupe, extend right, Show zones, Hide unconfirmed, nearest-K highlight
Confirmation: retest window (bars), wick-based retest depth (ATR), min bars between signals
Doji rules: strict/loose, body fraction, min range (ATR), near-zone distance (ATR)
Side resolver: use trend (EMAs), use penetration, prev-candle flip, next-bar confirm + confirm ATR
Quality: mode Off/Soft/Strict, K setting, wick penetration ATR, edge-band fraction, approach lookback/min ATR, fresh-touch spacing
Strength gate: min strength Soft/Strict
Risk: RR multiple, stop buffer (micropips/ticks), Fixed qty or Risk % of equity
HTF: timeframe, EMA lengths, swing len, HTF ATR band size
Defaults
Quality mode: Off
HTF trend gate: Off
Show zones: On
Flip on break: On
Tuning tips
Too few trades: Quality → Off/Soft, raise proxATR, lower minRetestsToShow, widen confirm window, enable wick-based retest
Too many losers: try Soft/Strict, raise minStrength*, enable next-bar confirm, raise approachMinATR, enable HTF trend
Confirmed-only is empty: lower minRetestsToShow (e.g., 1) and enable wick-based retest so strong rejections count
Visuals & debug
Toggle “Show zones” and “Hide unconfirmed”; nearest-K highlight brings focus
Debug mode prints veto reasons (quality/HTF/strength/prevFlip/confirm) to help tuning
Notes
Zones come from confirmed pivots; brand-new structure needs a few bars to appear
Research/education only; not financial advice
Changelog (v7.1.5)
Safer arrays, stable nearest-K highlight, strict tuned with rescue, zone-strength consistency loops, defaults set to Quality Off & HTF gate Off, debug veto labels
Keywords
supply demand, doji, wick rejection, ATR, EMA, HTF, RR, confluence, strict filter, zone strength, FX/crypto/indices
Universal Breakout Strategy [KedArc Quant]Description:
A flexible breakout framework where you can test different logics (Prev Day, Bollinger, Volume, ATR, EMA Trend, RSI Confirm, Candle Confirm, Time Filter) under one system.
Choose your breakout mode, and the strategy will handle entries, exits, and optional risk management (ATR stops, take-profits, daily loss guard, cooldowns).
An on-chart info table shows live mode values (like Prev High/Low, Bollinger levels, RSI, etc.) plus P&L stats for quick analysis.
Use it to compare which breakout style works best on your instrument and timeframe, whether intraday, swing, or positional trading
🔑 Why it’s useful
* Flexibility: Switch between breakout strategies without loading different indicators.
* Clarity: On-chart info table displays current mode, relevant indicator levels, and live strategy P&L stats.
* Testing efficiency: Quickly A/B test different breakout styles under the same backtest environment.
* Transparency: Every trade is rule-based and displayed with entry/exit markers.
🚀 How it helps traders
* Lets you experiment with breakout strategies quickly without loading multiple scripts.
* Helps identify which breakout method fits your instrument & timeframe.
* Gives clear on-chart visual + statistical feedback for confident decision-making.
⚙️ Input Configuration
* Breakout Mode → choose which strategy to test:
* *Prev Day* → breakouts of yesterday’s High/Low.
* *Bollinger* → Upper/Lower BB pierce.
* *Volume* → Breakout confirmed with volume above average.
* *ATR Stop* → Wide range breakout using ATR filter.
* *Time Filter* → Breakouts inside defined session hours.
* *EMA Trend* → Breakouts only in EMA fast > slow alignment.
* *RSI Confirm* → Breakouts with RSI confirmation (e.g. >55 for longs).
* *Candle Confirm* → Breakouts validated by bullish/bearish candle.
* Lookback / ATR / Bollinger inputs → adjust sensitivity.
* Intrabar mode → option to evaluate breakouts using bar highs/lows instead of closes.
* Table options → show/hide info table, show/hide P&L stats, choose corner placement.
📈 Entry & Exit Logic
* Entry → occurs when breakout condition of chosen mode is met.
* Exit → default exits via opposite signals or optional stop/target if enabled.
* Session filter → optional auto-flat at session end.
* P&L management → optional daily loss guard, cooldown between trades, and ATR-based stop/take profit.
❓ FAQ — Choosing the best setup
Q: Which strategy should I use for which chart?
* *Prev Day Breakouts*: Best on indices, FX, and liquid futures with strong daily levels.
* *Bollinger*: Works well in range-bound environments, or crypto pairs with volatility compression.
* *Volume*: Good on equities where breakout strength is tied to volume spikes.
* *ATR Stop*: Suits volatile instruments (commodities, crypto).
* *EMA Trend*: Useful in trending markets (stocks, indices).
* *RSI Confirm*: Adds momentum filter, better for swing trades.
* *Candle Confirm*: Ideal for scalpers needing visual confirmation.
* *Time Filter*: For intraday traders who want signals only in high-liquidity sessions.
Q: What timeframe should I use?
* Intraday traders → 5m to 15m (Time Filter, Candle Confirm).
* Swing traders → 1H to 4H (EMA Trend, RSI Confirm, ATR Stop).
* Position traders → Daily (Prev Day, Bollinger).
* Breakout
A trade entry condition triggered when price crosses above a resistance level (for longs) or below a support level (for shorts).
* Prev Day High/Low
Formula:
Prev High = High of (Day )
Prev Low = Low of (Day )
* Bollinger Bands
Formula:
Basis = SMA(Close, Length)
Upper Band = Basis + (Multiplier × StdDev(Close, Length))
Lower Band = Basis – (Multiplier × StdDev(Close, Length))
* Volume Confirmation
A breakout is only valid if:
Volume > SMA(Volume, Length)
* ATR (Average True Range)
Measures volatility.
Formula:
ATR = SMA(True Range, Length)
where True Range = max(High–Low, |High–Close |, |Low–Close |)
* EMA (Exponential Moving Average)
Weighted moving average giving more weight to recent prices.
Formula:
EMA = (Price × α) + (EMA × (1–α))
with α = 2 / (Length + 1)
* RSI (Relative Strength Index)
Momentum oscillator scaled 0–100.
Formula:
RSI = 100 – (100 / (1 + RS))
where RS = Avg(Gain, Length) ÷ Avg(Loss, Length)
* Candle Confirmation
Bullish candle: Close > Open AND Close > Close
Bearish candle: Close < Open AND Close < Close
Win Rate (%)
Formula:
Win Rate = (Winning Trades ÷ Total Trades) × 100
* Average Trade P&L
Formula:
Avg Trade = Net Profit ÷ Total Trades
📊 Performance Notes
The Universal Breakout Strategy is designed as a framework rather than a single-asset optimized system. Results will vary depending on the chart, timeframe, and asset chosen.
On the current defaults (15-minute, INR-denominated example), the backtest produced 132 trades over the selected period. This provides a statistically sufficient sample size.
Win rate (~35%) is relatively low, but this is balanced by a positive reward-to-risk ratio (~1.8). In practice, a lower win rate with larger wins versus smaller losses is sustainable.
The average P&L per trade is close to breakeven under default settings. This is expected, as the strategy is not tuned for a single symbol but offered as a universal breakout framework.
Commissions (0.1%) and slippage (1 tick) are included in the simulation, ensuring realistic conditions.
Risk management is conservative, with order sizing set at 1 unit per trade. This avoids over-leveraging and keeps exposure well under the 5-10% equity risk guideline.
👉 Traders are encouraged to:
Experiment with inputs such as ATR period, breakout length, or Bollinger parameters.
Test across different timeframes and instruments (equities, futures, forex, crypto) to find optimal setups.
Combine with filters (trend direction, volatility regimes, or volume conditions) for further refinement.
⚠️ Disclaimer This script is provided for educational purposes only.
Past performance does not guarantee future results.
Trading involves risk, and users should exercise caution and use proper risk management when applying this strategy.
Adaptive Machine Learning Trading System [PhenLabs]📊Adaptive ML Trading System
Version: PineScript™v6
📌Description
The Adaptive ML Trading System is a sophisticated machine learning indicator that combines ensemble modeling with advanced technical analysis. This system uses XGBoost, Random Forest, and Neural Network algorithms to generate high-confidence trading signals while incorporating robust risk management features. Traders benefit from objective, data-driven decision-making that adapts to changing market conditions.
🚀Points of Innovation
• Machine Learning Ensemble - Three integrated models (XGBoost, Random Forest, Neural Network)
• Confidence-Based Trading - Only executes trades when ML confidence exceeds threshold
• Dynamic Risk Management - ATR-based stop loss and max drawdown protection
• Adaptive Position Sizing - Volatility-adjusted position sizing with confidence weighting
• Real-Time Performance Metrics - Live tracking of win rate, Sharpe ratio, and performance
• Multi-Timeframe Feature Analysis - Adaptive lookback periods for different market regimes
🔧Core Components
• ML Ensemble Engine - Weighted combination of XGBoost, Random Forest, and Neural Network outputs
• Feature Normalization System - Advanced preprocessing with custom tanh/sigmoid activation
• Risk Management Module - Dynamic position sizing and drawdown protection
• Performance Dashboard - Real-time metrics and risk status monitoring
• Alert System - Comprehensive alert conditions for entries, exits, and risk events
🔥Key Features
• High-confidence ML signals with customizable confidence thresholds
• Multiple trading modes (Conservative, Balanced, Aggressive) for different risk profiles
• Integrated stop loss and risk management with ATR-based calculations
• Real-time performance metrics including win rate and Sharpe ratio
• Comprehensive alert system with entry, exit, and risk management notifications
• Visual confidence bands and threshold indicators for easy signal interpretation
🎨Visualization
• ML Signal Line - Primary signal output ranging from -1 to +1
• Confidence Bands - Visual representation of model confidence levels
• Threshold Lines - Customizable buy/sell threshold levels
• Position Histogram - Current market position visualization
• Performance Tables - Real-time metrics display in customizable positions
📖Usage Guidelines
Model Configuration
• Confidence Threshold: Default 0.55, Range 0.5-0.95 - Minimum confidence for signals
• Model Sensitivity: Default 0.9, Range 0.1-2.0 - Adjusts signal sensitivity
• Ensemble Mode: Conservative/Balanced/Aggressive - Trading style preference
• Signal Threshold: Default 0.55, Range 0.3-0.9 - ML signal threshold for entries
Risk Management
• Position Size %: Default 10%, Range 1-50% - Portfolio percentage per trade
• Max Drawdown %: Default 15%, Range 5-30% - Maximum allowed drawdown
• Stop Loss ATR: Default 2.0, Range 0.5-5.0 - Stop loss in ATR multiples
• Dynamic Sizing: Default true - Volatility-based position adjustment
Display Settings
• Show Signals: Default true - Display entry/exit signals
• Show Threshold Signals: Default true - Display ±0.6 threshold crosses
• Show Confidence Bands: Default true - Display ML confidence levels
• Performance Dashboard: Default true - Show metrics table
✅Best Use Cases
• Swing trading with 1-5 day holding periods
• Trend-following strategies in established trends
• Volatility breakout trading during high-confidence periods
• Risk-adjusted position sizing for portfolio management
• Multi-timeframe confirmation for existing strategies
⚠️Limitations
• Requires sufficient historical data for accurate ML predictions
• May experience low confidence periods in choppy markets
• Performance varies across different asset classes and timeframes
• Not suitable for very short-term scalping strategies
• Requires understanding of basic risk management principles
💡What Makes This Unique
• True machine learning ensemble with multiple model types
• Confidence-based trading rather than simple signal generation
• Integrated risk management with dynamic position sizing
• Real-time performance tracking and metrics
• Adaptive parameters that adjust to market conditions
🔬How It Works
Feature Calculation: Computes 20+ technical features from price/volume data
Feature Normalization: Applies custom normalization for ML compatibility
Ensemble Prediction: Combines XGBoost, Random Forest, and Neural Network outputs
Signal Generation: Produces confidence-weighted trading signals
Risk Management: Applies position sizing and stop loss rules
Execution: Generates alerts and visual signals based on thresholds
💡Note:
This indicator works best on daily and 4-hour timeframes for most assets. Ensure you understand the risk management settings before live trading. The system includes automatic risk-off modes that halt trading during excessive drawdown periods.
SFP + FVG + VWAP Confluence RadarSFP + FVG + VWAP Confluence Radar
Author: @darshakssc
What this script does
This tool is designed to highlight potential institutional-style intraday setups by combining three concepts often used by professional traders:
Swing Failure Patterns (SFPs) – detects confirmed stop-runs at key swing highs/lows
Fair Value Gaps (FVGs) – identifies recent imbalances in price that may act as magnets
VWAP with Bands – session VWAP plus standard deviation bands for intraday structure
A signal is only shown when all three align in confluence.
How to use
BUY setup: downside SFP + a fresh bullish FVG + price near the lower VWAP band
SELL setup: upside SFP + a fresh bearish FVG + price near the upper VWAP band
These signals are confirmation tools and should always be combined with your own market analysis, risk management, and trade plan.
Features
Non-repainting (SFPs confirmed only after pivot bars close)
Works on intraday charts (1m–1h) across indices, FX, crypto, and equities
Optional FVG visualization with auto-expiring boxes
Elegant BUY/SELL labels for clarity
Alerts available for both long and short confluences
Notes & Compliance
Signals are calculated on bar close and do not repaint.
This script is for educational purposes only.
It is not financial advice and does not guarantee performance.
Always test responsibly and manage your own risk.
Session Boxes by NicoG (Real-time - Corrected)Draw the boxes in real time and not at the end of the session.
Liquidity Scalp + SMC + FVG + SL 1% + Max Hold Barstabrez Liquidity Scalp + SMC + FVG + SL 1% + Max Hold Bars
GVZ Sintético (Realized Vol do Ouro)//@version=6
indicator("GVZ Sintético (Realized Vol do Ouro)", overlay=false)
// === INPUTS ===
lookback_days = input.int(30, "Janela (dias)", minval=2)
freq = input.int(252, "Frequência anual", options= )
ma_len = input.int(5, "Suavização (SMA)", minval=1)
// === CÁLCULO VOL REALIZADA ===
src = close
ret = math.log(src / src )
rv_daily = ta.stdev(ret, lookback_days)
rv_annual = rv_daily * math.sqrt(freq)
rv_smooth = ta.sma(rv_annual, ma_len)
// === PLOT ===
plot(rv_smooth * 100, title="GVZ Sintético (%)", linewidth=2, color=color.blue)
hline(10, "10%", color=color.gray)
hline(20, "20%", color=color.gray)
hline(30, "30%", color=color.gray)
Bộ lọc Stoch RSI + MACD + Volume + MFI//@version=6
indicator("Bộ lọc Stoch RSI + MACD + Volume + MFI", overlay=false)
// Input
lenStoch = input.int(14, "Stoch RSI Length")
lenMACD = input.int(12, "MACD Fast Length")
lenSignal = input.int(9, "MACD Signal Length")
lenMFI = input.int(14, "MFI Length")
minVol = input.int(1000000, "Khối lượng tối thiểu")
// Stochastic RSI
k = ta.stoch(close, high, low, lenStoch)
d = ta.sma(k, 3)
// MACD
macd = ta.ema(close, lenMACD) - ta.ema(close, 26)
signal = ta.ema(macd, lenSignal)
// ✅ MFI (chỉ cần volume và length)
mfi = ta.mfi(volume, lenMFI)
// Điều kiện lọc
buyCond = (k < 20 and macd > signal and volume > minVol and mfi > 60)
sellCond = (k > 80 and macd < signal and mfi < 40)
// Xuất tín hiệu
plotchar(buyCond, "BUY", "▲", location=location.bottom, color=color.green, size=size.large)
plotchar(sellCond, "SELL", "▼", location=location.top, color=color.red, size=size.large)
Level Founder indicatorQuesto strumento, ideato per l'individuazione dei livelli orizzontali sensibili si prepone l'obiettivo di semplificare la lettura tecnica dei grafici. Alla base di questo indicatore c'è il concetto di volatilità, inteso come scontro tra domanda ed offerta, come escursione delle forze nel campo di battaglia fino alla determinazione del prezzo finale di ogni candela. Di fatto, andando a cogliere quella che è la volatilità candela per candela, l'indicatore la calcola in termini assoluti rendendola un numericamente comparabile, in un range tra 0 e 100. Quando questo valore tocca i 100 si genera un picco di volatilità, il quale va ad identificare un punto di attenzione sul grafico di uno strumento. In corrispondenza di questi picchi si osserva dove la battaglia tra compratori e venditori si è conclusa, ovvero dove domanda ed offerta si sono incontrati per definire un prezzo: la chiusura di candela. In corrispondenza di tale prezzo si ha, quindi, un accordo certo tra domanda ed offerta dopo un periodo di contrattazione volatile, andando a certificare quello che è un livello di prezzo "sudato" per un determinato sottostante. Tale soglia si traduce in un livello orizzontale sensibile, che in futuro (avendo il mercato memoria degli scontri passati) potrà comportarsi da supporto o da resistenza, a seconda della situazione. In breve quindi, si traccia una linea orizzontale in corrispondenza delle chiusure di candela che condividono un picco sull'indicatore "Level Founder Indicator". Funziona su ogni time-frame e sottostante.
N.B. A ridosso di questi livelli si possono cercare pattern per l'operatività oppure cercare delle rotture di questi livelli per delle conferme/inversioni, spaziando dal trading intraday all'investimento di lungo periodo.
ENGLISH VERSION:
This tool, designed to identify sensitive horizontal levels, aims to simplify the technical reading of charts. This indicator is based on the concept of volatility, understood as the clash between supply and demand, the oscillation of forces on the battlefield until the final price of each candlestick is determined. By capturing the volatility candlestick by candlestick, the indicator calculates it in absolute terms, making it numerically comparable, within a range between 0 and 100. When this value reaches 100, a volatility spike is generated, which identifies a point of focus on an instrument's chart. At these peaks, we observe where the battle between buyers and sellers has concluded, that is, where supply and demand have met to define a price: the candlestick's close. At this price, therefore, a definite agreement between supply and demand occurs after a period of volatile trading, certifying what is a "hard-earned" price level for a given underlying asset. This threshold translates into a sensitive horizontal level, which in the future (given the market's memory of past clashes) could act as support or resistance, depending on the situation. In short, a horizontal line is drawn at the candlestick closes that share a peak on the "Level Founder Indicator." It works on any timeframe and underlying asset.
N.B.: Near these levels, you can look for trading patterns or look for breakouts of these levels for confirmations/reversals, ranging from intraday trading to long-term investing.
AI Agent PRIMEFLOW v1AI Agent PRIMEFLOW v1 — Trend + Breakout + Smart Stops
*By AI Agent Community*
## Overview
PRIMEFLOW v1 is a clean, rules-based signal tool that fires only when **trend + regime + market structure** align.
It combines a **baseline trend**, a **volatility regime filter** (ATR z-score), and **Donchian breakouts**, with **ATR bands** and **Chandelier-style stops** for risk control. Optional **HTF confirmation** keeps entries in sync with higher-timeframe bias.
> Built from public trading concepts (EMA/KAMA/HMA baselines, Donchian breakout, ATR trailing). No proprietary code used.
---
## What it does (3-Layer Confirmation)
1. **Trend** – EMA50/200 relationship + user-selectable baseline (EMA/HMA/KAMA).
2. **Regime** – ATR% z-score filter reduces chop; “Conservative/Balanced/Aggressive” modes adjust threshold.
3. **Structure** – Donchian breakout confirms momentum beyond recent range.
Only when all three align do BUY/SELL labels appear. ATR bands and dynamic stops are plotted for exits and trailing.
---
## Signals & Risk
* **Long**: Trend up (EMA50>EMA200), regime trending, price crosses above baseline **and** breaks the prior Donchian high.
* **Short**: Mirror conditions to the downside.
* **Stops**: Auto-plotted **Long/Short Stop** (ATR-based, Chandelier-style).
* **Targets**: Consider 1.5–2× ATR or ATR bands; keep a runner with trailing stop.
---
## Inputs (key)
* **Signal Mode**: Conservative / Balanced / Aggressive (regime threshold).
* **Use Heikin Ashi Source** (optional smoothing).
* **Structure Lookback (Donchian)**.
* **Volatility Lookback** (for ATR z-score).
* **Baseline Type & Length**: EMA / HMA / KAMA.
* **Trend Filter EMAs**: Fast (default 50) vs Slow (default 200).
* **HTF Confirmation**: set a higher TF (blank = off).
* **ATR Length & Multiplier** (bands & stops).
* **Style toggles**: Bands, regime background, labels.
---
## Recommended Presets
**XAUUSD – M15 (scalping/intraday)**
* Mode: *Balanced* · Baseline: *EMA 50* · Donchian: *20* · ATR: *10 × 2.5* · HTF: *H1*.
**XAUUSD – H1 (intraday)**
* Baseline: *KAMA 50* · Donchian: *25* · ATR: *14 × 2.5* · HTF: *H4*.
**BTCUSDT – H1 (crypto)**
* Baseline: *EMA 100* · Donchian: *30* · ATR: *14 × 2.0* · HTF: *H4* · Mode: *Conservative* in chop.
---
## Alerts (ready)
Create alerts **Once Per Bar Close**:
* **PRIMEFLOW Long** – long entry condition met.
* **PRIMEFLOW Short** – short entry condition met.
* **Trail Flip (Long)** – long trailing stop flips (exit/trim).
* **Trail Flip (Short)** – short trailing stop flips.
Tip: Route alerts to your bot/Telegram/WA webhook. Include placeholders (e.g., `{{ticker}} | {{interval}} | {{close}} | LONG/SHORT | SL: {{plot("Long Stop")}}`).
---
## Best Practices
* Avoid taking breakouts that are **>1.5× ATR** away from baseline (overextended).
* Re-enter on pullbacks while trend & regime remain valid.
* Around high-impact news (NFP/FOMC), wait 15–30 minutes after release.
* Use **HTF 4×** your chart TF (e.g., M15→H1, H1→H4).
---
## Who it’s for
Swing/scalp traders who want higher-quality trend entries with **built-in structure confirmation** and **clear risk lines**, especially on **XAUUSD** and **BTC**.
---
## Notes
* This is an **indicator** (not a strategy). A strategy/backtest version can be provided.
* Educational purposes only. Not financial advice. Trading involves risk.
**Tags:** trend, breakout, ATR, Donchian, chandelier stop, regime filter, XAUUSD, BTC, scalping, intraday, multi-timeframe, heikin ashi
**Changelog**
v1.0 – Initial release: 3-Layer Confirmation, ATR bands/stops, HTF bias, 4 alerts.
Swing Dashboard - Pro Trader Metrics with MTF & Enhanced VolumeDESCRIPTION:
A comprehensive real-time dashboard designed for swing traders and active investors trading US equities. Displays all critical metrics in one customizable panel overlay - no need to clutter your chart with multiple indicators.
KEY FEATURES:
📊 Relative Strength Analysis:
Stock vs Market (SPY/QQQ/IWM/DIA)
Stock vs Sector (automatic sector ETF detection)
Sector vs Market comparison
Customizable lookback period (5-60 days)
📈 Price & Range Metrics:
Daily range, change, and gap percentages
Distance from SMA20, SMA50, VWAP
52-week position percentage
ATR% and ADR% for volatility assessment
Range/ADR ratio for breakout detection
💪 Advanced Volume Analysis:
RVOL (full day volume vs 20-day average)
Volume Strength (bar-by-bar analysis)
Volume Trend (5-day vs 20-day momentum)
Customizable RVOL alert thresholds
Non-repainting volume calculations
⚙️ Multi-Timeframe (MTF) Mode:
View daily charts with 5-min or 15-min metric updates
Perfect for monitoring positions without switching timeframes
All calculations remain accurate across timeframes
🎨 Fully Customizable:
Choose which metrics to display
9 position options for the dashboard
Adjustable text size and colors
Toggle individual metrics on/off
Sector-specific ETF mapping for accurate RS calculations
TECHNICAL SPECIFICATIONS:
✅ Non-repainting - all calculations use confirmed bar data
✅ No lookahead bias or future data
✅ Optimized for US stocks with proper sector mapping
✅ Works on any timeframe (best on 5m-Daily)
✅ Pine Script v6 with best practices
✅ Handles edge cases and missing data gracefully
IDEAL FOR:
Swing traders monitoring multiple positions
Day traders needing quick metric overview
Investors tracking relative strength and momentum
Anyone who wants institutional-grade metrics in one place
SECTOR ETF MAPPING:
Automatically maps to correct sector ETFs: XLK, XLF, XLV, XLY, XLP, XLE, XLB, XLI, XLRE, XLC, XLU
HOW TO USE:
Green = Positive/Strong | Red = Negative/Weak | White = Neutral
RS > 0 = Outperforming benchmark/sector
RVOL > 1.5x = High volume day
VWAP% negative = Price below VWAP (mean reversion opportunity)
R/ADR > 100% = Extended range (potential exhaustion)
Perfect for traders who need professional-grade analysis without chart clutter.
TAGS:
dashboard, swing, relativestrengrh, sectoranalysis, volume, rvol, multitimeframe, mtf, tradingdashboard, metrics, daytrading, swingtrading, momentum, vwap, atr, volatility, volumeanalysis
RSI Divergence (CompactFX)You can now display divergences in the RSI.
In addition, the following features have been added:
- You can change the color of the RSI value when it crosses 50.
- You can display pivots for any period.
- You can display RSI for higher or lower time frames.
- You can change the color of various parts of the chart, so you can customize it to your liking and avoid boring charts.
Range Stats DashboardShows Range from last 5 days and tracks todays range to.
Let me know of any ideas or anything.
Mongoose Compass v2 — Regime & Position SizingWhat it does
Mongoose Compass v2 is a regime‐detection dashboard and optional price-chart ribbon. It combines four market “pillars” into a 0–4 score and a suggested equity beta/position size. It is scale-independent and works on any host symbol.
Pillars (green = expansion supportive):
RS IWM/SPY – small-cap relative strength vs large caps
Credit HYG/LQD – high-yield vs investment-grade credit
Growth Cu/Au – copper vs gold (cyclical demand vs safety)
Participation – uses the first available of:
Breadth (% > 200-DMA) if you provide a symbol, else
Cboe S&P 500 Dispersion (DSPX), else
RSP/SPY equal-weight proxy
Score (0–4):
≥ 3 = Expansion
2 = Neutral
≤ 1 = Contraction
A panel shows each pillar’s normalized value (0–100), bias, total score, and a suggested size (default mapping: 0/30/60/90/100% for scores 0–4). The companion “Ribbon” script paints the price chart background by regime and displays the suggested size.
How to use
Timeframes
Weekly for regime calls (recommended anchor).
Daily for execution within the active regime (adds, trims, hedges).
Playbook
Expansion (score ≥ 3): increase risk/beta; favor cyclicals, small caps, EM; reduce hedges.
Neutral (score = 2): keep moderate beta; use relative value (e.g., quality/mega vs small caps) until RS or Cu/Au turns.
Contraction (score ≤ 1): de-risk; rotate to defensives/quality, gold/long duration; add hedges.
Alerts (included):
Expansion Regime (score ≥ 3) – risk-on trigger
Contraction Regime (score ≤ 1) – risk-off trigger
Methodology
Prices are pulled with request.security on the chosen timeframe.
Pillars are built from ratios then smoothed with an SMA (Smoothing Length, default 20).
For display/comparison, series are normalized to 0–100 within a rolling window (Normalization Length, default 60).
Bias rules:
RS / Credit / Growth: fast SMA( len ) vs slow SMA( len*2 ) of each ratio
Breadth: normalized value > 60
DSPX: normalized value < 40 (lower dispersion supports index coherence)
RSP/SPY proxy: fast > slow trend test
Score is the count of green pillars (0–4).
Suggested size is a deterministic mapping from score (editable in settings).
Notes:
Host chart scaling (log vs linear) does not affect calculations.
If a breadth series is unavailable, the script automatically falls back to DSPX, then to RSP/SPY.
Settings
Sources
Default inputs use liquid ETFs (BATS/AMEX). You may switch Copper/Gold to futures (e.g., COMEX_DL:HG1!, COMEX_DL:GC1!) if your data plan supports them.
Optional Breadth: paste a percent-above-MA series if you have one.
DSPX: uses CBOE:DSPX when breadth is blank.
If neither breadth nor DSPX resolve, the script uses RSP/SPY as a participation proxy.
Calculation
Smoothing Length (20) – higher = steadier regime, fewer flips; lower = faster reaction.
Normalization Length (60) – window for the 0–100 scaling; increase to reduce pinning at extremes.
Regime Timeframe (Ribbon only) – lock the ribbon to Weekly while viewing Daily charts.
Visual
Show/hide dashboard table, choose table position, dark/light theme, ribbon opacity.
Recommended usage
Anchor decisions on Weekly Compass; use Daily for timing.
For small-cap rotation, apply on IWM/RTY; for broad beta, use SPY/ES. Output is identical regardless of host symbol because inputs are fetched internally.
Limitations & disclaimer
This is a systematic information tool, not investment advice.
Signals can whipsaw in fast markets; confirm with your risk framework.
Data availability varies by plan (especially futures and DSPX). When a source is unavailable the scripted fallbacks apply automatically.
3Bars [TheAlphaGroup]3Bars Setup (Original by. Larry Williams)
The “3Bars” is a classic setup from Larry Williams, designed to capture short-term reversals within a larger trend. It uses very simple ingredients: moving averages of the highs and lows.
How It Works
Bands Calculation
– A short moving average (default = 3) is applied separately to the Highs and to the Lows.
– The average of the Lows forms the lower band .
– The average of the Highs forms the upper band .
Trade Logic
– In an uptrend (price above a longer MA, default = 21 EMA or SMA), the system looks for longs.
• Entry: Buy at the lower band.
• Exit: Sell at the upper band.
– In a downtrend (price below the 21 EMA/SMA), the system looks for shorts.
• Entry: Sell at the upper band.
• Exit: Cover at the lower band.
Safety Net
– If the trade doesn’t hit its band exit, it is force-closed after X bars (default = 7).
– Users can select SMA or EMA for both the bands and the trend filter.
– Direction can be toggled: Long only, Short only, or Both.
Why It’s Interesting
The method tries to ride the market “channel” between recent highs and lows.
It doesn’t chase breakouts, it waits for price to pull back into a band before positioning.
It’s rule-based and mechanical, which makes it easy to test and automate.
Disclaimer
This script is for educational and research purposes only .
It is not financial advice and does not guarantee profitability.
Always backtest on multiple markets and timeframes, and use proper risk management.
About the Yellow Warning Box
“Caution! This strategy may use look-ahead bias…”
Note: The warning shows because Pine doesn’t “trust” limit orders that are priced with data from completed bars. The current version is already safe (no repaint/look-ahead) , but TradingView cannot automatically confirm that.
To silence the warning, you’d need to shift all logic by one more bar ( ) or use market orders. But that sacrifices realism.
If you care about accurate band-based fills more than the warning box, it is safe to ignore it.
Atlantean Sideways / Range Regime DetectorPurpose
Flags likely sideways/range phases using three checks:
Weak trend (ADX from DMI)
Price compression (Bollinger Band Width, normalized)
Low volatility (NATR = ATR/Price%)
Logic
isSideways = (ADX < adxThresh) AND (bbNorm < 0.25) AND (NATR < natrMax)
When true: bars + background turn teal and a provisional Range High/Low (rolling rangeWin) is drawn.
Key Inputs
DMI: diLen(22)
ADX: adxSmooth(14), adxThresh(18)
Volatility: lenATR(14), natrMax(1.8)
Visuals: rangeWin(20), bar/range toggles
Quick Tuning
More signals: raise adxThresh to 20–25, raise natrMax to 2.5–4.0, increase BB cutoff by editing bbNorm < 0.25 --> 0.35–0.50.
Smoother range lines: increase rangeWin to 30–40.
Use Cases
Mean reversion inside teal ranges.
Breakout prep when price closes outside the drawn range after teal ends. Could be used as a signal although not suggested.
Filter trend systems: skip trades when sidewaysCond is true. This is the main purpose, for it to be combined with trend based indicators, like Supertrend.
Alert
“Sideways Detected” triggers when isSideways is true.
Script could be expanded upon your requests.
EMA Crossoverx + ADX [Jamir] (Indicator)This indicator will avoid the signals during low volatility and will show the signals only when there is a volatility. Helps you to take profitable trades only and avoids noise. This script works good on 5 mins and 15 mins time frame.
Harry Dunn Volatility BandsEnter strike price and 2 percentage numbers to automatically calculate and draw volatility bands on chart.
Fair Value Gap [LuxAlgo] With ANY alert// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
// creativecommons.org
// © LuxAlgo
//@version=5
indicator("Fair Value Gap ", "LuxAlgo - Fair Value Gap", overlay = true, max_lines_count = 500, max_boxes_count = 500)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
thresholdPer = input.float(0, "Threshold %", minval = 0, maxval = 100, step = .1, inline = 'threshold')
auto = input(false, "Auto", inline = 'threshold')
showLast = input.int(0, 'Unmitigated Levels', minval = 0)
mitigationLevels = input.bool(false, 'Mitigation Levels')
tf = input.timeframe('', "Timeframe")
//Style
extend = input.int(20, 'Extend', minval = 0, inline = 'extend', group = 'Style')
dynamic = input(false, 'Dynamic', inline = 'extend', group = 'Style')
bullCss = input.color(color.new(#089981, 70), "Bullish FVG", group = 'Style')
bearCss = input.color(color.new(#f23645, 70), "Bearish FVG", group = 'Style')
//Dashboard
showDash = input(false, 'Show Dashboard', group = 'Dashboard')
dashLoc = input.string('Top Right', 'Location', options = , group = 'Dashboard')
textSize = input.string('Small', 'Size' , options = , group = 'Dashboard')
//-----------------------------------------------------------------------------}
//UDT's
//-----------------------------------------------------------------------------{
type fvg
float max
float min
bool isbull
int t = time
//-----------------------------------------------------------------------------}
//Methods/Functions
//-----------------------------------------------------------------------------{
n = bar_index
method tosolid(color id)=> color.rgb(color.r(id),color.g(id),color.b(id))
detect()=>
var new_fvg = fvg.new(na, na, na, na)
threshold = auto ? ta.cum((high - low) / low) / bar_index : thresholdPer / 100
bull_fvg = low > high and close > high and (low - high ) / high > threshold
bear_fvg = high < low and close < low and (low - high) / high > threshold
if bull_fvg
new_fvg := fvg.new(low, high , true)
else if bear_fvg
new_fvg := fvg.new(low , high, false)
//-----------------------------------------------------------------------------}
//FVG's detection/display
//-----------------------------------------------------------------------------{
var float max_bull_fvg = na, var float min_bull_fvg = na, var bull_count = 0, var bull_mitigated = 0
var float max_bear_fvg = na, var float min_bear_fvg = na, var bear_count = 0, var bear_mitigated = 0
var t = 0
var fvg_records = array.new(0)
var fvg_areas = array.new(0)
= request.security(syminfo.tickerid, tf, detect())
//Bull FVG's
if bull_fvg and new_fvg.t != t
if dynamic
max_bull_fvg := new_fvg.max
min_bull_fvg := new_fvg.min
//Populate FVG array
if not dynamic
fvg_areas.unshift(box.new(n-2, new_fvg.max, n+extend, new_fvg.min, na, bgcolor = bullCss))
fvg_records.unshift(new_fvg)
bull_count += 1
t := new_fvg.t
else if dynamic
max_bull_fvg := math.max(math.min(close, max_bull_fvg), min_bull_fvg)
//Bear FVG's
if bear_fvg and new_fvg.t != t
if dynamic
max_bear_fvg := new_fvg.max
min_bear_fvg := new_fvg.min
//Populate FVG array
if not dynamic
fvg_areas.unshift(box.new(n-2, new_fvg.max, n+extend, new_fvg.min, na, bgcolor = bearCss))
fvg_records.unshift(new_fvg)
bear_count += 1
t := new_fvg.t
else if dynamic
min_bear_fvg := math.min(math.max(close, min_bear_fvg), max_bear_fvg)
//-----------------------------------------------------------------------------}
//Unmitigated/Mitigated lines
//-----------------------------------------------------------------------------{
if fvg_records.size() > 0
for i = fvg_records.size()-1 to 0
get = fvg_records.get(i)
if get.isbull
if close < get.min
if mitigationLevels
line.new(get.t, get.min, time, get.min, xloc.bar_time, color = bullCss, style = line.style_dashed)
if not dynamic
area = fvg_areas.remove(i)
area.delete()
fvg_records.remove(i)
bull_mitigated += 1
else if close > get.max
if mitigationLevels
line.new(get.t, get.max, time, get.max, xloc.bar_time, color = bearCss, style = line.style_dashed)
if not dynamic
area = fvg_areas.remove(i)
area.delete()
fvg_records.remove(i)
bear_mitigated += 1
//Unmitigated lines
var unmitigated = array.new(0)
//Remove umitigated lines
if barstate.islast and showLast > 0 and fvg_records.size() > 0
if unmitigated.size() > 0
for element in unmitigated
element.delete()
unmitigated.clear()
for i = 0 to math.min(showLast-1, fvg_records.size()-1)
get = fvg_records.get(i)
unmitigated.push(line.new(get.t, get.isbull ? get.min : get.max, time, get.isbull ? get.min : get.max, xloc.bar_time, color = get.isbull ? bullCss : bearCss))
//-----------------------------------------------------------------------------}
//Dashboard
//-----------------------------------------------------------------------------{
var table_position = dashLoc == 'Bottom Left' ? position.bottom_left
: dashLoc == 'Top Right' ? position.top_right
: position.bottom_right
var table_size = textSize == 'Tiny' ? size.tiny
: textSize == 'Small' ? size.small
: size.normal
var tb = table.new(table_position, 3, 3, bgcolor = #1e222d, border_color = #373a46, border_width = 1, frame_color = #373a46, frame_width = 1)
if showDash
if barstate.isfirst
tb.cell(1, 0, 'Bullish', text_color = bullCss.tosolid(), text_size = table_size)
tb.cell(2, 0, 'Bearish', text_color = bearCss.tosolid(), text_size = table_size)
tb.cell(0, 1, 'Count', text_size = table_size, text_color = color.white)
tb.cell(0, 2, 'Mitigated', text_size = table_size, text_color = color.white)
if barstate.islast
tb.cell(1, 1, str.tostring(bull_count), text_color = bullCss.tosolid(), text_size = table_size)
tb.cell(2, 1, str.tostring(bear_count), text_color = bearCss.tosolid(), text_size = table_size)
tb.cell(1, 2, str.tostring(bull_mitigated / bull_count * 100, format.percent), text_color = bullCss.tosolid(), text_size = table_size)
tb.cell(2, 2, str.tostring(bear_mitigated / bear_count * 100, format.percent), text_color = bearCss.tosolid(), text_size = table_size)
//-----------------------------------------------------------------------------}
//Plots
//-----------------------------------------------------------------------------{
max_bull_plot = plot(max_bull_fvg, color = na)
min_bull_plot = plot(min_bull_fvg, color = na)
fill(max_bull_plot, min_bull_plot, color = bullCss)
max_bear_plot = plot(max_bear_fvg, color = na)
min_bear_plot = plot(min_bear_fvg, color = na)
fill(max_bear_plot, min_bear_plot, color = bearCss)
//-----------------------------------------------------------------------------}
//Alerts
//-----------------------------------------------------------------------------{
alertcondition(bull_count > bull_count , 'Bullish FVG', 'Bullish FVG detected')
alertcondition(bear_count > bear_count , 'Bearish FVG', 'Bearish FVG detected')
alertcondition(bull_mitigated > bull_mitigated , 'Bullish FVG Mitigation', 'Bullish FVG mitigated')
alertcondition(bear_mitigated > bear_mitigated , 'Bearish FVG Mitigation', 'Bearish FVG mitigated')
// ✅ New ANY alert (bullish OR bearish)
alertcondition((bull_count > bull_count ) or (bear_count > bear_count ), 'ANY FVG', 'Bullish OR Bearish FVG detected')
//-----------------------------------------------------------------------------}
Signal Core Basic [NevoxCore]⯁ OVERVIEW
Signal Core Basic is a clean and functional ATR-based trailing stop with BUY/SELL signals.
It modernizes the classic "UT-style" concept with adaptive sensitivity, multi-source inputs (Close, Heikin-Ashi, ZLEMA, KAMA), and compact visuals.
The tool is designed for traders who want a clear, minimal, and reliable base indicator without repainting issues.
⯁ HOW IT WORKS
Calculates an ATR-based trailing stop (nLoss = Key × ATR).
Adaptive mode scales sensitivity depending on trend strength (trend/range detection).
Trailing stop flips when price crosses from one regime to the other.
BUY/SELL signals trigger only when confirmed and not blocked by cooldown.
Label ring-buffer ensures chart stays clean (max 50 labels).
Bar coloring optional (solid), auto-disabled when classic red/green colors are enabled.
⯁ KEY FEATURES
ATR-based trailing stop with adjustable sensitivity.
Adaptive key (trend/range aware).
Multiple compute sources: Close, Heikin-Ashi, ZLEMA, KAMA.
Global confirm-on-close switch (no repaint).
Early-flip protection (cooldown).
Compact BUY/SELL labels with auto-cleanup (max 50).
Optional solid bar coloring.
Alerts with ticker, timeframe, and price included.
⯁ SETTINGS (quick overview)
Visual: Classic Colors, Show Labels, Plot Trailing Stop, Barcolor ON/OFF.
Source & Sensitivity: Key Value, ATR Length, Compute Source.
Advanced: Adaptive Key toggle with min/max bounds.
Global: Confirm on bar close.
Extras: Cooldown protection (bars).
⯁ ALERTS (built-in)
Basic Long: BUY signal.
Basic Short: SELL signal.
Each alert includes {{ticker}} {{interval}} @ {{close}}.
⯁ HOW TO USE
Use as a trailing stop and regime filter.
Combine BUY/SELL signals with your strategy rules.
Enable cooldown for cleaner signals in choppy markets.
Try ZLEMA or Heikin-Ashi as compute source for smoother performance.
⯁ WHY IT’S DIFFERENT
Unlike generic UT-style scripts, Signal Core Basic adds adaptive sensitivity, multiple input sources, and strict non-repaint safety.
The visuals follow NevoxCore’s design standards: compact, minimal, and clean — ready for live trading with alerts.
⯁ DISCLAIMER
Backtest and paper-trade before using live. Not financial advice.
Performance depends on market, timeframe, and parameters.
Historical VolatilityHistorical Volatility Indicator with Custom Trading Sessions
Overview
This indicator calculates **annualized Historical Volatility (HV)** using logarithmic returns and standard deviation. Unlike standard HV indicators, this version allows you to **customize trading sessions and holidays** for different markets, ensuring accurate volatility calculations for options pricing and risk management.
Key Features
✅ Custom Trading Sessions - Define multiple trading sessions per day with precise start/end times
✅ Multiple Markets Support - Pre-configured for US, Russian, European, and crypto markets
✅ Clearing Periods Handling - Account for intraday clearing breaks
✅ Flexible Calendar - Set trading days per year for different countries
✅ All Timeframes - Works correctly on intraday, daily, weekly, and monthly charts
✅ Info Table - Optional display showing calculation parameters
How It Works
The indicator uses the classical volatility formula:
σ_annual = σ_period × √(periods per year)
Where:
- σ_period = Standard deviation of logarithmic returns over the specified period
- Periods per year = Calculated based on actual trading time (not calendar time)
Calculation Method
1. Computes log returns: ln(close / close )
2. Calculates standard deviation over the lookback period
3. Annualizes using the square root rule with accurate period count
4. Displays as percentage
Settings
Calculation
- Period (default: 10) - Lookback period for volatility calculation
Trading Schedule
- Trading Days Per Year (default: 252) - Number of actual trading days
- USA: 252
- Russia: 247-250
- Europe: 250-253
- Crypto (24/7): 365
- Trading Sessions - Define trading hours in format: `hh:mm:ss-hh:mm:ss, hh:mm:ss-hh:mm:ss`
Display
- Show Info Table - Shows calculation parameters in real-time
Market Presets
United States (NYSE/NASDAQ)
Trading Sessions: 09:30:00-16:00:00
Trading Days Per Year: 252
Trading Minutes Per Day: 390
Russia (MOEX)
Trading Sessions: 10:00:00-14:00:00, 14:05:00-18:40:00
Trading Days Per Year: 248
Trading Minutes Per Day: 515
Europe (LSE)
Trading Sessions: 08:00:00-16:30:00
Trading Days Per Year: 252
Trading Minutes Per Day: 510
Germany (XETRA)
Trading Sessions: 09:00:00-17:30:00
Trading Days Per Year: 252
Trading Minutes Per Day: 510
Cryptocurrency (24/7)
Trading Sessions: 00:00:00-23:59:59
Trading Days Per Year: 365
Trading Minutes Per Day: 1440
Use Cases
Options Trading
- Compare HV vs IV - Historical volatility compared to implied volatility helps identify mispriced options
- Volatility mean reversion - Identify when volatility is unusually high or low
- Straddle/strangle selection - Choose optimal strikes based on historical movement
Risk Management
- Position sizing - Adjust position size based on current volatility
- Stop-loss placement - Set stops based on expected price movement
- Portfolio volatility - Monitor individual asset volatility contribution
Market Analysis
- Regime identification - Detect transitions between low and high volatility environments
- Cross-market comparison - Compare volatility across different assets and markets
Why Accurate Trading Hours Matter
Standard HV indicators assume 24-hour trading or use simplified day counts, leading to significant errors in annualized volatility:
- 5-minute chart error : Can be off by 50%+ if using wrong period count
- Options pricing impact : Even 2-3% HV error affects option values substantially
- Intraday vs overnight : Correctly excludes non-trading periods
This indicator ensures your HV calculations match the methodology used in professional options pricing models.
Technical Notes
- Uses actual trading minutes, not calendar days
- Handles multiple clearing periods within a single trading day
- Properly scales volatility across all timeframes
- Logarithmic returns for more accurate volatility measurement
- Compatible with Pine Script v6
Author Notes: This indicator was designed specifically for options traders who need precise volatility measurements across different global markets. The customizable trading sessions ensure your HV calculations align with actual market hours and industry-standard options pricing models.