True Gap Finder with Revisit DetectionTrue Gap Finder with Revisit Detection
This indicator is a powerful tool for intraday traders to identify and track price gaps. Unlike simple gap indicators, this script actively tracks the status of the gap, visualizing the void until it is filled (revisited) by price.
Key Features:
Active Gap Tracking: Finds gap-up and gap-down occurrences (where Low > Previous High or High < Previous Low) and actively tracks them.
Gap Zones (Clouds): Visually shades the empty "gap zone" (the void between the gap candles), making it instantly obvious where price needs to travel to fill the gap. The cloud disappears automatically once the gap is filled.
Dynamic Labels: automatically displays price labels at the origin of the gap, showing the specific price range (High-Low) that constitutes the gap. Labels are positioned intelligently to avoid cluttering current price action.
Alerts: Configurable alerts notify you the moment a gap is filled.
Customization: Full control over colors, clouds, labels, and alert settings to match your chart style.
How it works: The indicator tracks the most recent gap. If a new gap forms, it becomes the active focus. When price moves back to "close" or "fill" this gap area, the lines and clouds automatically stop plotting, giving you a clean chart that focuses only on open business.
תבניות גרפים
Entry Scanner Conservative Option AKeeping it simple,
Trend,
RSI,
Stoch RSI,
MACD, checked.
Do not have entry where there is noise on selection, look for cluster of same entry signals.
If you can show enough discipline, you will be profitable.
CT
Dynamische Open/Close Levels mit Historie🎯 Key Features
This indicator provides clean, configurable horizontal lines showing the Open and Close prices of a higher chosen timeframe (e.g., the last 5-minute candle), serving as dynamic support and resistance levels.
Unlike traditional indicators that draw messy "steps" across your entire chart, this tool is designed for clarity and precise control.
Controlled History: Easily define how many of the last completed periods (e.g., 5-minute blocks) should remain visible on the chart. Set to 0 for only the current, active levels.
No Stepladder Effect: Uses advanced drawing methods (line.new and object management) to ensure the historical levels remain static and do not clutter your chart history.
Dynamic Labels: The labels (e.g., "Open (5)") automatically adjust to show the timeframe you configured in the indicator settings, eliminating confusion when switching timeframes.
Customizable: Full control over colors, line length, and label positioning/size.
💡 Ideal Use Case
Perfect for scalpers and day traders operating on lower timeframes (1m, 3m) who want to quickly visualize and respect crucial price action levels from a higher context (e.g., 5m, 15m, 1h).
Bar Number IndicatorBar Number Indicator
This Pine Script indicator is designed to help intraday traders by automatically numbering candlesticks within a user-defined trading session. This is particularly useful for strategies that rely on specific bar counts (e.g., tracking the 1st, 18th, or 81st bar of the day).
Key Features:
Session-Based Counting: Automatically resets the count at the start of each new session (default 09:30 - 16:00).
Timezone Flexibility: Includes a dropdown to select your specific trading timezone (e.g., America/New_York), ensuring accurate session start times regardless of your local time or the exchange's default setting.
Smart Display Modes: Choose to show "All" numbers, or filter for "Odd" / "Even" numbers to keep your chart clean.
Custom Positioning: Easily place the numbers Above or Below the candlesticks.
Minimalist Design: Numbers are displayed as floating text without distracting background bubbles.
Initial Balance with AlertsThis indicator is a comprehensive tool for Auction Market Theory (AMT) practitioners who rely on the Initial Balance (IB) to determine the day's likely structure. It automatically plots the High and Low of the opening session (user-definable) and extends those levels to provide key support and resistance zones for the remainder of the trading day.
Unlike standard IB indicators, this script features Smart Alerts that are time-filtered. You can define a specific "Active Alert Window" (e.g., RTH only) to ensure you are notified of breakouts during key hours, while avoiding spam notifications during overnight or low-volume sessions.
Key Features:
1. Customizable Initial Balance
Flexible Session: Define the exact start and end time for your IB calculation (Default: 08:30–09:30).
Visual Clarity: Plots IB High, IB Low, and the 50% Midpoint with fully customizable line styles, colors, and widths.
2. Smart Time-Filtered Alerts
Breakout Detection: Triggers an alert when price crosses above the IB High or below the IB Low.
Session Filter: Includes a unique "Allowed Alert Time" input. Alerts will only fire if the breakout happens within this window (Default: 08:30–15:00), preventing unwanted notifications during overnight chop.
3. Advanced Extensions & Targets
Extensions: Option to display multiples of the IB range (2x, 3x) to serve as statistical targets for trend days.
Intermediate Levels: Option to display half-step extensions (e.g., 1.5x) for tighter scalping targets.
4. IB Delta Analytics Dashboard
Context is Key: An optional on-screen dashboard tracks the size of the Initial Balance over the last 20 days.
Sentiment: Automatically categorizes today's IB as "Huge," "Medium," or "Small" compared to the 20-day average. This helps you anticipate if the day is likely to be a "Range Day" (Large IB) or a "Trend Day" (Small IB).
Settings Overview:
Calculation Period: The time used to measure the high and low (e.g., first 60 mins).
Allowed Alert Time: The window during which alerts are active.
Show Extra Levels: Toggles the 2x and 3x extensions.
Fill IB Areas: Adds a background color to the opening range for better visibility.
Delta Analytics: Toggles the statistics table on/off.
Author's Instructions
How to Configure the Time Settings: This script uses two distinct time inputs to give you maximum control:
"Calculation period": This is when the script measures the High and Low.
Example: 0830-0930 (The first hour of the NYSE session).
"Allowed Alert Time (RTH)": This is when the script is allowed to send you alerts.
Example: 0830-1500 (The full trading day).
Why this matters: If price breaks the IB High at 18:00 (during the overnight session), the script will ignore it if your alert time ends at 15:00. This saves you from waking up to low-probability signals.
Setting Up Alerts: To activate the alerts, add the indicator to your chart, click the "Alerts" button (clock icon) in the top toolbar, select this indicator from the "Condition" list, and choose "Any alert() function call".
Disclaimer: This tool is for informational purposes only. Past performance does not guarantee future results.
XAUUSD Session Move Stats (Last 14 Days)This indicator analyzes Gold (XAUUSD) session behavior over the last 14 days and calculates how price typically moves during the Asia, London, and New York sessions.
For each session, it shows:
Average Max Up (%) – how far price moves up from session open
Average Max Down (%) – how far price moves down from session open
Average Net Close (%) – where price typically finishes relative to the session open
The data is calculated session-by-session and displayed in a table, helping traders understand session bias, volatility tendencies, and directional behavior.
Best used on intraday timeframes for session-based analysis and contextual trade planning (signals only, no automated trades).
AMT Structure: 80% Traverse, PD Levels & nPOCsHere is a clean, professional description formatted for the TradingView description box. It highlights the methodology (AMT/80% Rule), the specific features, and the credits.
Title: AMT Structure: 80% Traverse, PD Levels & nPOCs
Description:
This indicator is a comprehensive toolkit designed for futures traders utilizing Auction Market Theory (AMT) and Volume Profile strategies. It consolidates multiple scripts into a single, unified overlay to declutter your chart while providing essential structural references for the 80% Traverse setup, intraday context, and longer-term auction targets.
Key Features:
1. 80% Rule / Traverse Setup (Chart Champions Logic)
Automated RTH Open Detection: Hardcoded to the 08:30 AM CT Open to ensure accuracy for US Futures (ES/NQ) regardless of your chart's timezone settings.
Value Area Logic: Automatically calculates the Previous Day's Value Area High (VAH), Value Area Low (VAL), and Point of Control (POC).
Setup Detection: If the market opens outside of the previous day's value, the script highlights the Value Area in color (default: Purple), signaling that an 80% traverse (filling the value area) is structurally possible if price re-enters value.
Background Fill: Optional shading between VAH and VAL to clearly visualize the "playing field" for the traverse.
2. Auction Market Theory (AMT) Premarket Levels
Overnight High/Low: Automatically captures the highest and lowest prices traded during the overnight session (17:00 - 08:30 CT).
Breakout Alerts: Includes logic to detect and alert when these overnight levels are broken during the RTH session.
Auto-Cleanup: Lines can be set to auto-delete after a specified time (default: 60 mins into the session) to keep the chart clean after the Initial Balance (IB) period.
3. Structural Reference Levels
Previous Day Levels: Plots Previous Day High, Low, and Equilibrium (Midpoint) as standard reference lines.
Initial Balance (IB): Option to display the First Hour High and Low (08:30 - 09:30 CT) to assess day type (Neutral, Trend, Normal Variation, etc.).
RTH VWAP: An anchored VWAP that resets specifically at the RTH Open (08:30 CT), distinct from the standard 24-hour VWAP.
4. Naked Points of Control (nPOCs)
Multi-Timeframe Tracking: Tracks and plots Naked POCs for Daily, Weekly, and Monthly profiles.
Auto-Cleanup: Lines automatically delete themselves the moment price touches them, ensuring you only see untested levels.
Customization: Toggle each timeframe on/off individually.
Settings & Customization:
Global Offset: Move all text labels to the right with a single setting to prevent price action from obscuring text.
8:30 Open Offset: Independent offset for the Open label to distinguish it from other opening references.
Smart Coloring: Text labels automatically match their corresponding line colors for easy identification.
Modular Toggles: Every section (AMT, VWAP, PD Levels, CCV, nPOCs) can be turned on or off individually to suit your specific trading plan.
Usage: This tool is specifically tuned for ES and NQ futures trading but can be adapted for other instruments. It replaces the need for separate indicators for Overnight Highs/Lows, Previous Day Levels, and Volume Profile targeting.
Single Prints and Poor Highs/Lows [Real-Time]This indicator is designed for traders utilizing Auction Market Theory (AMT) who need real-time visibility into market structure inefficiencies. Unlike standard TPO tools that often wait for closed bars or finished sessions, this script builds a developing TPO profile tick-by-tick to identify Single Prints and Poor Highs/Lows the moment they form.
Key Features:
Real-Time Single Prints: Automatically detects and highlights areas of single-print inefficiencies (buying/selling tails) as they happen. These "ghost" boxes persist on the chart until price repairs (fills) them, acting as immediate targets or support/resistance zones.
Poor High/Low Detection: Strictly implements AMT logic to identify "unfinished" auctions. If a session extreme is formed by two or more TPO blocks (indicating a flat top/bottom rather than a rejection tail), it marks the level with a dotted line.
Repair Logic: Both Single Prints and Poor High/Low lines are dynamic. If price revisits and repairs the structure, the markers automatically vanish to keep your chart clean.
Session Control: Fully customizable RTH (Regular Trading Hours) session input (default 08:30–15:15) to ensure profiles are built on relevant liquidity.
Quantization: Adjustable "Ticks per Block" allowing you to tune the sensitivity of the TPO profile to different assets (ES, NQ, CL, etc.).
How It Works:
TPO Construction: The script breaks the session into 30-minute periods (configurable) and tracks price overlap.
Single Prints: When the market expands rapidly, leaving gaps in the profile (single TPO blocks), a box is drawn. If price trades back through this box, it deletes itself.
Poor Extremes: It monitors the current session High and Low. If the extreme price level has a TPO count of ≥ 2, it is flagged as "Poor." If the extreme is a single print (count = 1), it is considered a valid tail and left unmarked.
Settings:
RTH Session: Define your specific trading session time.
TPO Period: Default is 30 minutes (standard AMT).
Ticks per Block: Controls the vertical resolution of the TPO. (Higher values = coarser profile, Lower values = more precision).
Colors: Fully customizable colors for Live Prints, Historical Prints, and Poor High/Low lines.
Usage:
Use this tool to spot immediate structural targets. A Poor High often acts as a magnet for price to revisit and "repair," while Single Prints often defend as support/resistance on the first retest.
Volume Delta Divergence Candle ColorThis indicator identifies divergences between price action and volume delta, highlighting potential reversal or continuation signals by coloring candles when buyer/seller pressure conflicts with the candle's direction.
**How It Works:**
The indicator analyzes real-time up/down volume data to detect two types of divergences:
🟣 **Seller Divergence (Fuscia)** - Occurs when a candle closes bullish (green) but the volume delta is negative, indicating more selling pressure despite the upward price movement. This suggests weak buying or potential distribution.
🔵 **Buyer Divergence (Cyan)** - Occurs when a candle closes bearish (red) but the volume delta is positive, indicating more buying pressure despite the downward price movement. This suggests weak selling or potential accumulation.
**Features:**
✓ Colors only divergent candles - non-divergent candles maintain your chart's default colors
✓ Uses actual exchange volume delta data (works best with CME futures and other instruments with tick-level data)
✓ Optional triangle markers above/below divergent candles for quick visual identification
✓ Clean, minimal design that doesn't clutter your chart
**Best Used For:**
- Identifying potential reversals or continuations
- Spotting weak price movements that may not follow through
- Confirming price action with underlying volume pressure
- Works on any timeframe with available volume delta data
**Note:** This indicator requires volume data from exchanges that provide tick-level information (CME futures, cryptocurrency exchanges, etc.). Results may vary on instruments with limited volume data.
Volatility High/Low Projection (PHOD / PLOD)AP Capital – Volatility + High/Low Projection
This indicator is designed to identify high-probability intraday turning points by combining daily range statistics, session behaviour, and volatility context into a single clean framework.
It is built for index, forex, and metals traders who want structure, not noise.
🔹 Core Features
1️⃣ Potential High of Day (PHOD) & Potential Low of Day (PLOD)
The indicator highlights likely intraday extremes based on:
Session timing (Asia, London, New York)
Current day volatility vs historical averages
Prior day expansion or compression behaviour
Each level is displayed with:
A clear label (PHOD / PLOD)
A forward-extending box acting as a live Point of Interest (POI)
Automatic invalidation when price breaks the zone
2️⃣ Volatility & Range Context (Info Panel)
A compact information panel in the top-right corner provides real-time context without cluttering the chart:
20-Day Average Range
% of the average range already used today
Range status (NORMAL / EXHAUSTED)
Average session ranges for:
Asia
London
New York
This allows traders to immediately assess whether price is:
Early in the day with room to trend
Statistically stretched and prone to reversal
Over-extended where breakout chasing is risky
3️⃣ Session-Aware Logic
The model respects how markets behave across the trading day:
Asia favours accumulation and potential lows
London provides expansion
New York often delivers distribution or exhaustion
This prevents random high/low marking and focuses only on structurally meaningful levels.
🧠 How to Use
Use PHOD / PLOD boxes as reaction zones, not blind entries
Combine with your own confirmation (structure break, momentum, volume, EMA reclaim, etc.)
Avoid chasing trades when the Range Status = EXHAUSTED
Particularly effective on 15m – 1h timeframes
⚠️ Important Notes
This indicator does not repaint
It is contextual, not a buy/sell signal generator
Best used as part of a complete trading plan
📈 Suitable Markets
XAUUSD (Gold)
Indices (NASDAQ, S&P 500, DAX)
Major FX pairs
📌 Disclaimer
This indicator is for educational and analytical purposes only.
It does not constitute financial advice. Trading involves risk.
ORB + Killzones - Universal AutoORB + Killzones • Universal Auto
A clean overlay indicator that automatically plots 15-minute Opening Range Breakout (ORB) levels for major global sessions with full DST handling and optional Killzone shading.
Key Features
Universal auto-detection: adapts session times and timezones perfectly for crypto (24/7) and traditional markets (cash hours only)
15-minute ORB high/low lines for Tokyo, Hong Kong, China, London, and New York sessions
Precise DST-aware London (Europe/London) and New York (America/New_York) sessions
Optional translucent Killzone background shading: London Open (0800–1100), NY Open (0930–1100), London Close (1530–1630) — with custom colors and transparency
Individual toggle switches for each session ORB and Killzone display
Clean neon color scheme matching popular retrowave setups (Tokyo teal, HK magenta, China red, London blue, NY gold)
Efficient drawing with persistent lines that extend until session end
No repainting, low resource usage (max 250 lines, 60 labels)
Ideal for ICT/SMC traders who want accurate multi-session ORBs and high-probability Killzone windows on any instrument or timeframe. Works on forex, indices, stocks, and crypto.
Recommend to uncheck timeframes over 1 hour in the Visibility tab of the Settings.
FOMC Sweep Reaction AP Capital – FOMC Sweep Reaction v1.0
AP Capital – FOMC Sweep Reaction v1.0 is a news-reaction and liquidity-based trading tool designed specifically to track and trade FOMC volatility on Gold (XAUUSD) and other highly reactive instruments.
The indicator focuses on liquidity sweeps, structure breaks, and EMA reclaims that commonly occur around Federal Reserve interest-rate decisions and Powell speeches, helping traders identify high-probability reversal or continuation moves after the initial spike.
🔍 What This Indicator Detects
This tool highlights the most repeatable FOMC behaviours observed across multiple months of broker data:
• Sweeps of previous day’s high or low
• Stop-hunt wicks into liquidity pools
• EMA13 reclaim after the news spike
• Break and close beyond short-term structure
• Momentum shift following volatility exhaustion
The goal is not to predict the news, but to react to confirmed price behaviour after liquidity has been taken.
📌 Core Features
• FOMC Sweep Detection
Identifies aggressive wicks into prior highs/lows during news volatility
• EMA Reclaim Confirmation
Uses EMA13 to validate momentum shift after the sweep
• Market Structure Awareness
Filters reactions that fail to break structure to avoid false reversals
• Session-Aligned Logic
Designed around London → NY → FOMC release timing
• Clean Visuals
Minimal chart clutter for fast decision-making during volatile conditions
🧠 How to Use
Wait for FOMC release / Powell speech
Allow price to sweep previous liquidity (PDH / PDL / local extremes)
Observe reclaim of EMA13
Enter only after structure confirmation
Manage trade using EMA trailing or structure-based exits
⚠️ This is a reaction system, not a prediction tool.
📊 Best Use Cases
• XAUUSD (Gold)
• NASDAQ / US indices
• High-impact macro news events
• 5-min to 15-min timeframes
⚠️ Important Notes
• News volatility is extreme — risk management is essential
• Not designed for low-volatility or ranging markets
• Best combined with a clear trading plan and strict risk rules
📎 Disclaimer
This indicator is for educational purposes only and does not constitute financial advice. Trading during high-impact news events involves significant risk.
Zee's A+ MOMO BreakThis just shows an indicator when you have a 5 minute momentum candle that breaks PMH under specific parameters, i.e candle size, wick size, relative volume, time of day, etc. It will plot the PMH with a gold line automatically. Entry would be at the close of the MOMO break. I highly encourage you to back test your results and see how strong this setup is. Any questions feel free to comment or reach out, thanks.
PCR Put-Call Ratio//@version=5
indicator("PCR Put-Call Ratio", overlay=false, precision=4)
// Input parameters
pcrLength = input(20, "PCR Length", group="Settings")
maLength = input(5, "MA Length", group="Settings")
showOI = input(true, "Use Open Interest", group="Settings")
// Get PCR data from CBOE (requires daily data availability)
pcrData = request.security("CBOE:PC", "D", close)
// Calculate moving average of PCR
pcrMA = ta.sma(pcrData, maLength)
// Levels for interpretation
overbought = 1.2
oversold = 0.6
neutral = 0.9
// Plot PCR value
plot(pcrData, title="PCR Value", color=color.blue, linewidth=2)
plot(pcrMA, title="PCR MA", color=color.orange, linewidth=1)
// Add reference lines
hline(overbought, "Overbought (Bearish)", color.red, linestyle=hline.style_dashed)
hline(neutral, "Neutral", color.gray, linestyle=hline.style_dotted)
hline(oversold, "Oversold (Bullish)", color.green, linestyle=hline.style_dashed)
// Background coloring based on sentiment
bgColor = pcrData > overbought ? color.new(color.red, 80) :
pcrData < oversold ? color.new(color.green, 80) :
color.new(color.gray, 90)
bgcolor(bgColor)
ICT Premium/Discount Zones [Exponential-X]Premium/Discount Zones - Visual Market Structure Tool
Overview
This indicator helps traders visualize premium and discount price zones based on recent market structure. It automatically identifies swing highs and lows within a specified lookback period and divides the price range into three key areas: Premium Zone, Equilibrium, and Discount Zone.
What This Indicator Does
The script continuously monitors price action and calculates:
Highest High and Lowest Low within the lookback period
Equilibrium Level - the midpoint between the swing high and low
Premium Zone - the area from equilibrium to the swing high (typically viewed as relatively expensive price levels)
Discount Zone - the area from the swing low to equilibrium (typically viewed as relatively cheap price levels)
Core Calculation Method
The indicator uses pivot point logic to identify significant swing highs and lows based on the pivot strength parameter. It then calculates the highest high and lowest low over the specified lookback period. The equilibrium is computed as the arithmetic mean of these two extremes, creating a fair value reference point.
The zones are dynamically updated as new price data becomes available, ensuring the visualization remains relevant to current market conditions.
Key Features
Dynamic Zone Detection
Automatically adjusts zones based on recent price action
Uses customizable lookback period for flexibility across different timeframes
Employs pivot strength parameter to filter out minor price fluctuations
Visual Clarity
Color-coded zones for easy identification (red for premium, green for discount)
Optional equilibrium line display
Adjustable zone label placement
Customizable color schemes to match your charting preferences
Alert Capabilities
Alerts when price enters the premium zone
Alerts when price enters the discount zone
Alerts when price returns to equilibrium
Helps traders monitor key zone interactions without constant chart watching
Customization Options
Adjustable lookback period (5-500 bars)
Configurable pivot strength for swing detection (1-20 bars)
Control over box extension into the future
Toggle labels and equilibrium line on/off
Full color customization for all visual elements
How to Use This Indicator
Setup
Add the indicator to your chart
Adjust the lookback period to match your trading timeframe (shorter for intraday, longer for swing trading)
Set pivot strength to filter out noise (higher values for major swings, lower for more frequent updates)
Customize colors and labels to your preference
Interpretation
Premium Zone: Price trading here may indicate potential resistance or selling opportunities when aligned with other technical factors
Discount Zone: Price trading here may indicate potential support or buying opportunities when aligned with other technical factors
Equilibrium: Acts as a fair value reference point where price often consolidates or reacts
Trading Applications
This tool works well when combined with other forms of analysis such as:
Trend identification indicators
Volume analysis
Support and resistance levels
Price action patterns
Market structure analysis
Important Considerations
This indicator identifies zones based purely on historical price data
Premium and discount zones are relative to the recent lookback period
The effectiveness varies across different market conditions and timeframes
Should be used as part of a comprehensive trading strategy, not in isolation
Past price structure does not guarantee future price behavior
Technical Details
Calculation Method
Uses Pine Script's ta.pivothigh() and ta.pivotlow() functions for swing detection
Employs ta.highest() and ta.lowest() for range calculation
Updates dynamically with each new bar
Draws zones using box objects for clear visual representation
Performance Optimization
Efficiently manages box and line objects to minimize resource usage
Uses conditional plotting to reduce unnecessary calculations
Limited to essential visual elements for chart clarity
Timeframe Compatibility
This indicator works on all timeframes but the recommended settings vary:
1-5 minute charts: Lookback period 10-20, Pivot strength 3-5
15-60 minute charts: Lookback period 20-50, Pivot strength 5-10
Daily charts: Lookback period 50-100, Pivot strength 10-15
Weekly charts: Lookback period 20-50, Pivot strength 5-10
Adjust these values based on the volatility of your specific instrument.
Limitations and Considerations
What This Indicator Does NOT Do
Does not provide buy or sell signals on its own
Does not predict future price movements
Does not account for fundamental factors or market events
Does not guarantee profitability or accuracy
Market Condition Awareness
In strong trending markets, price may remain in premium or discount zones for extended periods
During ranging conditions, price typically oscillates between zones more predictably
High volatility can cause frequent zone recalculations
Low volatility may result in narrow zones with limited practical use
Risk Considerations
Premium and discount are relative concepts, not absolute values
What appears as a discount zone may continue lower in a downtrend
What appears as a premium zone may continue higher in an uptrend
Always use proper risk management and position sizing
Consider multiple timeframe analysis for context
Version Information
This indicator is written in Pine Script v6, ensuring compatibility with the latest TradingView features and optimal performance.
Final Notes
This tool is designed to enhance your market analysis by providing a clear visual representation of premium and discount price zones. It should be used as one component of a well-rounded trading approach that includes proper risk management, multiple forms of analysis, and realistic expectations about market behavior.
The concept of premium and discount zones is rooted in auction market theory and the idea that price oscillates around fair value. However, traders should understand that these zones are interpretive tools based on historical data and do not constitute trading advice or predictions about future price action.
Remember to backtest any strategy using this indicator on historical data before applying it to live trading, and always trade responsibly within your risk tolerance.
Disclaimer: The information provided by this indicator is for educational and informational purposes only. It does not constitute financial advice, investment advice, trading advice, or any other sort of advice. Always conduct your own research and consult with qualified financial professionals before making trading decisions.
SPX Master Levels & Correlations [Gemini] (v4.2)This will draw on your chart levels of SPX from other time frames low , high and ES
CRS (2 symbols: Ratio or Normalized) + InverseMade for Crosrate comparison By Leo Hanhart
This script is made to do a comparison between two assets under your current chart.
For example if you want to compare SPX over Growth ETF's Below a current asset to find momentum in your stock trading above it
Density Zones (GM Crossing Clusters) + QHO Spin FlipsINDICATOR NAME
Density Zones (GM Crossing Clusters) + QHO Spin Flips
OVERVIEW
This indicator combines two complementary ideas into a single overlay: *this combines my earlier Geometric Mean Indicator with the Quantum Harmonic Oscillator (Overlay) with additional enhancements*
1) Density Zones (GM Crossing Clusters)
A “Density Zone” is detected when price repeatedly crosses a Geometric Mean equilibrium line (GM) within a rolling lookback window. Conceptually, this identifies regions where the market is repeatedly “snapping” across an equilibrium boundary—high churn, high decision pressure, and repeated re-selection of direction.
2) QHO Spin Flips (Regression-Residual σ Breaches)
A “Spin Flip” is detected when price deviates beyond a configurable σ-threshold (κ) from a regression-based equilibrium, using normalized residuals. Conceptually, this marks excursions into extreme states (decoherence / expansion), which often precede a reversion toward equilibrium and/or a regime re-scaling.
These two systems are related but not identical:
- Density Zones identify where equilibrium crossings cluster (a “singularity”/anchor behavior around GM).
- Spin Flips identify when price exceeds statistically extreme displacement from the regression equilibrium (LSR), indicating expansion beyond typical variance.
CORE CONCEPTS AND FORMULAS
SECTION A — GEOMETRIC MEAN EQUILIBRIUM (GM)
We define two moving averages:
(1) MA1_t = SMA(close_t, L1)
(2) MA2_t = SMA(close_t, L2)
We define the equilibrium anchor as the geometric mean of MA1 and MA2:
(3) GM_t = sqrt( MA1_t * MA2_t )
This GM line acts as an equilibrium boundary. Repeated crossings are interpreted as high “equilibrium churn.”
SECTION B — CROSS EVENTS (UP/DOWN)
A “cross event” is registered when the sign of (close - GM) changes:
Define a sign function s_t:
(4) s_t =
+1 if close_t > GM_t
-1 if close_t < GM_t
s_{t-1} if close_t == GM_t (tie-breaker to avoid false flips)
Then define the crossing event indicator:
(5) crossEvent_t = 1 if s_t != s_{t-1}
0 otherwise
Additionally, the indicator plots explicit cross markers:
- Cross Above GM: crossover(close, GM)
- Cross Below GM: crossunder(close, GM)
These provide directional visual cues and match the original Geometric Mean Indicator behavior.
SECTION C — DENSITY MEASURE (CROSSING CLUSTER COUNT)
A Density Zone is based on the number of cross events occurring in the last W bars:
(6) D_t = Σ_{i=0..W-1} crossEvent_{t-i}
This is a “crossing density” score: how many times price has toggled across GM recently.
The script implements this efficiently using a cumulative sum identity:
Let x_t = crossEvent_t.
(7) cumX_t = Σ_{j=0..t} x_j
Then:
(8) D_t = cumX_t - cumX_{t-W} (for t >= W)
cumX_t (for t < W)
SECTION D — DENSITY ZONE TRIGGER
We define a Density Zone state:
(9) isDZ_t = ( D_t >= θ )
where:
- θ (theta) is the user-selected crossing threshold.
Zone edges:
(10) dzStart_t = isDZ_t AND NOT isDZ_{t-1}
(11) dzEnd_t = NOT isDZ_t AND isDZ_{t-1}
SECTION E — DENSITY ZONE BOUNDS
While inside a Density Zone, we track the running high/low to display zone bounds:
(12) dzHi_t = max(dzHi_{t-1}, high_t) if isDZ_t
(13) dzLo_t = min(dzLo_{t-1}, low_t) if isDZ_t
On dzStart:
(14) dzHi_t := high_t
(15) dzLo_t := low_t
Outside zones, bounds are reset to NA.
These bounds visually bracket the “singularity span” (the churn envelope) during each density episode.
SECTION F — QHO EQUILIBRIUM (REGRESSION CENTERLINE)
Define the regression equilibrium (LSR):
(16) m_t = linreg(close_t, L, 0)
This is the “centerline” the QHO system uses as equilibrium.
SECTION G — RESIDUAL AND σ (FIELD WIDTH)
Residual:
(17) r_t = close_t - m_t
Rolling standard deviation of residuals:
(18) σ_t = stdev(r_t, L)
This σ_t is the local volatility/width of the residual field around the regression equilibrium.
SECTION H — NORMALIZED DISPLACEMENT AND SPIN FLIP
Define the standardized displacement:
(19) Y_t = (close_t - m_t) / σ_t
(If σ_t = 0, the script safely treats Y_t = 0.)
Spin Flip trigger uses a user threshold κ:
(20) spinFlip_t = ( |Y_t| > κ )
Directional spin flips:
(21) spinUp_t = ( Y_t > +κ )
(22) spinDn_t = ( Y_t < -κ )
The default κ=3.0 corresponds to “3σ excursions,” which are statistically extreme under a normal residual assumption (even though real markets are not perfectly normal).
SECTION I — QHO BANDS (OPTIONAL VISUALIZATION)
The indicator optionally draws the standard σ-bands around the regression equilibrium:
(23) 1σ bands: m_t ± 1·σ_t
(24) 2σ bands: m_t ± 2·σ_t
(25) 3σ bands: m_t ± 3·σ_t
These provide immediate context for the Spin Flip events.
WHAT YOU SEE ON THE CHART
1) MA1 / MA2 / GM lines (optional)
- MA1 (blue), MA2 (red), GM (green).
- GM is the equilibrium anchor for Density Zones and cross markers.
2) GM Cross Markers (optional)
- “GM↑” label markers appear on bars where close crosses above GM.
- “GM↓” label markers appear on bars where close crosses below GM.
3) Density Zone Shading (optional)
- Background shading appears while isDZ_t = true.
- This is the period where the crossing density D_t is above θ.
4) Density Zone High/Low Bounds (optional)
- Two lines (dzHi / dzLo) are drawn only while in-zone.
- These bounds bracket the full churn envelope during the density episode.
5) QHO Bands (optional)
- 1σ, 2σ, 3σ shaded zones around regression equilibrium.
- These visualize the current variance field.
6) Regression Equilibrium (LSR Centerline)
- The white centerline is the regression equilibrium m_t.
7) Spin Flip Markers
- A circle is plotted when |Y_t| > κ (beyond your chosen σ-threshold).
- Marker size is user-controlled (tiny → huge).
HOW TO USE IT
Step 1 — Pick the equilibrium anchor (GM)
- L1 and L2 define MA1 and MA2.
- GM = sqrt(MA1 * MA2) becomes your equilibrium boundary.
Typical choices:
- Faster equilibrium: L1=20, L2=50 (default-like).
- Slower equilibrium: L1=50, L2=200 (macro anchor).
Interpretation:
- GM acts like a “center of mass” between two moving averages.
- Crosses show when price flips from one side of equilibrium to the other.
Step 2 — Tune Density Zones (W and θ)
- W controls the time window measured (how far back you count crossings).
- θ controls how many crossings qualify as a “density/singularity episode.”
Guideline:
- Larger W = slower, broader density detection.
- Higher θ = only the most intense churn is labeled as a Density Zone.
Interpretation:
- A Density Zone is not “bullish” or “bearish” by itself.
- It is a condition: repeated equilibrium toggling (high churn / high compression).
- These often precede expansions, but direction is not implied by the zone alone.
Step 3 — Tune the QHO spin flip sensitivity (L and κ)
- L controls regression memory and σ estimation length.
- κ controls how extreme the displacement must be to trigger a spin flip.
Guideline:
- Smaller L = more reactive centerline and σ.
- Larger L = smoother, slower “field” definition.
- κ=3.0 = strong extreme filter.
- κ=2.0 = more frequent flips.
Interpretation:
- Spin flips mark when price exits the “normal” residual field.
- In your model language: a moment of decoherence/expansion that is statistically extreme relative to recent equilibrium.
Step 4 — Read the combined behavior (your key thesis)
A) Density Zone forms (GM churn clusters):
- Market repeatedly crosses equilibrium (GM), compressing into a bounded churn envelope.
- dzHi/dzLo show the envelope range.
B) Expansion occurs:
- Price can release away from the density envelope (up or down).
- If it expands far enough relative to regression equilibrium, a Spin Flip triggers (|Y| > κ).
C) Re-coherence:
- After a spin flip, price often returns toward equilibrium structures:
- toward the regression centerline m_t
- and/or back toward the density envelope (dzHi/dzLo) depending on regime behavior.
- The indicator does not guarantee return, but it highlights the condition where return-to-field is statistically likely in many regimes.
IMPORTANT NOTES / DISCLAIMERS
- This indicator is an analytical overlay. It does not provide financial advice.
- Density Zones are condition states derived from GM crossing frequency; they do not predict direction.
- Spin Flips are statistical excursions based on regression residuals and rolling σ; markets have fat tails and non-stationarity, so σ-based thresholds are contextual, not absolute.
- All parameters (L1, L2, W, θ, L, κ) should be tuned per asset, timeframe, and volatility regime.
PARAMETER SUMMARY
Geometric Mean / Density Zones:
- L1: MA1 length
- L2: MA2 length
- GM_t = sqrt(SMA(L1)*SMA(L2))
- W: crossing-count lookback window
- θ: crossing density threshold
- D_t = Σ crossEvent_{t-i} over W
- isDZ_t = (D_t >= θ)
- dzHi/dzLo track envelope bounds while isDZ is true
QHO / Spin Flips:
- L: regression + residual σ length
- m_t = linreg(close, L, 0)
- r_t = close_t - m_t
- σ_t = stdev(r_t, L)
- Y_t = r_t / σ_t
- spinFlip_t = (|Y_t| > κ)
Visual Controls:
- toggles for GM lines, cross markers, zone shading, bounds, QHO bands
- marker size options for GM crosses and spin flips
ALERTS INCLUDED
- Density Zone START / END
- Spin Flip UP / DOWN
- Cross Above GM / Cross Below GM
SUMMARY
This indicator treats the Geometric Mean as an equilibrium boundary and identifies “Density Zones” when price repeatedly crosses that equilibrium within a rolling window, forming a bounded churn envelope (dzHi/dzLo). It also models a regression-based equilibrium field and triggers “Spin Flips” when price makes statistically extreme σ-excursions from that field. Used together, Density Zones highlight compression/decision regions (equilibrium churn), while Spin Flips highlight extreme expansion states (σ-breaches), allowing the user to visualize how price compresses around equilibrium, releases outward, and often re-stabilizes around equilibrium structures over time.
new takesi_2Step_Screener_MOU_KAKU_FIXED4 (Visible)//@version=5
indicator("MNO_2Step_Screener_MOU_KAKU_FIXED4 (Visible)", overlay=true, max_labels_count=500)
// =========================
// Inputs
// =========================
emaSLen = input.int(5, "EMA Short (5)")
emaMLen = input.int(13, "EMA Mid (13)")
emaLLen = input.int(26, "EMA Long (26)")
macdFast = input.int(12, "MACD Fast")
macdSlow = input.int(26, "MACD Slow")
macdSignal = input.int(9, "MACD Signal")
macdZeroTh = input.float(0.2, "MOU: MACD near-zero threshold", step=0.05)
volLookback = input.int(5, "Volume MA days", minval=1)
volMinRatio = input.float(1.3, "MOU: Volume ratio min", step=0.1)
volStrong = input.float(1.5, "Strong volume ratio (Breakout/KAKU)", step=0.1)
volMaxRatio = input.float(3.0, "Volume ratio max (filter)", step=0.1)
wickBodyMult = input.float(2.0, "Pinbar: lowerWick >= body*x", step=0.1)
pivotLen = input.int(20, "Resistance lookback", minval=5)
pullMinPct = input.float(5.0, "Pullback min (%)", step=0.1)
pullMaxPct = input.float(15.0, "Pullback max (%)", step=0.1)
breakLookbackBars = input.int(5, "Pullback route: valid bars after break", minval=1)
// --- Breakout route (押し目なし初動ブレイク) ---
useBreakoutRoute = input.bool(true, "Enable MOU Breakout Route (no pullback)")
breakConfirmPct = input.float(0.3, "Break confirm: close > R*(1+%)", step=0.1)
bigBodyLookback = input.int(20, "Break candle body MA length", minval=5)
bigBodyMult = input.float(1.2, "Break candle: body >= MA*mult", step=0.1)
requireCloseNearHigh = input.bool(true, "Break candle: close near high")
closeNearHighPct = input.float(25.0, "Close near high threshold (% of range)", step=1.0)
allowMACDAboveZeroInstead = input.bool(true, "Breakout route: allow MACD GC above zero instead")
// 表示
showEMA = input.bool(true, "Plot EMAs")
showMou = input.bool(true, "Show MOU label")
showKaku = input.bool(true, "Show KAKU label")
// ★ここを改善:デバッグ表はデフォルトON
showDebugTbl = input.bool(true, "Show debug table (last bar)")
// ★稼働確認ラベル(最終足に必ず出す)
showStatusLbl = input.bool(true, "Show status label (last bar always)")
locChoice = input.string("Below Bar", "Label location", options= )
lblLoc = locChoice == "Below Bar" ? location.belowbar : location.abovebar
// =========================
// EMA
// =========================
emaS = ta.ema(close, emaSLen)
emaM = ta.ema(close, emaMLen)
emaL = ta.ema(close, emaLLen)
plot(showEMA ? emaS : na, color=color.new(color.yellow, 0), title="EMA 5")
plot(showEMA ? emaM : na, color=color.new(color.blue, 0), title="EMA 13")
plot(showEMA ? emaL : na, color=color.new(color.orange, 0), title="EMA 26")
emaUpS = emaS > emaS
emaUpM = emaM > emaM
emaUpL = emaL > emaL
goldenOrder = emaS > emaM and emaM > emaL
above26_2days = close > emaL and close > emaL
// 勝率維持の土台(緩めない)
baseTrendOK = (emaUpS and emaUpM and emaUpL) and goldenOrder and above26_2days
// =========================
// MACD
// =========================
= ta.macd(close, macdFast, macdSlow, macdSignal)
macdGC = ta.crossover(macdLine, macdSig)
macdUp = macdLine > macdLine
macdNearZero = math.abs(macdLine) <= macdZeroTh
macdGCAboveZero = macdGC and macdLine > 0 and macdSig > 0
macdMouOK = macdGC and macdNearZero and macdUp
macdBreakOK = allowMACDAboveZeroInstead ? (macdMouOK or macdGCAboveZero) : macdMouOK
// =========================
// Volume
// =========================
volMA = ta.sma(volume, volLookback)
volRatio = volMA > 0 ? (volume / volMA) : na
volumeMouOK = volRatio >= volMinRatio and volRatio <= volMaxRatio
volumeStrongOK = volRatio >= volStrong and volRatio <= volMaxRatio
// =========================
// Candle patterns
// =========================
body = math.abs(close - open)
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
pinbar = (lowerWick >= wickBodyMult * body) and (lowerWick > upperWick) and (close >= open)
bullEngulf =
close > open and close < open and
close >= open and open <= close
bigBull =
close > open and
open < emaM and close > emaS and
(body > ta.sma(body, 20))
candleOK = pinbar or bullEngulf or bigBull
// =========================
// Resistance / Pullback route
// =========================
res = ta.highest(high, pivotLen)
pullbackPct = res > 0 ? (res - close) / res * 100.0 : na
pullbackOK = pullbackPct >= pullMinPct and pullbackPct <= pullMaxPct
brokeRes = ta.crossover(close, res )
barsSinceBreak = ta.barssince(brokeRes)
afterBreakZone = (barsSinceBreak >= 0) and (barsSinceBreak <= breakLookbackBars)
pullbackRouteOK = afterBreakZone and pullbackOK
// =========================
// Breakout route (押し目なし初動ブレイク)
// =========================
breakConfirm = close > res * (1.0 + breakConfirmPct / 100.0)
bullBreak = close > open
bodyMA = ta.sma(body, bigBodyLookback)
bigBodyOK = bodyMA > 0 ? (body >= bodyMA * bigBodyMult) : false
rng = math.max(high - low, syminfo.mintick)
closeNearHighOK = not requireCloseNearHigh ? true : ((high - close) / rng * 100.0 <= closeNearHighPct)
mou_breakout =
useBreakoutRoute and
baseTrendOK and
breakConfirm and
bullBreak and
bigBodyOK and
closeNearHighOK and
volumeStrongOK and
macdBreakOK
mou_pullback = baseTrendOK and volumeMouOK and candleOK and macdMouOK and pullbackRouteOK
mou = mou_pullback or mou_breakout
// =========================
// KAKU (Strict): 8条件 + 最終三点
// =========================
cond1 = emaUpS and emaUpM and emaUpL
cond2 = goldenOrder
cond3 = above26_2days
cond4 = macdGCAboveZero
cond5 = volumeMouOK
cond6 = candleOK
cond7 = pullbackOK
cond8 = pullbackRouteOK
all8_strict = cond1 and cond2 and cond3 and cond4 and cond5 and cond6 and cond7 and cond8
final3 = pinbar and macdGCAboveZero and volumeStrongOK
kaku = all8_strict and final3
// =========================
// Display (猛 / 猛B / 確)
// =========================
showKakuNow = showKaku and kaku
showMouPull = showMou and mou_pullback and not kaku
showMouBrk = showMou and mou_breakout and not kaku
plotshape(showMouPull, title="MOU_PULLBACK", style=shape.labelup, text="猛",
color=color.new(color.lime, 0), textcolor=color.black, location=lblLoc, size=size.tiny)
plotshape(showMouBrk, title="MOU_BREAKOUT", style=shape.labelup, text="猛B",
color=color.new(color.lime, 0), textcolor=color.black, location=lblLoc, size=size.tiny)
plotshape(showKakuNow, title="KAKU", style=shape.labelup, text="確",
color=color.new(color.yellow, 0), textcolor=color.black, location=lblLoc, size=size.small)
// =========================
// ★稼働確認:最終足に必ず出すステータスラベル
// =========================
var label status = na
if showStatusLbl and barstate.islast
label.delete(status)
statusTxt =
"MNO RUNNING " +
"MOU: " + (mou ? "YES" : "no") + " (pull=" + (mou_pullback ? "Y" : "n") + " / brk=" + (mou_breakout ? "Y" : "n") + ") " +
"KAKU: " + (kaku ? "YES" : "no") + " " +
"BaseTrend: " + (baseTrendOK ? "OK" : "NO") + " " +
"MACD(mou): " + (macdMouOK ? "OK" : "NO") + " / MACD(zeroGC): " + (macdGCAboveZero ? "OK" : "NO") + " " +
"Vol: " + (na(volRatio) ? "na" : str.tostring(volRatio, format.mintick)) + " " +
"Pull%: " + (na(pullbackPct) ? "na" : str.tostring(pullbackPct, format.mintick))
status := label.new(bar_index, high, statusTxt, style=label.style_label_left,
textcolor=color.white, color=color.new(color.black, 0))
// =========================
// Alerts
// =========================
alertcondition(mou, title="MNO_MOU", message="MNO: MOU triggered")
alertcondition(mou_breakout, title="MNO_MOU_BREAKOUT", message="MNO: MOU Breakout triggered")
alertcondition(mou_pullback, title="MNO_MOU_PULLBACK", message="MNO: MOU Pullback triggered")
alertcondition(kaku, title="MNO_KAKU", message="MNO: KAKU triggered")
// =========================
// Debug table (optional)
// =========================
var table t = table.new(position.top_right, 2, 14, border_width=1, border_color=color.new(color.white, 60))
fRow(_name, _cond, _r) =>
bg = _cond ? color.new(color.lime, 70) : color.new(color.red, 80)
tx = _cond ? "OK" : "NO"
table.cell(t, 0, _r, _name, text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(t, 1, _r, tx, text_color=color.white, bgcolor=bg)
if showDebugTbl and barstate.islast
table.cell(t, 0, 0, "MNO Debug", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(t, 1, 0, "", text_color=color.white, bgcolor=color.new(color.black, 0))
fRow("BaseTrend", baseTrendOK, 1)
fRow("MOU Pullback", mou_pullback, 2)
fRow("MOU Breakout", mou_breakout, 3)
fRow("Break confirm", breakConfirm, 4)
fRow("Break big body", bigBodyOK, 5)
fRow("Break close high", closeNearHighOK, 6)
fRow("Break vol strong", volumeStrongOK, 7)
fRow("Break MACD", macdBreakOK, 8)
fRow("KAKU all8", all8_strict, 9)
fRow("KAKU final3", final3, 10)
fRow("MOU any", mou, 11)
fRow("KAKU", kaku, 12)
Asian Sweep Strat by MindEdgeThe idea with the indicator is to highlight the asian range, so when price goes below or above it during frankfurt and london open overlap, we can trade price to the opposite direction




















