SMC N-Gram Probability Matrix [PhenLabs]📊 SMC N-Gram Probability Matrix
Version: PineScript™ v6
📌 Description
The SMC N-Gram Probability Matrix applies computational linguistics methodology to Smart Money Concepts trading. By treating SMC patterns as a discrete “alphabet” and analyzing their sequential relationships through N-gram modeling, this indicator calculates the statistical probability of which pattern will appear next based on historical transitions.
Traditional SMC analysis is reactive—traders identify patterns after they form and then anticipate the next move. This indicator inverts that approach by building a transition probability matrix from up to 5,000 bars of pattern history, enabling traders to see which SMC formations most frequently follow their current market sequence.
The indicator detects and classifies 11 distinct SMC patterns including Fair Value Gaps, Order Blocks, Liquidity Sweeps, Break of Structure, and Change of Character in both bullish and bearish variants, then tracks how these patterns transition from one to another over time.
🚀 Points of Innovation
First indicator to apply N-gram sequence modeling from computational linguistics to SMC pattern analysis
Dynamic transition matrix rebuilds every 50 bars for adaptive probability calculations
Supports bigram (2), trigram (3), and quadgram (4) sequence lengths for varying analysis depth
Priority-based pattern classification ensures higher-significance patterns (CHoCH, BOS) take precedence
Configurable minimum occurrence threshold filters out statistically insignificant predictions
Real-time probability visualization with graphical confidence bars
🔧 Core Components
Pattern Alphabet System: 11 discrete SMC patterns encoded as integers for efficient matrix indexing and transition tracking
Swing Point Detection: Uses ta.pivothigh/pivotlow with configurable sensitivity for non-repainting structure identification
Transition Count Matrix: Flattened array storing occurrence counts for all possible pattern sequence transitions
Context Encoder: Converts N-gram pattern sequences into unique integer IDs for matrix lookup
Probability Calculator: Transforms raw transition counts into percentage probabilities for each possible next pattern
🔥 Key Features
Multi-Pattern SMC Detection: Simultaneously identifies FVGs, Order Blocks, Liquidity Sweeps, BOS, and CHoCH formations
Adjustable N-Gram Length: Choose between 2-4 pattern sequences to balance specificity against sample size
Flexible Lookback Range: Analyze anywhere from 100 to 5,000 historical bars for matrix construction
Pattern Toggle Controls: Enable or disable individual SMC pattern types to customize analysis focus
Probability Threshold Filtering: Set minimum occurrence requirements to ensure prediction reliability
Alert Integration: Built-in alert conditions trigger when high-probability predictions emerge
🎨 Visualization
Probability Table: Displays current pattern, recent sequence, sample count, and top N predicted patterns with percentage probabilities
Graphical Probability Bars: Visual bar representation (█░) showing relative probability strength at a glance
Chart Pattern Markers: Color-coded labels placed directly on price bars identifying detected SMC formations
Pattern Short Codes: Compact notation (F+, F-, O+, O-, L↑, L↓, B+, B-, C+, C-) for quick pattern identification
Customizable Table Position: Place probability display in any corner of your chart
📖 Usage Guidelines
N-Gram Configuration
N-Gram Length: Default 2, Range 2-4. Lower values provide more samples but less specificity. Higher values capture complex sequences but require more historical data.
Matrix Lookback Bars: Default 500, Range 100-5000. More bars increase statistical significance but may include outdated market behavior.
Min Occurrences for Prediction: Default 2, Range 1-10. Higher values filter noise but may reduce prediction availability.
SMC Detection Settings
Swing Detection Length: Default 5, Range 2-20. Controls pivot sensitivity for structure analysis.
FVG Minimum Size: Default 0.1%, Range 0.01-2.0%. Filters insignificant gaps.
Order Block Lookback: Default 10, Range 3-30. Bars to search for OB formations.
Liquidity Sweep Threshold: Default 0.3%, Range 0.05-1.0%. Minimum wick extension beyond swing points.
Display Settings
Show Probability Table: Toggle the probability matrix display on/off.
Show Top N Probabilities: Default 5, Range 3-10. Number of predicted patterns to display.
Show SMC Markers: Toggle on-chart pattern labels.
✅ Best Use Cases
Anticipating continuation or reversal patterns after liquidity sweeps
Identifying high-probability BOS/CHoCH sequences for trend trading
Filtering FVG and Order Block signals based on historical follow-through rates
Building confluence by comparing predicted patterns with other technical analysis
Studying how SMC patterns typically sequence on specific instruments or timeframes
⚠️ Limitations
Predictions are based solely on historical pattern frequency and do not account for fundamental factors
Low sample counts produce unreliable probabilities—always check the Samples display
Market regime changes can invalidate historical transition patterns
The indicator requires sufficient historical data to build meaningful probability matrices
Pattern detection uses standardized parameters that may not capture all institutional activity
💡 What Makes This Unique
Linguistic Modeling Applied to Markets: Treats SMC patterns like words in a language, analyzing how they “flow” together
Quantified Pattern Relationships: Transforms subjective SMC analysis into objective probability percentages
Adaptive Learning: Matrix rebuilds periodically to incorporate recent pattern behavior
Comprehensive SMC Coverage: Tracks all major Smart Money Concepts in a unified probability framework
🔬 How It Works
1. Pattern Detection Phase
Each bar is analyzed for SMC formations using configurable detection parameters
A priority hierarchy assigns the most significant pattern when multiple detections occur
2. Sequence Encoding Phase
Detected patterns are stored in a rolling history buffer of recent classifications
The current N-gram context is encoded into a unique integer identifier
3. Matrix Construction Phase
Historical pattern sequences are iterated to count transition occurrences
Each context-to-next-pattern transition increments the appropriate matrix cell
4. Probability Calculation Phase
Current context ID retrieves corresponding transition counts from the matrix
Raw counts are converted to percentages based on total context occurrences
5. Visualization Phase
Probabilities are sorted and the top N predictions are displayed in the table
Chart markers identify the current detected pattern for visual reference
💡 Note:
This indicator performs best when used as a confluence tool alongside traditional SMC analysis. The probability predictions highlight statistically common pattern sequences but should not be used as standalone trading signals. Always verify predictions against price action context, higher timeframe structure, and your overall trading plan. Monitor the sample count to ensure predictions are based on adequate historical data.
Indicators and strategies
Algo & Dark Pool Activity - Find Hidden LiquidityThe script is designed to highlight potential algorithmic buying pressure and dark pool accumulation proxies on a TradingView chart. It overlays signals directly on price bars so you can visually spot when unusual activity may be occurring.
Smart Money Concepts [MHA Finverse]A comprehensive Smart Money Concepts (SMC) indicator designed to identify institutional trading behavior and market structure shifts. This tool helps traders align with "smart money" by detecting key supply and demand zones, structural breaks, and liquidity patterns.
Core Features
Market Structure Analysis
- Real-time Internal Structure: Detects short-term BOS (Break of Structure) and CHoCH (Change of Character) with customizable filters
- Swing Structure: Identifies major trend shifts and structural breaks on higher timeframes
- Adjustable pivot detection with customizable swing point visualization
- Strong/Weak High/Low identification for bias confirmation
Order Blocks (OB)
- Internal and Swing Order Blocks with independent control
- Volume-based metrics showing OB strength and percentage contribution
- Two filtering methods: ATR-based and Cumulative Mean Range
- Flexible mitigation options (Close or High/Low)
- Display up to 20 order blocks per type with auto-cleanup on mitigation
- Color-coded zones with transparency control
Liquidity Detection
- Equal Highs (EQH) and Equal Lows (EQL) identification
- Threshold-based detection using ATR calculation
- Visual confirmation lines connecting equal levels
- Adjustable sensitivity and bar confirmation settings
Fair Value Gaps (FVG)
- Multi-timeframe FVG detection
- Auto-threshold calculation based on price momentum
- Bullish and Bearish gap visualization
- Extendable gap boxes for tracking unfilled imbalances
Premium & Discount Zones
- Automated premium, equilibrium, and discount zone plotting
- Based on current swing range extremes
- Visual representation of optimal entry zones
- Helps identify potential reversal and continuation areas
Multi-Timeframe Levels
- Previous Daily, Weekly, and Monthly High/Low levels
- Customizable line styles (solid, dashed, dotted)
- Independent color controls for each timeframe
- Auto-adjusted labels (PDH, PDL, PWH, PWL, PMH, PML)
Display Modes
- Historical Mode: Shows all past structures and maintains drawing history
- Present Mode: Displays only current active structures for cleaner charts
Visual Themes
- Colored: Full color customization for all elements
- Monochrome: Clean grey-scale design for minimal distraction
Smart Features
- Confluence filter for internal structure to reduce noise
- Automatic candle coloring based on market bias
- 16 pre-configured alert conditions for all major signals
- Efficient rendering with automatic cleanup of broken structures
- Independent control over each feature for modular usage
Use Cases
- Identify institutional entry and exit points through order blocks
- Spot potential reversals at premium/discount zones
- Confirm trend direction with BOS and CHoCH signals
- Find liquidity grabs at equal highs and lows
- Trade imbalances at fair value gaps
- Align entries with multi-timeframe key levels
Settings Organization
All features are neatly organized into logical groups:
- Smart Money Concepts (general settings)
- Real Time Internal Structure
- Real Time Swing Structure
- Order Blocks
- EQH/EQL
- Fair Value Gaps
- Highs & Lows MTF
- Premium & Discount Zones
Note: This indicator works on all timeframes and instruments. For optimal results, combine multiple SMC concepts together to find high-probability setups with confluence.
Credits
Special thanks to Dau_tu_hieu_goc and BigBeluga for their code examples and inspiration that contributed to the development of this indicator.
Disclaimer
This indicator is for educational purposes only and does not constitute financial advice. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and conduct your own analysis before making trading decisions. The developer is not responsible for any trading losses incurred.
Happy Trading
Tamil | Trend Signal Dashboard for trading“Tamil | Trend Signal in Dashboard” is a multi-confirmation trend and signal tool that combines Supertrend, RSI/ADX trend strength, and dual QQE into one clean dashboard on the chart. It only prints STRONG BUY / STRONG SELL when all components align, and it also gives clear, rule-based exit signals.
⸻
What it uses
• RSI + ADX + ATR trend block
• ADX (with custom length & threshold) to measure trend strength
• +DI / –DI to define bullish or bearish direction
• Optional session filter so signals only appear in your trading window
• Custom Supertrend
• ATR-based bands with adjustable period & multiplier
• Plots trend line on chart and shows Buy/Sell flip labels when Supertrend reverses
• Dual QQE MOD engine
• Two QQE/RSI streams (primary & secondary)
• Bollinger bands around QQE line to confirm true momentum breakouts
• Defines QQE Bullish / Bearish states
• Secondary RSI Histogram logic
• Tracks RSI distance from the 50 line
• Detects “peak & decline” on the histogram for momentum-based exits
⸻
Signals & Exits
• Entry
• Strong Buy: Supertrend bullish + strong ADX + DI bullish + QQE bullish
• Strong Sell: Supertrend bearish + strong ADX + DI bearish + QQE bearish
• Background is softly colored green/red while alignment is active
• Exit (configurable)
• Alignment lost (trend components no longer agree), and/or
• First peak-and-decline in the secondary RSI histogram
• Shows Exit Buy / Exit Sell markers and fires dedicated alerts
⸻
Dashboard & Alerts
A compact table in the top-right shows live status of:
• Supertrend
• ADX value & strength check
• Direction from DI
• QQE state
• Secondary RSI histogram slope
• Overall Alignment and current Signal (Hold / Strong Buy / Strong Sell / Exit)
Session Fibonacci Tracker with Dynamic Range FreezeSession Fibonacci Tracker with Dynamic Range Freeze
This indicator plots Fibonacci retracement and extension levels based on session high/low ranges with a unique "freeze" mechanism that locks levels during volatility and recalculates only when price returns to the established range.
How It Works:
The indicator uses a three-stage process to maintain stable Fibonacci levels:
Range Establishment: At the start of each session (default 1800 ET), the indicator tracks the session high and low. Fibonacci levels are calculated with dynamic anchoring - when price is above the session open, 0 anchors at the high with 1 at the low; when below, 0 anchors at the low with 1 at the high.
Freeze Mechanism: Once the range is established, it immediately freezes. If a candle closes outside this range, the Fibonacci levels remain locked at their current values even as new session highs or lows form. This prevents levels from constantly recalculating during trending moves.
Recalculation: The frozen range only updates when price action (high or low) touches back inside the established range. At this point, levels recalculate based on the current session high/low, then freeze again.
Key Features:
Customizable Fibonacci levels: All retracement (0.236, 0.382, 0.500, 0.618, 0.786) and extension levels (-1.0, -0.618, -0.272, 1.272, 1.618, 2.0) can be enabled/disabled and adjusted to custom values
Time-based line extension prevents historical buffer overflow errors
Works across all timeframes
Session start time fully customizable
Visual status indicator shows whether levels are frozen or active
All lines and labels are fully customizable (colors, width, labels, prices)
Use Cases:
This indicator is particularly useful for traders who want stable reference levels during volatile periods. Traditional Fibonacci tools recalculate with every new extreme, making them difficult to use as support/resistance during trends. This implementation keeps levels stable until price returns to consolidation, providing consistent reference points for entries, exits, and stop placement.
Settings:
Session Settings: Configure session start time (default 1800 ET)
Fibonacci Levels: Enable/disable and customize each retracement level value
Extension Levels: Enable/disable and customize each extension level value
Visual Settings: Adjust line extension, width, labels, and price display
Colors: Customize colors for open line, 0 level, 1 level, retracements, and extensions
Volume Orderblock Breakout — Naaganeunja Lite v3.6Volume orderblocks breakout indicator
you can use it 5minutes (short trading)
or 4 hours(swing trading)
it is best indicator in the world
🐋 MACRO POSITION TRADER - Quarterly Alignment 💎Disclaimer: This tool is an alignment filter and educational resource, not financial advice. Backtest and use proper risk management. Past performance does not guarantee future returns.
so the idea behind this one came from an experience i had when i first started learning how to trade. dont laugh at me but i was the guy to buy into those stupid AI get rich quick schemes or the first person to buy the "golden indicator" just to find out that it was a scam. Its also to help traders place trades they can hold for months with high confidence and not have to sit in front of charts all day, and to also scale up quickly with small accounts confidently. and basically what it does is gives an alert once the 3 mo the 6 mo and the 12 mo tfs all align with eachother and gives the option to toggle on or off the 1 mo tf as well for extra confidence. Enter on the 5M–15M after a sweep + CHOCH in the direction of the aligned 1M–12M bias. that simple just continue to keep watching key levels mabey take profit 1-2 weeks and jump back in scaling up if desired..easy way to combine any small account size.
Perfect balance of:
low risk
high R:R
optimal precision
minimal chop
best sweep/CHOCH clarity
hope you guys enjoy this one.
Trinity Extreme Rope Trend [SamRecio]Original work and credit to Sam and you can find him here (www.tradingview.com) and his script available from
Why change... just some small tweaks to enhance and here is the summary of Changes vs the Original Script...
- Rope smoothing algorithm kept 100% identical (same brilliant “pull-only-when-exceeded-ATR” logic)
- Direction logic unchanged (still instantly resets on price crossing the rope)
- Old linebr + fill method completely replaced with clean box.new() consolidation zones
- Added “BR” breakout arrows (cyan triangle up for bullish break, magenta triangle down for bearish break)
- Arrows fire only on the exact breakout bar — zero repaint, zero lag
- Added subtle yellow background tint while in consolidation
- Full alertconditions + optional popup/sound on every BR break
- Auto-finalizes and cleans boxes properly, no chart clutter
Primary rule: only take trades on the BR arrow in the direction of the higher-timeframe trend.
Typical high-probability setups
- Wait for yellow rope + box → price consolidates
- BR arrow appears and candle closes outside the box → enter immediately
- Stop-loss just inside the box (opposite side)
- Target: next major liquidity pool, previous swing high/low, or 3–5R
Suggested Settings for Different Styles/Timeframes
Scalping (1 m – 5 m)
ATR Length: 10–12
ATR Multiplier: 1.0–1.3
→ tighter rope = faster signals, perfect for killing 1-minute London/NY open raids
Intraday aggression (5 m – 15 m)
ATR Length: 14 (default)
ATR Multiplier: 1.5–1.8
→ this is the sweet spot most funded traders use right now
Swing / position trading (1 H – 4 H)
ATR Length: 20–30
ATR Multiplier: 2.0–2.5
→ wider rope filters out noise, only catches the real macro moves
Daily / weekly bias filter
ATR Length: 50
ATR Multiplier: 3.0–4.0
→ use only the rope color (ignore boxes) to determine weekly bias — cyan = only longs all week, magenta = only shorts
That’s it. Drop the script, choose one of the above settings based on your style, turn on alerts, and hope you enjoy what is a wonderful script.
Adaptive Risk Management [sgbpulse]1. Introduction:
Adaptive Risk Management is an advanced indicator designed to provide traders with a comprehensive risk management tool directly on the chart. Instead of relying on complex manual calculations, the indicator automates all critical steps of trade planning. It dynamically calculates the estimated Entry Price , the Stop Loss location, the required Position Size (Quantity) based on your capital and risk limits, and the three Take Profit targets based on your defined Reward/Risk ratios. The indicator displays all these essential data points clearly and visually on the chart, ensuring you always know the potential risk-reward profile of every trade.
ARM : The A daptive R isk M anagement every trader needs to ARM themselves with.
2. The Critical Importance of Risk Management
Proper risk management is the cornerstone of successful trading. Consistent profitability in the market is impossible without rigorously defining risk limits.
Risk Control: This starts by setting the maximum risk amount you are willing to lose in a single trade (Risk per Trade), and limiting the total capital allocated to the position (Max Capital per Trade).
Defining Boundaries (Stop Loss & Take Profit): It is mandatory to define a technical Stop Loss and a Take Profit target. A fundamental rule of risk management is that the Reward/Risk Ratio (R/R) must be a minimum of 1:1.
3. Core Features, Adaptivity, and Customization
The Adaptive Risk Management indicator is engineered for use across all major trading styles, including Swing Trading, Intraday Trading, and Scalping, providing consistent risk control regardless of the chosen timeframe.
Real-Time Dynamic Adaptivity: The indicator calculates all risk management parameters (Entry, Stop Loss, Quantity) dynamically with every new bar, thus adapting instantly to changing market conditions.
Trend Direction Adjustment: Define the analysis direction (Long/Uptrend or Short/Downtrend).
Intraday Session Data Control: Full control over whether lookback calculations will include data from Extended Trading Hours (ETH), or if the daily calculations will start actively only from the first bar of Regular Trading Hours (RTH).
Status Validation: The indicator performs critical status checks and displays clear Warning Messages if risk conditions are not met.
4. Intuitive Visualization and Real-Time Data
Dynamic Tracking Lines: The Entry Price and Stop Loss lines are updated with every new bar. Crucially, the length of these lines dynamically reflects the calculation's lookback range (e.g., the extent of Lookback Bars or the location of the confirmed Pivot Point), providing a visual anchor for the calculated price.
Risk and Reward Zones: The indicator creates a graphical background fill between Entry and Stop Loss (marked with the risk color) and between Entry and the Reward Targets (marked with the reward color).
Essential Information Labels: Labels are placed at the end of each line, providing critical data: Estimated Entry Price, Stock/Contract Quantity (Quantity), Total Entry Amount, Estimated Stop Loss, Risk per Share, Total Financial Risk (Risk Amount), Exit Amount, Estimated Take Profit 1/2/3, Reward/Risk Ratio 1/2/3, Total Reward 1/2/3, TP Exit Amount 1/2/3.
4.1. Data Window Metrics (16 Full Series)
The indicator displays 16 full data series in the TradingView Data Window, allowing precise tracking of every calculation parameter:
Entry Data: Estimated Entry, Quantity, Entry Amount.
Risk Data (Stop Loss): Estimated Stop Loss, Risk per Share, Risk Amount, Exit Amount.
Reward Data (Take Profit): Estimated Take Profit 1/2/3, Reward/Risk Ratio 1/2/3, Total Reward 1/2/3, TP Exit Amount 1/2/3.
4.2. Instant Tracking in the Status Line
The indicator displays 6 critical parameters continuously in the indicator's Status Line: Estimated Entry, Quantity, Estimated Stop Loss, Estimated Take Profit 1/2/3.
5. Detailed Indicator Inputs
5.1 General
Focused Trend: Defines the analysis direction (Uptrend / Downtrend).
Max Capital per Trade: The maximum amount allocated to purchasing stocks/contracts (in account currency).
Risk per Trade: The maximum amount the user is willing to risk in this single trade (in account currency).
ATR Length: The lookback period for the Average True Range (ATR) calculation.
5.2 Intraday Session Data Control
Regular Hours Limitation : If enabled, all daily lookback calculations (for Entry/Stop Loss anchor points) will begin strictly from the first Regular Trading Hours (RTH) bar. This limits the lookback range to the current RTH session, excluding preceding Extended Trading Hours (ETH) data. Only relevant for Intraday charts. Default: False (Off)
5.3 Entry Inputs
Entry Method: Selects the entry price calculation method:
Current Price: Uses the closing price of the current bar as the estimated entry point (Market Entry).
ATR Real Bodies Margin :
- Uptrend: Calculates the Maximum Real Body over the lookback period + the calculated safety margin.
- Downtrend: Calculates the Minimum Real Body over the lookback period - the calculated safety margin.
ATR Bars Margin :
- Uptrend: Calculates the Maximum High price over the lookback period + the calculated safety margin.
- Downtrend: Calculates the Minimum Low price over the lookback period - the calculated safety margin.
Lookback Bars: The number of bars used to calculate the extremes in the ATR-based entry methods (Relevant only for ATR Real Bodies Margin and ATR Bars Margin methods).
ATR Multiplier (Entry): The multiplier applied to the ATR value. The result of the multiplication is the calculated safety margin used to determine the estimated Entry Price.
5.4 Risk Inputs (Stop Loss)
Risk Method: Selects the Stop Loss price calculation method.
ATR Current Price Margin :
- Uptrend: Entry Price - the calculated safety margin.
- Downtrend: Entry Price + the calculated safety margin.
ATR Current Bar Margin :
- Uptrend: Current Bar's Low price - the calculated safety margin.
- Downtrend: Current Bar's High price + the calculated safety margin.
ATR Bars Margin :
- Uptrend: Lowest Low over lookback period - the calculated safety margin.
- Downtrend: Highest High over lookback period + the calculated safety margin.
ATR Pivot Margin :
- Uptrend: The first confirmed Pivot Low point - the calculated safety margin.
- Downtrend: The first confirmed Pivot High point + the calculated safety margin.
Lookback Bars: The lookback period for finding the extreme price used in the 'ATR Bars Margin' calculation.
ATR Multiplier (Risk): The multiplier applied to the ATR value. The result of the multiplication is the calculated safety margin used to place the estimated Stop Loss. Note: If set to 0, the Stop Loss will be placed exactly at the technical anchor point, provided the Minimum Margin Value is also 0.
Minimum Margin Value: The minimum price value (e.g., $0.01) the Stop Loss margin buffer must be.
Pivot (Left / Right): The number of bars required on either side of the pivot bar for confirmation (relevant only for the ATR Pivot Margin method).
5.5 Reward Inputs (Take Profit)
Show Take Profit 1/2/3: ON/OFF switch to control the visibility of each Take Profit target.
Reward/Risk Ratio 1/ 2/ 3: Defines the R/R ratio for the profit target. Must be ≥1.0.
6. Indicator Status/Warning Messages
In situations where the Stop Loss location cannot be calculated logically and validly, often caused by a mismatch between the configured Focused Trend (Uptrend/Downtrend) and the actual price action, the indicator will display a warning message, explaining the reason and suggesting corrective action.
Status Message 1: Pivot reference unavailable
Condition: The Stop Loss is set to the "ATR Pivot Margin" method, but the anchor point (Pivot) is missing or inaccessible.
Message Displayed: "Pivot reference unavailable. Wait for valid price action, or adjust the Regular Hours Limitation setting or Pivot Left/Right inputs."
Status Message 2: Calculated Stop Loss is unsafe
Condition: The calculated Stop Loss is placed illogically or unsafely relative to the trend direction and the Entry price.
Message Displayed: "Calculated Stop Loss is unsafe for current trend. Wait for valid price action or adjust SL Lookback/Multiplier."
7. Summary
The Adaptive Risk Management (ARM) indicator provides a seamless and systematic approach to trade execution and risk control. By dynamically automating all critical trade parameters—from Entry Price and Stop Loss placement to Position Sizing and Take Profit targets—ARM removes emotional bias and ensures every trade adheres strictly to your predefined risk profile.
Key Benefits:
Systematic Risk Control: Strict enforcement of maximum capital allocation and risk per trade limits.
Adaptivity: Dynamic calculation of prices and quantities based on real-time market data (ATR and Lookback).
Clarity and Trust: Clear on-chart visualization, precise data metrics (16 series), and unambiguous Status/Warning Messages ensure transparency and reliability.
ARM allows traders to focus on strategy and analysis, confident that their execution complies with the core principles of professional risk management.
Important Note: Trading Risk
This indicator is intended for educational and informational purposes only and does not constitute investment advice or a recommendation for trading in any form whatsoever.
Trading in financial markets involves significant risk of capital loss. It is important to remember that past performance is not indicative of future results. All trading decisions are your sole responsibility. Never trade with money you cannot afford to lose.
Hash Ratings EngineHash Ratings Engine - Technical Consensus Strategy
A systematic trading strategy that harnesses TradingView's Technical Ratings to generate high-conviction entries with institutional-grade risk management.
What It Does
This strategy aggregates the consensus of 26+ technical indicators (RSI, MACD, Stochastics, multiple Moving Averages, etc.) into a single actionable signal. When enough indicators align bullish or bearish, the engine triggers an entry. Built-in trend filtering and ATR-based exits keep you on the right side of the market.
Key Features
Trend Filter - Only takes longs in uptrends, shorts in downtrends. This single filter typically improves results by 20-40% by avoiding counter-trend trades.
ATR-Based Risk Management - Stop loss and trailing stops adapt to current market volatility. Tight stops in calm markets, wider stops in volatile conditions.
Cooldown System - After a losing trade, the strategy waits before re-entering. This prevents the consecutive loss streaks that destroy accounts.
Clean Visuals - Fluorescent entry/exit signals with price level references. See exactly where you got in and out.
Settings Guide
Indicator Timeframe: Leave blank for current chart. Use higher timeframe for fewer, higher-quality signals.
Rating Source: "All" for balanced approach. "MAs" for trend-following. "Oscillators" for mean-reversion.
Entry Thresholds
Strong Signal Threshold: Higher = fewer trades but better conviction. Start at 0.5, test 0.4-0.6.
Risk Management
ATR Period: 12 is responsive, 14 is standard, 20+ is smoother.
Stop Loss: 2-3x ATR for tight stops, 3.5-4x for moderate, 5x+ for wide.
Trail Activation: How far price must move in profit before trailing begins.
Trail Offset: How closely the trail follows price.
Trend Filter
EMA Length: 150 works well on 4H charts. Use 100 for lower timeframes, 200 for daily.
Trade Timing
Cooldown: Keep enabled. 5 bars is a good starting point.
Best Practices
Start with default settings and backtest on your preferred instrument. Adjust the Strong Signal Threshold first - this has the biggest impact on trade frequency. Then tune the EMA length to match your timeframe. Finally, optimize the ATR multipliers for your risk tolerance.
Works on any liquid market - crypto, forex, stocks, futures. Higher timeframes (4H, Daily) tend to produce cleaner signals than lower timeframes.
Disclaimer
Past performance does not guarantee future results. Always backtest thoroughly and use proper position sizing. This strategy is for educational purposes - trade at your own risk.
ATR ZigZag - Volatility-Filtered Market StructureDescription
This indicator draws ZigZags using an ATR based threshold for direction switching to identify major swing highs and lows. Instead of relying on fractals or fixed bar-count swings, pivots are confirmed only when price moves beyond the prior extreme by:
threshold = ATR(length) × ATR_mult
This filters noise, enforces valid swing structure (high → low → high), and adapts automatically to volatility. The ATR ZigZag is ideal for traders who want a clean, objective view of swing structure without noise. This has many uses, including mapping swing structure, drawing chart patterns, and trading around extremes.
Lag and Repainting
Pivots are confirmed only after price moves sufficiently in the opposite direction. This creates necessary lag. The ZigZag is drawn when this occurs, and will anchor to the high/low in the past. Optional detection dot plots show exactly when confirmation occurred.
What You See
ZigZag: dashed gray line, repainted to anchor at the confirmed highs and lows
Latest Pivot Levels: Dashed horizontal lines at the most recent confirmed high/low.
Optional Live Swing Leg: A real-time line from the last confirmed pivot to the current swing extreme, updating until a new pivot forms.
Optional ATR Boxes: 1×ATR shaded zones around the latest pivot for structural context.
Optional Pivot Confirmation Dots: Markers show the bar where the threshold is crossed and a swing is officially confirmed. This is to understand the lag and see when the ZigZag repainted.
XAUUSD 1m SMC Zones (BOS + Flexible TP Modes + Trailing Runner)//@version=6
strategy("XAUUSD 1m SMC Zones (BOS + Flexible TP Modes + Trailing Runner)",
overlay = true,
initial_capital = 10000,
pyramiding = 10,
process_orders_on_close = true)
//━━━━━━━━━━━━━━━━━━━
// 1. INPUTS
//━━━━━━━━━━━━━━━━━━━
// TP / SL
tp1Pips = input.int(10, "TP1 (pips)", minval = 1)
fixedSLpips = input.int(50, "Fixed SL (pips)", minval = 5)
runnerRR = input.float(3.0, "Runner RR (TP2 = SL * RR)", step = 0.1, minval = 1.0)
// Daily risk
maxDailyLossPct = input.float(5.0, "Max daily loss % (stop trading)", step = 0.5)
maxDailyProfitPct = input.float(20.0, "Max daily profit % (stop trading)", step = 1.0)
// HTF S/R (1H)
htfTF = input.string("60", "HTF timeframe (minutes) for S/R block")
// Profit strategy (Option C)
profitStrategy = input.string("Minimal Risk | Full BE after TP1", "Profit Strategy", options = )
// Runner stop mode (your option 4)
runnerStopMode = input.string( "BE only", "Runner Stop Mode", options = )
// ATR trail settings (only used if ATR mode selected)
atrTrailLen = input.int(14, "ATR Length (trail)", minval = 1)
atrTrailMult = input.float(1.0, "ATR Multiplier (trail)", step = 0.1, minval = 0.1)
// Pip size (for XAUUSD: 1 pip = 0.10 if tick = 0.01)
pipSize = syminfo.mintick * 10.0
tp1Points = tp1Pips * pipSize
slPoints = fixedSLpips * pipSize
baseQty = input.float (1.0, "Base order size" , step = 0.01, minval = 0.01)
//━━━━━━━━━━━━━━━━━━━
// 2. DAILY RISK MANAGEMENT
//━━━━━━━━━━━━━━━━━━━
isNewDay = ta.change(time("D")) != 0
var float dayStartEquity = na
var bool dailyStopped = false
equityNow = strategy.initial_capital + strategy.netprofit
if isNewDay or na(dayStartEquity)
dayStartEquity := equityNow
dailyStopped := false
dailyPnL = equityNow - dayStartEquity
dailyPnLPct = dayStartEquity != 0 ? (dailyPnL / dayStartEquity) * 100.0 : 0.0
if not dailyStopped
if dailyPnLPct <= -maxDailyLossPct
dailyStopped := true
if dailyPnLPct >= maxDailyProfitPct
dailyStopped := true
canTradeToday = not dailyStopped
//━━━━━━━━━━━━━━━━━━━
// 3. 1H S/R ZONES (for direction block)
//━━━━━━━━━━━━━━━━━━━
htOpen = request.security(syminfo.tickerid, htfTF, open)
htHigh = request.security(syminfo.tickerid, htfTF, high)
htLow = request.security(syminfo.tickerid, htfTF, low)
htClose = request.security(syminfo.tickerid, htfTF, close)
// Engulf logic on HTF
htBullPrev = htClose > htOpen
htBearPrev = htClose < htOpen
htBearEngulf = htClose < htOpen and htBullPrev and htOpen >= htClose and htClose <= htOpen
htBullEngulf = htClose > htOpen and htBearPrev and htOpen <= htClose and htClose >= htOpen
// Liquidity sweep on HTF previous candle
htSweepHigh = htHigh > ta.highest(htHigh, 5)
htSweepLow = htLow < ta.lowest(htLow, 5)
// Store last HTF zones
var float htResHigh = na
var float htResLow = na
var float htSupHigh = na
var float htSupLow = na
if htBearEngulf and htSweepHigh
htResHigh := htHigh
htResLow := htLow
if htBullEngulf and htSweepLow
htSupHigh := htHigh
htSupLow := htLow
// Are we inside HTF zones?
inHtfRes = not na(htResHigh) and close <= htResHigh and close >= htResLow
inHtfSup = not na(htSupLow) and close >= htSupLow and close <= htSupHigh
// Block direction against HTF zones
longBlockedByZone = inHtfRes // no buys in HTF resistance
shortBlockedByZone = inHtfSup // no sells in HTF support
//━━━━━━━━━━━━━━━━━━━
// 4. 1m LOCAL ZONES (LIQUIDITY SWEEP + ENGULF + QUALITY SCORE)
//━━━━━━━━━━━━━━━━━━━
// 1m engulf patterns
bullPrev1 = close > open
bearPrev1 = close < open
bearEngulfNow = close < open and bullPrev1 and open >= close and close <= open
bullEngulfNow = close > open and bearPrev1 and open <= close and close >= open
// Liquidity sweep by previous candle on 1m
sweepHighPrev = high > ta.highest(high, 5)
sweepLowPrev = low < ta.lowest(low, 5)
// Local zone storage (one active support + one active resistance)
// Quality score: 1 = engulf only, 2 = engulf + sweep (we only trade ≥2)
var float supLow = na
var float supHigh = na
var int supQ = 0
var bool supUsed = false
var float resLow = na
var float resHigh = na
var int resQ = 0
var bool resUsed = false
// New resistance zone: previous bullish candle -> bear engulf
if bearEngulfNow
resLow := low
resHigh := high
resQ := sweepHighPrev ? 2 : 1
resUsed := false
// New support zone: previous bearish candle -> bull engulf
if bullEngulfNow
supLow := low
supHigh := high
supQ := sweepLowPrev ? 2 : 1
supUsed := false
// Raw "inside zone" detection
inSupRaw = not na(supLow) and close >= supLow and close <= supHigh
inResRaw = not na(resHigh) and close <= resHigh and close >= resLow
// QUALITY FILTER: only trade zones with quality ≥ 2 (engulf + sweep)
highQualitySup = supQ >= 2
highQualityRes = resQ >= 2
inSupZone = inSupRaw and highQualitySup and not supUsed
inResZone = inResRaw and highQualityRes and not resUsed
// Plot zones
plot(supLow, "Sup Low", color = color.new(color.lime, 60), style = plot.style_linebr)
plot(supHigh, "Sup High", color = color.new(color.lime, 60), style = plot.style_linebr)
plot(resLow, "Res Low", color = color.new(color.red, 60), style = plot.style_linebr)
plot(resHigh, "Res High", color = color.new(color.red, 60), style = plot.style_linebr)
//━━━━━━━━━━━━━━━━━━━
// 5. MODERATE BOS (3-BAR FRACTAL STRUCTURE)
//━━━━━━━━━━━━━━━━━━━
// 3-bar swing highs/lows
swHigh = high > high and high > high
swLow = low < low and low < low
var float lastSwingHigh = na
var float lastSwingLow = na
if swHigh
lastSwingHigh := high
if swLow
lastSwingLow := low
// BOS conditions
bosUp = not na(lastSwingHigh) and close > lastSwingHigh
bosDown = not na(lastSwingLow) and close < lastSwingLow
// Zone “arming” and BOS validation
var bool supArmed = false
var bool resArmed = false
var bool supBosOK = false
var bool resBosOK = false
// Arm zones when first touched
if inSupZone
supArmed := true
if inResZone
resArmed := true
// BOS after arming → zone becomes valid for entries
if supArmed and bosUp
supBosOK := true
if resArmed and bosDown
resBosOK := true
// Reset BOS flags when new zones are created
if bullEngulfNow
supArmed := false
supBosOK := false
if bearEngulfNow
resArmed := false
resBosOK := false
//━━━━━━━━━━━━━━━━━━━
// 6. ENTRY CONDITIONS (ZONE + BOS + RISK STATE)
//━━━━━━━━━━━━━━━━━━━
flatOrShort = strategy.position_size <= 0
flatOrLong = strategy.position_size >= 0
longSignal = canTradeToday and not longBlockedByZone and inSupZone and supBosOK and flatOrShort
shortSignal = canTradeToday and not shortBlockedByZone and inResZone and resBosOK and flatOrLong
//━━━━━━━━━━━━━━━━━━━
// 7. ORDER LOGIC – TWO PROFIT STRATEGIES
//━━━━━━━━━━━━━━━━━━━
// Common metrics
atrTrail = ta.atr(atrTrailLen)
// MINIMAL MODE: single trade, BE after TP1, optional trailing
// HYBRID MODE: two trades (Scalp @ TP1, Runner @ TP2)
// Persistent tracking
var float longEntry = na
var float longTP1 = na
var float longTP2 = na
var float longSL = na
var bool longBE = false
var float longRunEntry = na
var float longRunTP1 = na
var float longRunTP2 = na
var float longRunSL = na
var bool longRunBE = false
var float shortEntry = na
var float shortTP1 = na
var float shortTP2 = na
var float shortSL = na
var bool shortBE = false
var float shortRunEntry = na
var float shortRunTP1 = na
var float shortRunTP2 = na
var float shortRunSL = na
var bool shortRunBE = false
isMinimal = profitStrategy == "Minimal Risk | Full BE after TP1"
isHybrid = profitStrategy == "Hybrid | Scalp TP + Runner TP"
//━━━━━━━━━━ LONG ENTRIES ━━━━━━━━━━
if longSignal
if isMinimal
longEntry := close
longSL := longEntry - slPoints
longTP1 := longEntry + tp1Points
longTP2 := longEntry + slPoints * runnerRR
longBE := false
strategy.entry("Long", strategy.long)
supUsed := true
supArmed := false
supBosOK := false
else if isHybrid
longRunEntry := close
longRunSL := longRunEntry - slPoints
longRunTP1 := longRunEntry + tp1Points
longRunTP2 := longRunEntry + slPoints * runnerRR
longRunBE := false
// Two separate entries, each 50% of baseQty (for backtest)
strategy.entry("LongScalp", strategy.long, qty = baseQty * 0.5)
strategy.entry("LongRun", strategy.long, qty = baseQty * 0.5)
supUsed := true
supArmed := false
supBosOK := false
//━━━━━━━━━━ SHORT ENTRIES ━━━━━━━━━━
if shortSignal
if isMinimal
shortEntry := close
shortSL := shortEntry + slPoints
shortTP1 := shortEntry - tp1Points
shortTP2 := shortEntry - slPoints * runnerRR
shortBE := false
strategy.entry("Short", strategy.short)
resUsed := true
resArmed := false
resBosOK := false
else if isHybrid
shortRunEntry := close
shortRunSL := shortRunEntry + slPoints
shortRunTP1 := shortRunEntry - tp1Points
shortRunTP2 := shortRunEntry - slPoints * runnerRR
shortRunBE := false
strategy.entry("ShortScalp", strategy.short, qty = baseQty * 50)
strategy.entry("ShortRun", strategy.short, qty = baseQty * 50)
resUsed := true
resArmed := false
resBosOK := false
//━━━━━━━━━━━━━━━━━━━
// 8. EXIT LOGIC – MINIMAL MODE
//━━━━━━━━━━━━━━━━━━━
// LONG – Minimal Risk: 1 trade, BE after TP1, runner to TP2
if isMinimal and strategy.position_size > 0 and not na(longEntry)
// Move to BE once TP1 is touched
if not longBE and high >= longTP1
longBE := true
// Base SL: BE or initial SL
float dynLongSL = longBE ? longEntry : longSL
// Optional trailing after BE
if longBE
if runnerStopMode == "Structure trail" and not na(lastSwingLow) and lastSwingLow > longEntry
dynLongSL := math.max(dynLongSL, lastSwingLow)
if runnerStopMode == "ATR trail"
trailSL = close - atrTrailMult * atrTrail
dynLongSL := math.max(dynLongSL, trailSL)
strategy.exit("Long Exit", "Long", stop = dynLongSL, limit = longTP2)
// SHORT – Minimal Risk: 1 trade, BE after TP1, runner to TP2
if isMinimal and strategy.position_size < 0 and not na(shortEntry)
if not shortBE and low <= shortTP1
shortBE := true
float dynShortSL = shortBE ? shortEntry : shortSL
if shortBE
if runnerStopMode == "Structure trail" and not na(lastSwingHigh) and lastSwingHigh < shortEntry
dynShortSL := math.min(dynShortSL, lastSwingHigh)
if runnerStopMode == "ATR trail"
trailSLs = close + atrTrailMult * atrTrail
dynShortSL := math.min(dynShortSL, trailSLs)
strategy.exit("Short Exit", "Short", stop = dynShortSL, limit = shortTP2)
//━━━━━━━━━━━━━━━━━━━
// 9. EXIT LOGIC – HYBRID MODE
//━━━━━━━━━━━━━━━━━━━
// LONG – Hybrid: Scalp + Runner
if isHybrid
// Scalp leg: full TP at TP1
if strategy.opentrades > 0
strategy.exit("LScalp TP", "LongScalp", stop = longRunSL, limit = longRunTP1)
// Runner leg
if strategy.position_size > 0 and not na(longRunEntry)
if not longRunBE and high >= longRunTP1
longRunBE := true
float dynLongRunSL = longRunBE ? longRunEntry : longRunSL
if longRunBE
if runnerStopMode == "Structure trail" and not na(lastSwingLow) and lastSwingLow > longRunEntry
dynLongRunSL := math.max(dynLongRunSL, lastSwingLow)
if runnerStopMode == "ATR trail"
trailRunSL = close - atrTrailMult * atrTrail
dynLongRunSL := math.max(dynLongRunSL, trailRunSL)
strategy.exit("LRun TP", "LongRun", stop = dynLongRunSL, limit = longRunTP2)
// SHORT – Hybrid: Scalp + Runner
if isHybrid
if strategy.opentrades > 0
strategy.exit("SScalp TP", "ShortScalp", stop = shortRunSL, limit = shortRunTP1)
if strategy.position_size < 0 and not na(shortRunEntry)
if not shortRunBE and low <= shortRunTP1
shortRunBE := true
float dynShortRunSL = shortRunBE ? shortRunEntry : shortRunSL
if shortRunBE
if runnerStopMode == "Structure trail" and not na(lastSwingHigh) and lastSwingHigh < shortRunEntry
dynShortRunSL := math.min(dynShortRunSL, lastSwingHigh)
if runnerStopMode == "ATR trail"
trailRunSLs = close + atrTrailMult * atrTrail
dynShortRunSL := math.min(dynShortRunSL, trailRunSLs)
strategy.exit("SRun TP", "ShortRun", stop = dynShortRunSL, limit = shortRunTP2)
//━━━━━━━━━━━━━━━━━━━
// 10. RESET STATE WHEN FLAT
//━━━━━━━━━━━━━━━━━━━
if strategy.position_size == 0
longEntry := na
shortEntry := na
longBE := false
shortBE := false
longRunEntry := na
shortRunEntry := na
longRunBE := false
shortRunBE := false
//━━━━━━━━━━━━━━━━━━━
// 11. VISUAL ENTRY MARKERS
//━━━━━━━━━━━━━━━━━━━
plotshape(longSignal, title = "Long Signal", style = shape.triangleup,
location = location.belowbar, color = color.lime, size = size.tiny, text = "L")
plotshape(shortSignal, title = "Short Signal", style = shape.triangledown,
location = location.abovebar, color = color.red, size = size.tiny, text = "S")
Sai Scalper ProSai Scalper Pro – Feature Summary
Trend Engine
- ATR-based trailing stop with Fibonacci levels (61.8%, 78.6%, 88.6%)
- Auto trend detection with swing point tracking
Scalping Detection (0-10 Score)
- Analyzes 7 factors: ATR compression, ADX, Volume, Range, Consolidation, RSI, BB Squeeze
- Smart state machine with hysteresis to prevent false signals
- Adjustable sensitivity & stability settings
Cloud Modes (7 Options)
- Full Zone, Entry Zone, Premium/Discount, Fib Bands, Upper/Middle/Lower Band
Pro Dashboard
- Real-time scalp score with visual meter
- Entry quality rating & zone display
- Suggested TP/SL based on ATR
- Session detection (Sydney/Tokyo/London/NY) with overlap alerts
- 3 styles (Minimal/Pro/Full) × 4 sizes × 9 positions
Alerts
- Scalp ready, Prime conditions (8+), Optimal entry zone
- Direction-specific (Long/Short bias)
Combines trend-following Fibonacci analysis with intelligent ranging detection for optimal scalping opportunities.
VWAP + EMA9 With SignalsThis script is for scalping on the 5 minute timeframe. It contains signals that indicate intersection of VWAP by the EMA9. It contains Buy signals when a candle closes above both lines indicating a quick continuation of a long position (quick scalp) as well as Sell signals when a candle closes below both lines indicating a quick continuation of a short position (quick scalp). Please note that i do not recommend entries at Buy and Sell signals during Accumulation/Consolidation. Positions should be taken with volume.
VOLX+ VWAP Range BandsVOLX+ plots multiple VWAP-weighted high/low channels across different lookback periods to show how price behaves relative to short-term and long-term value zones.
Instead of using a single VWAP line, this tool creates four rolling VWAP envelopes:
Short-term range (fast reaction)
Mid-term range
Mid-mid range (transitional layer)
Long-term range (macro context)
Each band is computed as:
VWAP-High = SMA(high × volume, length) ÷ SMA(volume, length)
VWAP-Low = SMA(low × volume, length) ÷ SMA(volume, length)
This produces dynamic price channels that account for both price and traded volume, offering a clearer sense of where the market is accepting or rejecting value.
What It Shows
Four VWAP-weighted high/low bands
A short-term VWAP midline
Price line
Three SMAs for trend context
Optional visibility switches for each VWAP band
The filled regions between VWAP highs and lows create a layered “value map,” helping you interpret:
Trend continuation (price hugging outer VWAP bands)
Mean reversion (price returning toward inner bands)
Volatility contraction/expansion
Shifts in short-term vs long-term balance
🧠 How to Use
Use the short-term band for day-trading context or detecting short-term excess.
Use mid-term and mid-mid bands to confirm developing structure.
Use the long-term VWAP band to understand broader value zones.
Combine VWAP bands with SMAs and structure analysis for confluence.
This indicator is intended for price interpretation and analytical support.
✔ Does Not Repaint
The script uses rolling VWAP formulas and standard MAs; everything is stable and non-repainting.
MTF 4h Structure + FVG (CORRECTED)This is a fully customizable Multi-Timeframe (MTF) indicator for SMC traders. It overlays true Higher Timeframe market structure onto your current chart. While it defaults to the 4-Hour (4h) structure, you can easily change this to 1h, Daily, or Weekly in the settings to suit your strategy.
Key Features:
1. Dynamic MTF Overlay: Select any Higher Timeframe (HTF) in the settings. The script calculates true pivots on that timeframe and projects them onto your chart without repainting issues.
2. Active Dealing Range: Automatically displays the Swing High and Swing Low of the selected HTF.
3. Equilibrium (EQ): Marks the 50% level of the range to help you identify Premium (Sell) vs. Discount (Buy) zones.
4. HTF Fair Value Gaps (FVG): Detects and draws unmitigated FVGs from your selected timeframe, acting as high-probability POIs.
Visuals & Logic:
- Green/Red: Signals CHoCH (Trend Reversals).
- Gray: Signals BOS (Trend Continuation) - keeping the chart clean.
- Smart Calculation: Calculates structure explicitly on the HTF data to prevent false signals on lower timeframes.
How to use:
1. Add to your chart (e.g., 5m or 15m).
2. Open Settings -> Select your desired "Higher Timeframe" (Default is 4h).
3. Trade in the direction of the HTF Trend (Labels) and look for entries within HTF FVGs in the correct Discount/Premium zone.
VAPO OsilatorThe Real Map of Buying and Selling Pressure.
VAPO Advanced is fundamentally different from conventional oscillators that only measure momentum based on price. By integrating Volume and price movement (Pressure), it quantitatively maps the true buying and selling pressure in the market.
How It Works and What Are Its Advantages?
1. Core Pressure Measurement
Logic: The oscillator interprets high-volume price increases as strong buying pressure (+P) and high-volume price decreases as strong selling pressure (-P). Low-volume moves weaken the signal strength.
Benefit: This effectively filters out misleading signals caused by "fake" price movements (manipulation or low-volume spikes). It only displays momentum shifts that are supported by volume.
2. Dynamic Signal Line and Histogram
Signal Line: Provides a dynamic signal line smoothed by your choice of Moving Average type (EMA, SMA, WMA).
Histogram: Shows the difference between the VAPO line and the Signal line. A zero-line crossover of the histogram is the clearest signal that pressure is shifting direction. As the Green histogram grows, Buying Pressure accelerates; as the Red histogram grows, Selling Pressure accelerates.
3. Reliable Confirmation Tool
VAPO serves as an excellent confirmation tool when used alongside your primary trend indicators. For instance, when a trend indicator gives a BUY signal, VAPO crossing above the zero line (positive pressure) significantly increases the reliability of that signal.
⚠️ DISCLAIMER: THIS IS NOT FINANCIAL ADVICE. ALL INFORMATION PROVIDED IS FOR EDUCATIONAL AND ANALYTICAL PURPOSES ONLY.
YASAL UYARI: BU BİR YATIRIM TAVSİYESİ DEĞİLDİR. SUNULAN TÜM BİLGİLER YALNIZCA EĞİTİM VE ANALİZ AMAÇLIDIR.
EMA Divergence Color CandlesThis indicator colors candles based on their position relative to the EMA and the strength of the divergence.
Above EMA → Blue (bullish zone)
Below EMA → Red (bearish zone)
Divergence strength is shown in 3 color levels:
Weak (close to EMA)
Medium
Strong (far from EMA)
The indicator draws its own candles, so no TradingView settings need to be changed.
The EMA line is also shown on top of the custom candles.
Credit Spread RegimeThe Credit Market as Economic Barometer
Credit spreads are among the most reliable leading indicators of economic stress. When corporations borrow money by issuing bonds, investors demand a premium above the risk-free Treasury rate to compensate for the possibility of default. This premium, known as the credit spread, fluctuates based on perceptions of economic health, corporate profitability, and systemic risk.
The relationship between credit spreads and economic activity has been studied extensively. Two papers form the foundation of this indicator. Pierre Collin-Dufresne, Robert Goldstein, and Spencer Martin published their influential 2001 paper in the Journal of Finance, documenting that credit spread changes are driven by factors beyond firm-specific credit quality. They found that a substantial portion of spread variation is explained by market-wide factors, suggesting credit spreads contain information about aggregate economic conditions.
Simon Gilchrist and Egon Zakrajsek extended this research in their 2012 American Economic Review paper, introducing the concept of the Excess Bond Premium. They demonstrated that the component of credit spreads not explained by default risk alone is a powerful predictor of future economic activity. Elevated excess spreads precede recessions with remarkable consistency.
What Credit Spreads Reveal
Credit spreads measure the difference in yield between corporate bonds and Treasury securities of similar maturity. High yield bonds, also called junk bonds, carry ratings below investment grade and offer higher yields to compensate for greater default risk. Investment grade bonds have lower yields because the probability of default is smaller.
The spread between high yield and investment grade bonds is particularly informative. When this spread widens, investors are demanding significantly more compensation for taking on credit risk. This typically indicates deteriorating economic expectations, tighter financial conditions, or increasing risk aversion. When the spread narrows, investors are comfortable accepting lower premiums, signaling confidence in corporate health.
The Gilchrist-Zakrajsek research showed that credit spreads contain two distinct components. The first is the expected default component, which reflects the probability-weighted cost of potential defaults based on corporate fundamentals. The second is the excess bond premium, which captures additional compensation demanded beyond expected defaults. This excess premium rises when investor risk appetite declines and financial conditions tighten.
The Implementation Approach
This indicator uses actual option-adjusted spread data from the Federal Reserve Economic Database (FRED), available directly in TradingView. The ICE BofA indices represent the industry standard for measuring corporate bond spreads.
The primary data sources are FRED:BAMLH0A0HYM2, the ICE BofA US High Yield Index Option-Adjusted Spread, and FRED:BAMLC0A0CM, the ICE BofA US Corporate Index Option-Adjusted Spread for investment grade bonds. These indices measure the spread of corporate bonds over Treasury securities of similar duration, expressed in basis points.
Option-adjusted spreads account for embedded options in corporate bonds, providing a cleaner measure of credit risk than simple yield spreads. The methodology developed by ICE BofA is widely used by institutional investors and central banks for monitoring credit conditions.
The indicator offers two modes. The HY-IG excess spread mode calculates the difference between high yield and investment grade spreads, isolating the pure compensation for below-investment-grade credit risk. This measure is less affected by broad interest rate movements. The HY-only mode tracks the absolute high yield spread, capturing both credit risk and the overall level of risk premiums in the market.
Interpreting the Regimes
Credit conditions are classified into four regimes based on Z-scores calculated from the spread proxy.
The Stress regime occurs when spreads reach extreme levels, typically above a Z-score of 2.0. At this point, credit markets are pricing in significant default risk and economic deterioration. Historically, stress regimes have coincided with recessions, financial crises, and major market dislocations. The 2008 financial crisis, the 2011 European debt crisis, the 2016 commodity collapse, and the 2020 pandemic all triggered credit stress regimes.
The Elevated regime, between Z-scores of 1.0 and 2.0, indicates above-normal risk premiums. Credit conditions are tightening. This often occurs in the build-up to stress events or during periods of uncertainty. Risk management should be heightened, and exposure to credit-sensitive assets may be reduced.
The Normal regime covers Z-scores between -1.0 and 1.0. This represents typical credit conditions where spreads fluctuate around historical averages. Standard investment approaches are appropriate.
The Low regime occurs when spreads are compressed below a Z-score of -1.0. Investors are accepting below-average compensation for credit risk. This can indicate complacency, strong economic confidence, or excessive risk-taking. While often associated with favorable conditions, extremely tight spreads sometimes precede sudden reversals.
Credit Cycle Dynamics
Beyond static regime classification, the indicator tracks the direction and acceleration of spread movements. This reveals where credit markets stand in the credit cycle.
The Deteriorating phase occurs when spreads are elevated and continuing to widen. Credit conditions are actively worsening. This phase often precedes or coincides with economic downturns.
The Recovering phase occurs when spreads are elevated but beginning to narrow. The worst may be over. Credit conditions are improving from stressed levels. This phase often accompanies the early stages of economic recovery.
The Tightening phase occurs when spreads are low and continuing to compress. Credit conditions are very favorable and improving further. This typically occurs during strong economic expansions but may signal building complacency.
The Loosening phase occurs when spreads are low but beginning to widen from compressed levels. The extremely favorable conditions may be normalizing. This can be an early warning of changing sentiment.
Relationship to Economic Activity
The predictive power of credit spreads for economic activity is well-documented. Gilchrist and Zakrajsek found that the excess bond premium predicts GDP growth, industrial production, and unemployment rates over horizons of one to four quarters.
When credit spreads spike, the cost of corporate borrowing increases. Companies may delay or cancel investment projects. Reduced investment leads to slower growth and eventually higher unemployment. The transmission mechanism runs from financial conditions to real economic activity.
Conversely, tight credit spreads lower borrowing costs and encourage investment. Easy credit conditions support economic expansion. However, excessively tight spreads may encourage over-leveraging, planting seeds for future stress.
Practical Application
For equity investors, credit spreads provide context for market risk. Equities and credit often move together because both reflect corporate health. Rising credit spreads typically accompany falling stock prices. Extremely wide spreads historically have coincided with equity market bottoms, though timing the reversal remains challenging.
For fixed income investors, spread regimes guide sector allocation decisions. During stress regimes, flight to quality favors Treasuries over corporates. During low regimes, spread compression may offer limited additional return for credit risk, suggesting caution on high yield.
For macro traders, credit spreads complement other indicators of financial conditions. Credit stress often leads equity volatility, providing an early warning signal. Cross-asset strategies may use credit regime as a filter for position sizing.
Limitations and Considerations
FRED data updates with a lag, typically one business day for the ICE BofA indices. For intraday trading decisions, more current proxies may be necessary. The data is most reliable on daily timeframes.
Credit spreads can remain at extreme levels for extended periods. Mean reversion signals indicate elevated probability of normalization but do not guarantee timing. The 2008 crisis saw spreads remain elevated for many months before normalizing.
The indicator is calibrated for US credit markets. Application to other regions would require different data sources such as European or Asian credit indices. The relationship between spreads and subsequent economic activity may vary across market cycles and structural regimes.
References
Collin-Dufresne, P., Goldstein, R.S., and Martin, J.S. (2001). The Determinants of Credit Spread Changes. Journal of Finance, 56(6), 2177-2207.
Gilchrist, S., and Zakrajsek, E. (2012). Credit Spreads and Business Cycle Fluctuations. American Economic Review, 102(4), 1692-1720.
Krishnamurthy, A., and Muir, T. (2017). How Credit Cycles across a Financial Crisis. Working Paper, Stanford University.
Setup Keltner BandS MMS + RSI SIGNALS
📊 Keltner Bands with RSI Confirmation – TradingView Script
Introduction
This script combines Keltner Channel logic with Relative Strength Index (RSI) confirmation to provide traders with visual signals and alerts for potential reversals. It is designed for scalping and short-term trading strategies, where precision and quick decision-making are essential.
🔧 How It Works
• Keltner Bands (ATR-based):
• Two sets of bands are plotted around a moving average:
• Band 3 (ATR × 3) – more sensitive, suitable for aggressive entries.
• Band 5 (ATR × 5) – wider, used as a filter or confirmation zone.
• Signals are generated when the price crosses back inside the bands from outside.
• RSI Confirmation:
• RSI is calculated with a customizable period (default: 14).
• Overbought and oversold levels (default: 70/30) are used to filter signals.
• A bearish reversal is confirmed only if RSI is above the overbought level.
• A bullish reversal is confirmed only if RSI is below the oversold level.
📌 Functions and Features
• Visual Signals:
• Triangles plotted above/below candles for Keltner-only signals.
• Additional colored triangles for Keltner + RSI confirmed signals.
• Alerts:
• Configurable alerts for both Keltner-only and RSI-confirmed conditions.
• Messages include the type of reversal and the band level.
• Customizable Parameters:
• Moving average length.
• ATR multipliers (3 and 5).
• RSI length and thresholds.
• Colors for band fills and signals.
🎯 Usage
1. Apply the script to your chart in TradingView.
2. Adjust parameters to fit your trading style (scalping, intraday, swing).
3. Watch for signals:
• Red/green/orange/teal triangles → Keltner-only reversals.
• Maroon/lime/purple/blue triangles → RSI-confirmed reversals.
4. Set alerts to receive notifications when conditions are met.
5. Use RSI confirmation to filter out false signals and increase accuracy.
✅ Benefits
• Clear visualization of reversal zones.
• Dual-layer confirmation (Keltner + RSI).
• Flexible for different timeframes and trading styles.
• Ready-to-use alerts for automation or manual trading.
3 Lines RCI + Psy Signal + RSI Background📌 3 Lines RCI + Psy Signal + RSI Background
This indicator combines three RCI lines, Psychological Line signals, RSI-based background highlights, and ADX strength detection to visualize market momentum, trend strength, and potential reversal zones.
🔍 Main Features
📌 1. Triple RCI (Rank Correlation Index)
Displays Short / Mid / Long RCI
Detects momentum shifts and trend reversals
Highlight zones:
Overbought: +80 ~ +100 (Red Zone)
Oversold: -80 ~ -100 (Green Zone)
📌 2. Psychological Line Signal
Column bars appear only in extreme conditions:
Overbought → Red Bars
Oversold → Green Bars
Helps detect short-term sentiment extremes
📌 3. RSI Background Highlight
Red Background: RSI > Overbought threshold
Green Background: RSI < Oversold threshold
Provides a visual cue of underlying market pressure.
📌 4. ADX Trend Strength
ADX line color shows strength level:
Blue: Weak trend
Yellow: Moderate trend
Red: Strong trend
Useful to identify whether signals occur in a trend or range state.
🎯 Trading Usage Tips
RCI + RSI + Psy confluence can identify strong reversal timing.
Use signals only when ADX is weak or moderate to avoid counter-trading a strong trend.
Combine short/mid RCI crossovers with extreme zones for potential entry timing.
⚙️ Suitable For
Scalping, day trading, swing trading
Stocks, Forex, Crypto, Indices, Commodities
CHOCH & Liquidity Sweep Detectorso think of this one as an upgraded version from the previous liquidity sweep and reversal indicator i shared. This one:
Identifies when price wicks above a swing high then closes below it (bearish sweep 💧)
Identifies when price wicks below a swing low then closes above it (bullish sweep 💧)
Orange labels mark the sweeps with dashed lines showing the liquidity level
CHOCH (Change of Character) Detection
After a liquidity sweep, it watches for structure breaks
Bearish CHOCH: After bullish sweep, price breaks below previous structure low (🔴 SHORT setup)
Bullish CHOCH: After bearish sweep, price breaks above previous structure high (🟢 LONG setup)
Market Structure Tracking
Shows current structure highs/lows with dotted lines
Tracks whether market is in bullish, bearish, or neutral trend
Dashboard (bottom-right)
Shows current trend direction
Liquidity sweep status
CHOCH confirmation
Setup Ready alert when both conditions align
Clear action recommendation
How to use with tf alignment indicator:
Apply both indicators to your 1hr/4hr chart
Wait for alignment (Daily/Weekly/Monthly all bearish or bullish)
Look for liquidity sweep (💧 label appears)
Wait for CHOCH (big red/green label with "CHOCH")
Enter on retest of the broken structure level






















