🧠 Quantum Regime Shift Detector v4.0 — Enhanced Edition🧠 Quantum Regime Shift Detector v4.0 — Enhanced Edition
Overview:
A cutting-edge, AI-weighted market-regime detector that dynamically tracks volatility, trend, and momentum to pinpoint transitions 🟥, stability 🟩, and uncertainty 🟨 in real time.
📊 Dashboard Interpretation
🟩 Stable: Low volatility — range or accumulation phase → great for steady entries or breakouts.
🟥 Transition: High volatility — regime shift → trend changes / explosive moves likely.
🟨 Uncertain: Neutral zone → patience and tight risk control advised.
💡 Key Features
⚙️ Probability Gauge → quantifies shift likelihood (> 70 % = high confidence)
📈 Flow Bias → shows bullish / bearish directional pressure
🔄 Divergence Alerts → Bull / Bear signals anticipate reversals
🧭 S/R Zones → adaptive pivot-based support & resistance
⏫ MTF Analysis → confirm alignment with higher timeframes
🎯 Trading Applications
✅ Enter during 🟩 stable regimes with confirmed bias direction.
⚠️ Trim or hedge when 🟥 transition appears.
🔃 Use divergence alerts for reversal timing and confirmation.
🧩 Customization
🔧 Tune Feature Weights (volatility / trend / momentum)
🧮 Enable Auto Thresholds for adaptive sensitivity
⏱️ Set Confirmation Bars to filter noise
🌐 Toggle MTF Mode for multi-timeframe synergy
📘 Best Practice:
Use on liquid assets (≥ 15 min TF). Combine with price action, VWAP, and volume profiling for the clearest market DNA signals.
✨ Character count: ≈ 1,470 (TradingView limit safe)
อินดิเคเตอร์และกลยุทธ์
Advanced Multi-EMA System with Dashboard📋 Table of Contents-
Overview
Setup & Installation
Indicator Configuration
Trading Signals
Dashboard Interpretation
Trading Strategy
Risk Management
Advanced Features
🎯 Overview
This comprehensive trading system combines multiple EMA timeframes with advanced market analysis to provide complete market context. It's designed for both swing trading and day trading across all timeframes.
⚡ Setup & Installation
Step 1: Access Pine Script Editor
Open TradingView
Select your preferred chart
Click "Pine Editor" at the bottom of the screen
Remove any existing code
Paste the complete script I provided
Click "Add to Chart"
Step 2: Initial Configuration
pinescript
// Basic Setup:
EMA Type: EMA/TMA/RMA/SMA (default: EMA)
Show EMA 9: ON
Show EMA 21: ON
Show EMA 150: ON
Show EMA 200: ON
⚙️ Indicator Configuration
EMA Types Explained:
EMA (Exponential Moving Average): More weight to recent prices
SMA (Simple Moving Average): Equal weight to all prices
RMA (Relative Moving Average): Modified EMA calculation
TMA (Triangular Moving Average): Double-smoothed average
Recommended Settings:
pinescript
// Day Trading (1-15 min charts):
EMA 9: Fast momentum
EMA 21: Short-term trend
EMA 150: Medium-term trend
EMA 200: Long-term trend
// Swing Trading (1H-4H charts):
Use same lengths but adjust trailing stop parameters
📊 Dashboard Interpretation
Trend Analysis Section:
PRIMARY TREND: EMA 150 vs EMA 200 (Long-term)
SECONDARY TREND: EMA 21 vs EMA 150 (Medium-term)
HTF TREND: 1-hour timeframe context
Score Interpretation:
TREND STRENGTH: -1.0 to +1.0
+0.5 to +1.0: Strong Bullish
0 to +0.5: Mild Bullish
-0.5 to 0: Mild Bearish
-1.0 to -0.5: Strong Bearish
MOMENTUM SCORE: RSI-based
Above +0.2: Bullish momentum
Below -0.2: Bearish momentum
VOLATILITY SCORE: ATR-based
Above 0.5: High volatility (caution)
Below 0.5: Low volatility
Volume Analysis:
VOLUME STRENGTH: Current vs average volume
BUYER/SELLER BALANCE: Cumulative delta calculation
🎯 Trading Signals
Long Entry Conditions:
pinescript
1. EMA 150 crosses ABOVE EMA 200
2. Primary Trend shows BULLISH
3. Trend Strength > 0.3
4. Momentum Score > 0
Short Entry Conditions:
pinescript
1. EMA 150 crosses BELOW EMA 200
2. Primary Trend shows BEARISH
3. Trend Strength < -0.3
4. Momentum Score < 0
Entry Confirmation:
Wait for these additional confirmations:
Price closes above EMA 21 for long entries
Price closes below EMA 21 for short entries
Volume strength confirming the move
💡 Trading Strategy
Bullish Market Setup:
text
OVERALL BIAS: STRONG BULLISH
PRIMARY TREND: BULLISH
SECONDARY TREND: BULLISH
TREND STRENGTH: > 0.5
MOMENTUM: > 0.2
ACTION: Look for long entries on pullbacks
Bearish Market Setup:
text
OVERALL BIAS: STRONG BEARISH
PRIMARY TREND: BEARISH
SECONDARY TREND: BEARISH
TREND STRENGTH: < -0.5
MOMENTUM: < -0.2
ACTION: Look for short entries on bounces
Range-bound Market:
text
OVERALL BIAS: NEUTRAL
TREND STRENGTH: -0.3 to +0.3
ACTION: Avoid trend trades, consider mean reversion
🛡️ Risk Management
Position Sizing:
pinescript
// Conservative:
1-2% risk per trade
// Moderate:
2-3% risk per trade
// Aggressive:
3-5% risk per trade (not recommended)
Stop Loss Placement:
Initial Stops:
Long positions: Below recent swing low or EMA 150
Short positions: Above recent swing high or EMA 150
Trailing Stops:
Uses fast EMA (default: 8-period)
Automatically adjusts as price moves in your favor
Can be disabled in settings
Exit Strategies:
Profit Taking:
Take 50% profit at 1:1 risk-reward ratio
Trail remainder with fast EMA
Emergency Exits:
pinescript
// Long Position Exit:
1. Price rejection at highs (bearish engulfing)
2. EMA 9 crosses below EMA 21
3. Close below trailing stop
4. Trend Strength turns negative
// Short Position Exit:
1. Price rejection at lows (bullish engulfing)
2. EMA 9 crosses above EMA 21
3. Close above trailing stop
4. Trend Strength turns positive
🚀 Advanced Features
Multi-Timeframe Analysis:
The script automatically analyzes the 1-hour timeframe to:
Confirm primary trend direction
Identify higher timeframe support/resistance
Avoid trading against major trend
Volume Analysis:
Institutional Activity Detection:
Unusually high volume on breakouts
Declining volume on pullbacks
Buyer/Seller balance showing dominance
Market Structure Assessment:
Bullish Structure:
Price above all EMAs
Higher highs and higher lows
Strong volume on up moves
Bearish Structure:
Price below all EMAs
Lower highs and lower lows
Strong volume on down moves
📈 Practical Trading Examples
Example 1: Perfect Long Setup
text
DASHBOARD READING:
PRIMARY TREND: BULLISH ✅
SECONDARY TREND: BULLISH ✅
TREND STRENGTH: 0.72 ✅
MOMENTUM: 0.35 ✅
VOLUME: STRONG ✅
BUYER/SELLER: 0.45 ✅
MARKET STRUCTURE: BULLISH ✅
TRADING SIGNAL: LONG SETUP ✅
ACTION: Enter long on pullback to EMA 21
STOP LOSS: Below EMA 150
TARGET: Previous resistance level
Example 2: Avoid This Trade
text
DASHBOARD READING:
PRIMARY TREND: BULLISH ✅
SECONDARY TREND: BEARISH ❌
TREND STRENGTH: 0.15 ❌
MOMENTUM: -0.10 ❌
VOLUME: WEAK ❌
BUYER/SELLER: -0.20 ❌
MARKET STRUCTURE: NEUTRAL ❌
TRADING SIGNAL: NO SIGNAL ✅
ACTION: Stay out - conflicting signals
REASON: Weak momentum, bearish secondary trend
🔧 Customization Tips
For Scalpers (1-5 minute charts):
pinescript
ema9_len: 5
ema21_len: 13
fast_ema_stop_len: 3
For Swing Traders (4H-Daily charts):
pinescript
ema9_len: 9
ema21_len: 21
ema150_len: 50
ema200_len: 200
Color Customization:
You can modify colors in the script:
Change color.green to your preferred bullish color
Change color.red to your preferred bearish color
Adjust transparency with color.new(color, transparency)
❌ Common Mistakes to Avoid
Trading Against Primary Trend
Don't go long when PRIMARY TREND is BEARISH
Don't go short when PRIMARY TREND is BULLISH
Ignoring Risk Levels
HIGH RISK warning means reduce position size
LOW RISK means normal trading conditions
Chasing Entries
Wait for pullbacks in trending markets
Don't FOMO when signal appears late
Overriding the System
Trust the dashboard readings
Don't let emotions override signals
✅ Best Practices
Daily Routine:
Check higher timeframes first
Read dashboard before placing trades
Set alerts for key levels
Trade Management:
Set stops immediately after entry
Monitor trailing stops daily
Take partial profits at targets
Performance Tracking:
Keep trade journal
Review dashboard accuracy
Adjust parameters if needed
🆘 Troubleshooting
Common Issues:
Alerts Not Working:
Check TradingView alert settings
Ensure "Once Per Bar" is selected
Verify you're on real-time data
Dashboard Not Showing:
Check "Show Dashboard" is enabled
Ensure you're viewing latest bar
Try refreshing the chart
Lines Not Plotting:
Verify EMA toggles are ON
Check for sufficient historical data
Ensure script compiled without errors
🎉 Conclusion
This system provides everything you need for professional trading:
✅ Clear entry/exit signals
✅ Comprehensive market analysis
✅ Built-in risk management
✅ Real-time alerts
✅ Multi-timeframe context
Remember: No system is perfect. Always combine with price action analysis and proper risk management.
[Statistics] killzone SFPSFP Statistics (ICT Sessions)
This indicator automatically finds and draws the high and low of the Asia, London, and New York trading sessions. It then hunts for Swing Failure Patterns (SFPs) that sweep these key session levels.
The main purpose of this script is to gather statistics on when these high-probability SFPs occur, allowing you to map out and identify the times of day when they are most frequent.
How to Use This Indicator
Set Your SFP Timeframe: In the settings, choose the timeframe you want to hunt for SFPs on (e.g., 1H, 15m). Important: You must also set your main chart to this exact same timeframe for the statistics to be collected correctly.
Define Your Sessions: Go to the "Session Definitions" tab.
Set the Global Timezone to your preferred trading timezone (e.g., "America/New_York"). This controls all session times and table times.
Adjust the start and end times for Asia, London, and NY AM sessions.
You can turn off sessions you don't want to track (like NY Lunch or NY PM).
You can also change the colors and text style for the session boxes here.
Set Confirmation Bars: In "SFP Engine Settings," the "Confirmation Bars" (default is 2) defines how many bars must close after the SFP bar without invalidating the level. An SFP is only "confirmed" and drawn after this period.
0 = Confirms immediately on the SFP candle's close.
2 = Confirms 2 bars after the SFP candle's close.
Read the Statistics: The "Custom SFP Statistics" table will appear on your chart. This table logs every confirmed SFP and tells you:
Which time of day they happen most.
How many were Bearish (swept a high) vs. Bullish (swept a low).
It's set by default to show the "Top 20" most frequent times, sorted chronologically.
Filter Your Chart (Optional): If your chart feels cluttered, go to "Visual Time Filter" and turn it ON.
Set a time window (e.g., "09:30-11:00").
The indicator will now only draw SFP signals that occurred within that specific time window. This is perfect for focusing on a single killzone.
How to Set Up Alerts
You can set up server-side alerts to be notified every time a new SFP is confirmed.
Check the "Enable SFP Alerts" box at the top of the indicator's settings.
Click the "Alert" button (alarm clock icon) on the TradingView toolbar.
In the "Condition" dropdown, select "SFP Statistics (ICT Sessions)".
In the second dropdown, choose "Any alert() function call".
Most Important Step: In the "Message" box, delete any default text and type in this exact placeholder:
{{alert_message}}
Set the trigger to "Once Per Bar Close".
Click "Create".
How Alerts Work (Triggers & Filtering)
Trigger: Alerts are tied to the confirmed signal. An alert will only fire after your "Confirmation Bars" have passed and the SFP is locked in. This prevents you from getting alerts on fake-outs.
Alert Filtering: The alerts are linked to the "Visual Time Filter". If you turn on the Visual Time Filter (e.g., to 09:30-11:00), you will only receive alerts for SFPs that are confirmed within that time window. If an SFP happens at 14:00, the script will ignore it, it will not be drawn, and it will not send you an alert. This allows you to get alerts only for the session you are actively trading.
Note: This is a first draft of this indicator. I will continue to work on it and improve it over time, as it may still contain small bugs.
Acknowledgements:
A big thank you to TFO (tradeforopp). The session detection logic and the visual style for the session boxes were adapted from his excellent "ICT Killzones & Pivots " indicator.
Price Z-ScoreThe goal of this Pine Script is to visually represent how much price deviates from its rolling average via the Z-score statistic in TradingView's indicators section. This script first uses a user-definable "lookback" period (the default is 20 bars) to calculate a moving average and standard deviation. Then it displays the price as an amount of standard deviation greater than or less than the moving average. A moving Z-score is plotted along with three reference lines (+2, 0, -2) to indicate areas of unusual extremes statistically; also, it colors the chart green for when price is in the lower half of the Z-score range (oversold) and red for when price is in the upper half of the Z-score range (overbought). These can be used by traders to recognize price has moved out of normal ranges and is due to revert to its mean.
5min ORB SICKO ModeThe orb strategy is automated. 5m orb concept is coded into an indicator strategy with multiple settings.
Breakout an Reversal Signal Detector with Colored in Bar TrendsThe script detects breakouts and/or reversals: when candles close outside the recent period high or low, it prompts a signal, indicating a change in market trend.
You can customize the bar color to indicate trending phases.
It can be used effectively to identify both breakouts and reversals, making it a versatile tool for trend and reversal analysis.
Simple yet effective.
Enjoy!
Morning Star & Rising Star Detector - Neon CandlesMorning Star & Rising Star to determine several levels and forecast what might happen next with the price.
Fibonacci Retracement (Tita)⚙️ Key Features
Core Functionality
Automatic Swing Detection: Uses ZigZag indicator to identify significant highs and lows
Multiple Fibonacci Modes: Supports both Retracement levels and Timezone projections
Customizable Timeframe: Analyze Fibonacci levels on different timeframes than the current chart
Customization Options
11 Fibonacci Levels: From 0% to 300% with individual color and visibility controls
Flexible Display: Customize line thickness, style, and colors
Label Options: Choose position (Left/Right/Both/Auto) and visibility for both Fibonacci percentages and price levels
ZigZag Visualization: Option to show/hide the underlying ZigZag line
📊 How It Works
Swing Detection: The ZigZag algorithm identifies significant swing highs and lows based on depth, deviation, and backstep parameters
Level Calculation: Draws Fibonacci levels between the last two significant ZigZag points
Dynamic Updates: Automatically updates when new swings are detected and cleans up previous drawings
Visual Enhancement: Uses background coloring to indicate market direction (bullish/bearish)
🎨 Visual Elements
Colored Horizontal Lines: Each Fibonacci level has customizable colors
Percentage Labels: Shows retracement percentages (23.6%, 38.2%, etc.)
Price Labels: Displays exact price levels
ZigZag Connection Line: Visual connection between swing points
Direction-based Background: Subtle background tint indicating trend direction
💡 Trading Applications
Identify potential entry points at key Fibonacci levels
Set profit targets using extension levels (1.618, 2.0, 3.0, etc.)
Determine stop-loss placement below/above Fibonacci support/resistance
Analyze retracement depth for trend strength assessment
ADX + Envelope AutoOptimizer MTF Analyzer🔹 ADX + Envelope AutoOptimizer v8.1
Smart hybrid system combining ADX trend strength and Envelope volatility for dynamic optimization and performance tracking.
Features:
Auto-optimizer (3×3×3 grid: Length, Percent, ADX Threshold)
MTF Analyzer (30m → 1D) with color-coded stats
Real-time self-calculated metrics: Net Profit, Win Rate, Profit Factor
Automatic Buy/Sell/Short/Cover signals
Highlighted best timeframe (green background)
Fully dynamic, no repaint, multi-market compatible
Profit Factor Colors:
> 🟢 >2.0 Excellent 🟩 1.5–2.0 Good 🟡 1.0–1.5 Moderate 🔴 <1.0 Weak
Note:
This tool is designed for analytical and educational purposes only — not financial advice.
OsMA by A8/4 - Limited Edition🌟 **OsMA by A8/4 — The Ultimate Indicator for XAUUSD Trading** 🌟
An intelligent **automated system** designed exclusively for **gold trading**, equipped with everything you need in one tool 🔥
💡 **Key Features of OsMA by A8/4**
✅ **Auto Entry Signals**
Automatically detects trade opportunities using a **refined MACD Histogram formula** for enhanced accuracy.
Displays **LONG/SHORT arrows only on the first bar** to keep your chart clean and readable.
✅ **Auto Take Profit & Stop Loss System (Auto TP/SL)**
Once a signal appears, the system automatically sets:
* **TP1 = +15 USD**
* **TP2 = +25 USD**
* **SL = -10 USD**
These levels are displayed as **dashed lines** on the chart — clear and updated in real-time.
✅ **Smart DCA System (3 Orders)**
Works for both LONG and SHORT positions:
* **Order 1:** Entry upon signal confirmation (after candle close)
* **Order 2:** Entry at 5 USD below/above Order 1
* **Order 3:** Entry at another 5 USD below/above Order 2
The system automatically **calculates the average entry price** and **adjusts the SL** to -10 USD from the average cost.
This helps **spread risk** and **increase recovery potential** when prices rebound 💰
✅ **Specially Designed for XAUUSD Trading**
Compatible with both **Spot Gold** and **TFEX Gold Futures**.
Perfect for traders who value **clear, structured entry and exit strategies**.
Kronos Scalper (RAVINDRA KHADSE) 11.11.2025Nice — below is a ready-to-copy TradingView Pine Script (v5) strategy named “Kronos Scalper”.
It’s a self-contained scalping strategy (non-repainting) with configurable EMAs trend filter, RSI entry filter, ATR-based stop loss / take profit, optional trailing stop, plots and entry/exit labels. Drop it into TradingView’s Pine editor and Add to Chart → Strategy Tester.
Price Action [False Break+BreakOut]⚙️ Core Features
Pivot Point Detection
Customizable Pivot Detection: Set left and right length for pivot identification
Pivot Classification:
Higher High (HH): New high higher than previous high
Lower High (LH): New high but lower than previous high
Higher Low (HL): New low but higher than previous low
Lower Low (LL): New low lower than previous low
Visual Display Options
Triangle Markers: ▲/▼ symbols at pivot points
Price Labels: Display exact price values at pivot points
Support/Resistance Lines: Horizontal lines from pivot points
Fractal Chaos Channel: Display as channel lines
Breakout Detection
Breakout: Close above Pivot High
Breakdown: Close below Pivot Low
Visual Signals: Arrow icons and text labels ⬆️/⬇️
🚨 Special Feature: False Break Detection
How False Break Works
Tracks Recent Breakouts/Breakdowns
Monitors Reversals within specified number of bars
Uses Engulfing Conditions to confirm False Break signals
False Break Settings
Validation Bars: Configurable 1-10 bars for confirmation
Engulfing Check Options:
Include Candle Shadows: Check entire candle (body + shadows)
Body Only: Check only candle body
Customizable Colors and Text Sizes
False Break Signals
💥FalseB!!: False Break upward (Price breaks out then reverses down)
🚀FalseB!!: False Break downward (Price breaks down then reverses up)
📊 Trading Applications
For Price Action Traders
Identify market structure and trends
Locate key support/resistance from pivot points
Detect trend change patterns
For Breakout Trading
Distinguish between genuine breakouts and false breaks
Enter trades on confirmed breakouts
Set stop losses for false break trades
Risk Management
False Break Trading: Enter positions when false break detected
Genuine Breakouts: Wait for confirmation before entering
Use Pivot Levels for TP/SL placement
🎨 Customization Options
Selective Pivot Display: Choose which pivots to show (HH, LH, HL, LL)
Color and Style Adjustments
Bar Limit Settings: Control how many bars to display
Label and Text Size customization
ahmdeew scalping indicator custom scalping indicator for gold (XAUUSD) using MACD and RSI confirmations.
MAOs🌟 **MAOs By A8/4 — The Ultimate Indicator for XAUUSD Trading** 🌟
An intelligent **automated system** designed exclusively for **gold trading**, equipped with everything you need in one tool 🔥
💡 **Key Features of MAOs By A8/4**
✅ **Auto Entry Signals**
Automatically detects trade opportunities using a **refined MACD Histogram formula** for enhanced accuracy.
Displays **LONG/SHORT arrows only on the first bar** to keep your chart clean and readable.
✅ **Auto Take Profit & Stop Loss System (Auto TP/SL)**
Once a signal appears, the system automatically sets:
* **TP1 = +15 USD**
* **TP2 = +25 USD**
* **SL = -10 USD**
These levels are displayed as **dashed lines** on the chart — clear and updated in real-time.
✅ **Smart DCA System (3 Orders)**
Works for both LONG and SHORT positions:
* **Order 1:** Entry upon signal confirmation (after candle close)
* **Order 2:** Entry at 5 USD below/above Order 1
* **Order 3:** Entry at another 5 USD below/above Order 2
The system automatically **calculates the average entry price** and **adjusts the SL** to -10 USD from the average cost.
This helps **spread risk** and **increase recovery potential** when prices rebound 💰
✅ **Specially Designed for XAUUSD Trading**
Compatible with both **Spot Gold** and **TFEX Gold Futures**.
Perfect for traders who value **clear, structured entry and exit strategies**.
DeMarkerindicator is a momentum oscillator designed to evaluate the demand of an asset by comparing recent highs and lows to previous periods. It helps traders identify potential overbought and oversold market conditions with enhanced visual clarity and classic parameter settings.
using a default period of 15 and displaying key reference levels (0.05, 0.1, 0.5, 0.9, and 0.95) to highlight potential reversal or continuation zones.
M&B — Fixed Buy/Sell (v6) - confirmed barsThe Mother & Baby (M&B) Fixed Buy/Sell Indicator marks BUY and SELL signals based on two-candle inside-bar patterns. Signals are fixed and don’t move with new bars. Includes optional ATR filter for stronger setups.
Note:
For analysis and educational use only — not financial advice.
Average Candle Body (24h Rolling)This indicator calculates the average size of candle bodies (|Close – Open|) over the last 24 hours, regardless of your current chart timeframe.
Unlike ATR or ADR, which measure total range (High – Low) or day-to-day volatility, this tool focuses purely on the real body size of candles — a more accurate representation of in-session price momentum and liquidity activity.
🔍 How it works
The script automatically determines how many candles represent the last 24 hours based on your current timeframe (e.g. 288 candles on a 5-minute chart).
It then computes a Simple Moving Average (SMA) of the absolute candle body size across that rolling 24-hour window.
Optionally, the script also plots the current candle body size as a grey histogram for quick comparison.
⚙️ Use cases
Gauge intraday volatility based on average body movement rather than wicks.
Build dynamic stop-loss models (e.g., Stop = 1.2 × AverageBodySize).
Detect periods of compression or expansion in price action.
Filter or confirm setups (e.g., only trade when candle bodies exceed their 24 h average).
📈 Displayed elements
Orange line: average candle body size (rolling 24 hours)
Grey histogram: current candle body size for each bar
Works automatically across all timeframes and assets (crypto, forex, indices, etc.)
💡 Pro tip
This indicator pairs exceptionally well with:
EMA-based momentum systems (e.g. EMA 8/21 crosses)
Session-based reversal or sweep strategies (Asia-London transitions)
VWAP or liquidity-based frameworks where candle compression matters
📘 How to Interpret
When the orange line (24h average candle body) is rising, it indicates that average body sizes are expanding — signaling increasing intraday momentum and participation. This often aligns with periods of higher volatility, stronger trends, or major session opens (London/New York).
When the orange line is falling, it shows contracting body sizes, meaning the market is entering consolidation, reduced volatility, or indecision. Such periods often precede major breakouts or reversals.
Use this reading to:
Avoid false breakouts during low-body periods.
Tighten or widen stops based on real-time market compression or expansion.
Confirm reversals: a shrinking average body after a strong impulse can signal momentum exhaustion.
Market Structure SentinelIt automatically labels key structural points on your chart:
HH (Higher High): Green label above a pivot high that's higher than the previous one—signaling bullish continuation.
HL (Higher Low): Green label below a pivot low that's higher than the previous one—confirming uptrend strength.
LH (Lower High): Red label above a pivot high that's lower than the previous one—warning of potential bearish weakness.
LL (Lower Low): Red label below a pivot low that's lower than the previous one—indicating downtrend momentum.
Volume composition / quantifytools (Kevin mod)Just needed some custom configs -- ALL credit goes to: quantifytools, the OG author and goat. cheers!
Dual EMA Status Table (15m & 30m)It checks whether the 9 EMA is above or below the 21 EMA on:
the 15-minute chart, and
the 30-minute chart,
and then displays their alignment in a table:
Timeframe 9 vs 21 Status
15 min 9 > 21 Bullish
30 min 9 > 21 Bullish
CONFIRM ✅ Bullish
✅ “Bullish Confirm” → 9 EMA > 21 EMA on both → uptrend bias
❌ “Bearish Confirm” → 9 EMA < 21 EMA on both → downtrend bias
⚠️ “Mixed” → 15 m and 30 m disagree → stay neutral or wait
💡 How to Use It as a Trading Signal
You can treat it as a buy/sell framework with confirmation rules:
🔹 Buy (Long) bias
Table shows ✅ Bullish confirmation
9 EMA > 21 EMA on both timeframes
Ideally, price pulls back near one of the EMAs and then bounces
You could enter after a bullish candle close above the EMAs
📍 Example entry rule:
Enter long when “✅ Bullish” appears and price closes above both EMAs on the 15 min chart.
Stop-loss below the 21 EMA or recent swing low.
🔹 Sell (Short) bias
Table shows ❌ Bearish confirmation
9 EMA < 21 EMA on both timeframes
Price retraces upward and rejects near EMAs
📍 Example entry rule:
Enter short when “❌ Bearish” appears and price closes below both EMAs on the 15 min chart.
Stop-loss above 21 EMA or recent swing high.
Market Profile Dominance Analyzer# Market Profile Dominance Analyzer
## 📊 OVERVIEW
**Market Profile Dominance Analyzer** is an advanced multi-factor indicator that combines Market Profile methodology with composite dominance scoring to identify buyer and seller strength across higher timeframes. Unlike traditional volume profile indicators that only show volume distribution, or simple buyer/seller indicators that only compare candle colors, this script integrates six distinct analytical components into a unified dominance measurement system.
This indicator helps traders understand **WHO controls the market** by analyzing price position relative to Market Profile key levels (POC, Value Area) combined with volume distribution, momentum, and trend characteristics.
## 🎯 WHAT MAKES THIS ORIGINAL
### **Hybrid Analytical Approach**
This indicator uniquely combines two separate methodologies that are typically analyzed independently:
1. **Market Profile Analysis** - Calculates Point of Control (POC) and Value Area (VA) using volume distribution across price channels on higher timeframes
2. **Multi-Factor Dominance Scoring** - Weights six independent factors to produce a composite dominance index
### **Six-Factor Composite Analysis**
The dominance score integrates:
- Price position relative to POC (equilibrium assessment)
- Price position relative to Value Area boundaries (acceptance/rejection zones)
- Volume imbalance within Value Area (institutional bias detection)
- Price momentum (directional strength)
- Volume trend comparison (participation analysis)
- Normalized Value Area position (precise location within fair value zone)
### **Adaptive Higher Timeframe Integration**
The script features an intelligent auto-selection system that automatically chooses appropriate higher timeframes based on the current chart period, ensuring optimal Market Profile structure regardless of the trading timeframe being analyzed.
## 💡 HOW IT WORKS
### **Market Profile Construction**
The indicator builds a Market Profile structure on a higher timeframe by:
1. **Session Identification** - Detects new higher timeframe sessions using `request.security()` to ensure accurate period boundaries
2. **Data Accumulation** - Stores high, low, and volume data for all bars within the current higher timeframe session
3. **Channel Distribution** - Divides the session's price range into configurable channels (default: 20 rows)
4. **Volume Mapping** - Distributes each bar's volume proportionally across all price channels it touched
### **Key Level Calculation**
**Point of Control (POC)**
- Identifies the price channel with the highest accumulated volume
- Represents the price level where the most trading activity occurred
- Serves as a magnetic level where price often returns
**Value Area (VA)**
- Starts at POC and expands both upward and downward
- Includes channels until reaching the specified percentage of total volume (default: 70%)
- Expansion algorithm compares adjacent volumes and prioritizes the direction with higher activity
- Defines the "fair value" zone where most market participants agreed to trade
### **Dominance Score Formula**
```
Dominance Score = (price_vs_poc × 10) +
(price_vs_va × 5) +
(volume_imbalance × 0.5) +
(price_momentum × 100) +
(volume_trend × 5) +
(va_position × 15)
```
**Component Breakdown:**
- **price_vs_poc**: +1 if above POC, -1 if below (shows which side of equilibrium)
- **price_vs_va**: +2 if above VAH, -2 if below VAL, 0 if inside VA
- **volume_imbalance**: Percentage difference between upper and lower VA volumes
- **price_momentum**: 5-period SMA of price change (directional acceleration)
- **volume_trend**: Compares 5-period vs 20-period volume averages
- **va_position**: Normalized position within Value Area (-1 to +1)
The composite score is then smoothed using EMA with configurable sensitivity to reduce noise while maintaining responsiveness.
### **Market State Determination**
- **BUYERS Dominant**: Smooth dominance > +10 (bullish control)
- **SELLERS Dominant**: Smooth dominance < -10 (bearish control)
- **NEUTRAL**: Between -10 and +10 (balanced market)
## 📈 HOW TO USE THIS INDICATOR
### **Trend Identification**
- **Green background** indicates buyers are in control - look for long opportunities
- **Red background** indicates sellers are in control - look for short opportunities
- **Gray background** indicates neutral market - consider range-bound strategies
### **Signal Interpretation**
**Buy Signals** (green triangle) appear when:
- Dominance crosses above -10 from oversold conditions
- Previous state was not already bullish
- Suggests shift from seller to buyer control
**Sell Signals** (red triangle) appear when:
- Dominance crosses below +10 from overbought conditions
- Previous state was not already bearish
- Suggests shift from buyer to seller control
### **Value Area Context**
Monitor the information table (top-right) to understand market structure:
- **Price vs POC**: Shows if trading above/below equilibrium
- **Volume Imbalance**: Positive values favor buyers, negative favors sellers
- **Market State**: Current dominant force (BUYERS/SELLERS/NEUTRAL)
### **Multi-Timeframe Strategy**
The auto-timeframe feature analyzes higher timeframe structure:
- On 1-minute charts → analyzes 2-hour structure
- On 5-minute charts → analyzes Daily structure
- On 15-minute charts → analyzes Weekly structure
- On Daily charts → analyzes Yearly structure
This higher timeframe context helps avoid counter-trend trades against the dominant force.
### **Confluence Trading**
Strongest signals occur when multiple factors align:
1. Price above VAH + positive volume imbalance + buyers dominant = Strong bullish setup
2. Price below VAL + negative volume imbalance + sellers dominant = Strong bearish setup
3. Price at POC + neutral state = Potential breakout/breakdown pivot
## ⚙️ INPUT PARAMETERS
- **Higher Time Frame**: Select specific HTF or use 'Auto' for intelligent selection
- **Value Area %**: Percentage of volume contained in VA (default: 70%)
- **Show Buy/Sell Signals**: Toggle signal triangles visibility
- **Show Dominance Histogram**: Toggle histogram display
- **Signal Sensitivity**: EMA period for dominance smoothing (1-20, default: 5)
- **Number of Channels**: Market Profile resolution (10-50, default: 20)
- **Color Settings**: Customize buyer, seller, and neutral colors
## 🎨 VISUAL ELEMENTS
- **Histogram**: Shows smoothed dominance score (green = buyers, red = sellers)
- **Zero Line**: Neutral equilibrium reference
- **Overbought/Oversold Lines**: ±50 levels marking extreme dominance
- **Background Color**: Highlights current market state
- **Information Table**: Displays key metrics (state, dominance, POC relationship, volume imbalance, timeframe, bars in session, total volume)
- **Signal Shapes**: Triangle markers for buy/sell signals
## 🔔 ALERTS
The indicator includes three alert conditions:
1. **Buyers Dominate** - Fires on buy signal crossovers
2. **Sellers Dominate** - Fires on sell signal crossovers
3. **Dominance Shift** - Fires when dominance crosses zero line
## 📊 BEST PRACTICES
### **Timeframe Selection**
- **Scalping (1-5min)**: Focus on 2H-4H dominance shifts
- **Day Trading (15-60min)**: Monitor Daily and Weekly structure
- **Swing Trading (4H-Daily)**: Track Weekly and Monthly dominance
### **Confirmation Strategies**
1. **Trend Following**: Enter in direction of dominance above/below ±20
2. **Reversal Trading**: Fade extreme readings beyond ±50 when diverging with price
3. **Breakout Trading**: Look for dominance expansion beyond ±30 with increasing volume
### **Risk Management**
- Avoid trading during NEUTRAL states (dominance between -10 and +10)
- Use POC levels as logical stop-loss placement
- Consider VAH/VAL as profit targets for mean reversion
## ⚠️ LIMITATIONS & WARNINGS
**Data Requirements**
- Requires sufficient historical data on current chart (minimum 100 bars recommended)
- Lower timeframes may show fewer bars per HTF session initially
- More accurate results after several complete HTF sessions have formed
**Not a Standalone System**
- This indicator analyzes market structure and participant control
- Should be combined with price action, support/resistance, and risk management
- Does not guarantee profitable trades - past dominance does not predict future results
**Repainting Characteristics**
- Higher timeframe levels (POC, VAH, VAL) update as new bars form within the session
- Dominance score recalculates with each new bar
- Historical signals remain fixed, but current session data is developing
**Volume Limitations**
- Uses exchange-provided volume data which varies by instrument type
- Forex and some CFDs use tick volume (not actual transaction volume)
- Most accurate on instruments with reliable volume data (stocks, futures, crypto)
## 🔍 TECHNICAL NOTES
**Performance Optimization**
- Uses `max_bars_back=5000` for extended historical analysis
- Efficient array management prevents memory issues
- Automatic cleanup of session data on new period
**Calculation Method**
- Market Profile uses actual volume distribution, not TPO (Time Price Opportunity)
- Value Area expansion follows traditional Market Profile auction theory
- All calculations occur on the chart's current symbol and timeframe
## 📚 EDUCATIONAL VALUE
This indicator helps traders understand:
- How institutional traders use Market Profile to identify fair value
- The relationship between price, volume, and market acceptance
- Multi-factor analysis techniques for assessing market conditions
- The importance of higher timeframe structure in trade planning
## 🎓 RECOMMENDED READING
To better understand the concepts behind this indicator:
- "Mind Over Markets" by James Dalton (Market Profile foundations)
- "Markets in Profile" by James Dalton (Value Area analysis)
- Volume Profile analysis in institutional trading
## 💬 USAGE TERMS
This indicator is provided as an educational and analytical tool. It does not constitute financial advice, investment recommendations, or trading signals. Users are responsible for their own trading decisions and should conduct their own research and due diligence.
Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
Mother & Baby — Nifty 5m (Bull/Bear)The Mother & Baby — Nifty 5m (Bull/Bear) indicator automatically detects two-bar inside-bar patterns, where the second (child) candle is completely within the previous (mother) candle. It highlights potential bullish or bearish setups using boxes, labels, and alerts. Includes optional ATR filtering, high/low guide lines, and customizable visuals for clear pattern recognition. Designed for educational and analytical use only — not financial advice.






















