market-data[t90]Core Functionality
The dashboard tracks five key metrics across multiple time horizons (Current, 24-Hour Change, and 30-Day Trend):
Open Interest (OI): Tracks the total value of outstanding derivative contracts. Rising OI alongside rising price typically confirms a strong trend, while falling OI suggests a squeeze or trend exhaustion.
Premium/Funding: Visualizes the cost of carry or price discrepancy between Perpetual and Spot markets. This is a vital gauge for identifying extreme bullish or bearish sentiment.
Spot Volume: Real-time volume data from the underlying spot market to confirm "real" buying and selling pressure.
Perpetual Volume: High-frequency derivative volume to track speculative activity.
Perp/Spot Ratio: A unique ratio that compares speculative volume to organic spot volume. High ratios often precede periods of high volatility or potential liquidations.
Key Features
Automatic Ticker Mapping: The script intelligently detects if you are on a Spot or Perp chart and automatically fetches the corresponding data from Binance to populate the table.
Visual Trend Indicators: Uses color-coded logic to highlight short-term momentum (1-day) versus long-term trend health (30-day).
Customizable UI: Fully adjustable table positioning and sizing to fit any chart layout or screen resolution.
Live Status Check: Includes a data-integrity monitor to ensure you are viewing the most up-to-date market information.
How to Use
Spotting Divergences: If the Perpetual volume is surging while Spot volume remains flat (High Perp/Spot Ratio), the market may be over-leveraged and prone to a "flush."
Confirming Breakouts: A healthy price breakout should ideally be accompanied by rising Open Interest and positive Spot volume growth.
Sentiment Extremes: Monitor the "Premium" section; extreme positive or negative values often signal that the crowd is "all-in" on one side, hinting at a potential reversal.
Disclaimer: This tool is for informational and educational purposes only. Market data is sourced from third-party providers and may be subject to latency. Trading involves significant risk.
Educational
ADR from 50 SMA - Histogram & LabelMore inside the script
INDICATOR PURPOSE:
This indicator measures how far price has moved from the 50-period SMA
in terms of Average Daily Range (ADR). It helps identify:
- When stocks are overextended and may be due for pullback/consolidation
- Potential entry/exit points based on momentum extremes
- Position trimming opportunities when price is stretched
INTERPRETATION:
- Positive values = Price is ABOVE the 50 SMA
- Negative values = Price is BELOW the 50 SMA
- Higher absolute values = More extreme/stretched moves
- Values >2 or <-2 typically indicate overextended conditions
Macro Risk SentimentOverview
This indicator provides a simple traffic light for your trading: green means go, red means slow down.
The background color appears directly on your price chart and in the oscillator pane below. When green, macro conditions favor risk assets and you can trade with full conviction. When red, the indicator suggests reducing position sizes, tightening stops, or stepping aside entirely.
The oscillator pane shows the underlying calculation so you can see how close the market is to flipping regimes.
The Core Idea
Markets move in risk cycles. When institutional money is confident, it flows into equities, high-yield bonds, and away from safe havens. When fear takes over, money rotates into treasuries, the dollar strengthens, and volatility spikes.
This indicator reads those flows by monitoring four markets simultaneously:
Risk-On Signals (good for stocks when rising)
TLT - Long-term Treasury bonds
JNK - High-yield corporate credit
Risk-Off Signals (bad for stocks when rising)
DXY - US Dollar strength
VIX - Market volatility
When bonds and credit are strong relative to their recent history while the dollar and volatility are weak, the background turns green. You have a tailwind. When the opposite occurs, the background turns red. You are fighting the current.
How It Works
Step 1: Z-Score Normalization
Each input is converted to a z-score: how many standard deviations the current value is from its 252-day rolling average. This puts all four inputs on a comparable scale regardless of their absolute price levels.
Step 2: Composite Calculation
Macro Score = (TLT z-score + JNK z-score) minus (DXY z-score + VIX z-score)
Risk-on inputs contribute positively when elevated. Risk-off inputs subtract when elevated. The result is clamped between -1.5 and +1.5 and smoothed with EMAs.
Step 3: State Machine
The indicator uses crossover-based transitions with memory:
RISK ON triggers when the smoothed macro line crosses above its signal line.
RISK OFF triggers when the macro line crosses below its signal line, or when price breaks below its EMA while the macro value is negative (double confirmation exit).
How to Use It
Green Background - Full Steam Ahead
Macro conditions support risk-taking. This is when trend-following strategies tend to work best. Use normal position sizes, take breakout trades, and hold winners longer.
Red Background - Reduce Risk
The macro wind is against you. Consider smaller positions, quicker profit-taking, or sitting out entirely. Mean-reversion setups may work better than trend-following during these periods. Many major drawdowns occur during red regimes.
The Oscillator Pane
The colored line is the macro reading, the white line is its signal. When the colored line crosses above the signal, conditions turn bullish. When it crosses below, conditions turn bearish. The zero line represents neutral. Positive values mean macro conditions are better than the one-year average.
What Makes This Original
This implementation combines z-score normalization across multiple asset classes with a state machine approach that reduces whipsaws. The price filter acts as a circuit breaker but only triggers exits when macro conditions are also deteriorating, preventing premature exits during temporary price weakness.
Settings Guide
Main Settings
Z-Score Lookback (default 252) - Period for calculating mean and standard deviation. 252 bars equals one trading year on daily charts.
Macro EMA (default 7) - Smoothing applied to the raw composite score.
Signal EMA (default 8) - Secondary smoothing for the crossover signal line.
Price Filter
Enable Price Filter (default On) - When enabled, price breaking below the EMA triggers an exit only if the macro value is also negative.
EMA Length (default 20) - The EMA period for the price filter.
Data Sources
Each source (TLT, JNK, DXY, VIX) can be enabled or disabled and weighted from 0 to 3. Default is equal weighting (1.0) for all sources.
Limitations
This is a daily-timeframe indicator. On intraday charts, signals reflect yesterday's macro reading until the day closes.
The z-score lookback creates recency bias. What was normal over the past year may not reflect longer-term historical norms.
Intermarket correlations can change. What worked in recent decades may shift in different monetary regimes.
Not all equity drawdowns come with macro warning. Flash crashes and idiosyncratic events can occur without macro deterioration.
The indicator identifies conditions, not predictions. Green does not guarantee gains. Red does not guarantee losses.
Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice.
Green background does not mean buy. Red background does not mean sell. These are environmental readings to help you calibrate your risk-taking, not trade signals.
Past intermarket relationships do not guarantee future behavior. Always conduct your own research. Consider your personal risk tolerance. Never risk more than you can afford to lose.
India Union Budget Days Marker🇮🇳 India Union Budget Day Marker
This indicator marks Indian Union Budget presentation days directly on the chart using a single vertical line, making it easy to visually identify how markets behave around budget announcements.
The dates are hard-coded for historical accuracy and extended to future years based on the standard 1st February schedule.
What this indicator does
Draws one vertical line on each Union Budget day
Covers historical budget dates from 1980 onward
Marks future budget days up to the next 5 years, assuming 1st February
Works on daily and intraday charts
Does not repaint and does not rely on external data
Why this is useful
Study volatility, gaps, and trend behavior on budget days
Analyze pre-budget and post-budget price action
Identify structural changes, continuations, or reversals
Useful for investors, swing traders, and intraday traders
Customization
You can adjust:
Line color
Line style (solid, dashed, dotted)
Line thickness
Important notes
Vertical lines appear only when price data exists for that date
Future budget lines will show automatically when those dates are reached.
Past years include both interim and full budgets where applicable.
Recommended use
Combine this indicator with:
Price action analysis
Trend and bias tools
Volatility or range expansion studies
Event-based market behavior analysis
This indicator is designed to provide context, not signals.
Use it to understand when an important macro event occurred, not to predict market direction.
HFT Price Action Framework[by Abhishek]This indicator helps traders spot high-probability BUY & SELL opportunities by combining trend direction and momentum into a simple, clean visual format.
It is designed to remove noise and keep you focused on only quality trade setups.
✨ Key Features
✅ Clear BUY / SELL signals
✅ Identifies trend direction
✅ Works on all timeframes
✅ Suitable for Intraday & Swing Trading
✅ Can be used on Stocks, Indices, Crypto & Forex
📊 How to Use
🔹 BUY Signal: Appears when the trend turns bullish with strong momentum
🔹 SELL Signal: Appears when the trend turns bearish or momentum weakens
🔹 Best results when used with support & resistance or price action confirmation
🛡 Risk Management
Always use a proper stop-loss and risk management.
No indicator is 100% accurate — discipline matters more than signals.
⚠️ Disclaimer
This indicator is for educational purposes only.
It does not provide financial advice.
The creator is not responsible for any profit or loss incurred
Optimal Day Trading System🚥 How to Trade with ODTS
The indicator provides visual cues on the chart (triangles) and a real-time Status Table to help you make decisions.
Signal Definitions
Buy Signal (Green Triangle): Price is above the Sunya line and the Primary Cycle is trending up.
Strong Buy (Lime Triangle): All criteria are met, plus the Secondary Cycle has also turned bullish. This indicates "confluence".
Sell Signal (Red Triangle): Price is below the Sunya line and the Primary Cycle is trending down.
Strong Sell (Maroon Triangle): Both Primary and Secondary cycles are aligned with a price break below the Sunya line.
Real-Time Status Table
Located at the top right, this table gives you an instant "health check" of the current asset:
Price > Sunya: Confirms if the current price is above or below the FLD.
Cycle Dir: Shows the slope of the primary trend.
Position: Tells you if price is "Inside" the envelope (ranging) or "Above/Below" (overextended).
📈 Best Practices
Confluence is Key: The strongest trades occur when the Signal column in the table shows "STRONG BUY" or "STRONG SELL," meaning multiple cycles are in agreement.
Envelope Extremes: If the Status Table shows the Position as "ABOVE" or "BELOW" the envelope, be cautious about entering new trades, as the price may be overextended and due for a reversion to the Basis (mean).
Timeframe Synergy: Use the 15-minute timeframe for swing trade entries and the 1-minute or 5-minute for precise day trading executions.
Moon Declination & More [BlueprintResearch]🌒 MOON DECLINATION & MORE
A comprehensive lunar declination visualization showing Moon, Sun, and node declinations, with phase coloring, zodiac sign tracking, and future projections.
Part of the Blueprint Research open-source ephemeris project.
█ WHAT'S INCLUDED
• Moon Declination — The Moon's angular distance from the celestial equator, oscillating rapidly (~27 days)
• Sun Declination — Optional overlay showing the Sun's seasonal declination (±23.4°)
• Node Declinations — North (☊) and South (☋) node lines forming the Moon's orbital envelope
• Future Projections — Project all lines up to 500 bars into the future
• Zodiac Crossing Markers — Indicates when the North Node reaches a particular zodiac degree. Keep in mind, nodes move through the zodiac in reverse.
█ CONCEPTS
Declination measures how far north or south a celestial body appears from the celestial equator. The Moon's declination oscillates rapidly, while its maximum range shifts slowly over the 18.6-year nodal cycle.
Node Declination Envelope:
The North (☊) and South (☋) node lines mark the envelope of the Moon's orbit—the theoretical maximum northern and southern declinations the Moon can reach.
Lunar Standstills:
The 18.6-year nodal cycle determines when the Moon reaches its most extreme declinations. During a major standstill, the Moon can exceed ±28° declination. During a minor standstill, the Moon's range is limited to approximately ±18°.
Out-of-Bounds (OOB):
When the Moon moves beyond ±23.44° declination, it exceeds the Sun's maximum reach and is considered "Out of Bounds."
█ COLORING OPTIONS
Phase Coloring (Moon)
Color the Moon's declination line by lunar phase:
• New Moon (0-90°): Slate silver
• First Quarter (90-180°): Mint
• Full Moon (180-270°): Bright gold
• Last Quarter (270-360°): Soft violet
Zodiac Sign Coloring (Nodes)
Color the node lines by their zodiac sign. When enabled, a color legend appears at the top, showing all 12 signs for reference.
█ ZODIAC FEATURES
Zodiac Sign Coloring
Color the North and South Node lines according to their zodiac sign positions.
Zodiac Crossing
Marks when the North Node crosses a specific zodiac degree. Select any sign and degree (0-29) to track. The North Node moves retrograde through the zodiac over an 18.6-year cycle.
█ RESEARCH FEATURES
Standstill Thresholds
Horizontal reference lines at key declination levels:
• ±28.6° Major Standstill (peak of the 18.6-year cycle)
• ±18.3° Minor Standstill (trough of the cycle)
• ±23.4° Out-of-Bounds threshold
OOB Highlighting
Optional background shading when the Moon exceeds the OOB threshold.
Node Equatorial Crossings
Crosshair markers indicate when the node's declination crosses 0° (equatorial passage).
Reference Line Labels
Labels at projection endpoints with an adjustable offset for readability.
█ FEATURES
• Moon declination with optional lunar phase coloring
• Sun declination overlay
• North and South node declinations (☊ and ☋)
• Future projections up to 500 bars
• Zodiac sign coloring with a color legend
• Zodiac degree-crossing markers
• Node equatorial-crossing markers
• Out-of-Bounds background highlighting
• Reference line labels with offset control
• Customizable line widths and colors
• Informative tooltips for all settings
• Works on all timeframes
█ HOW TO USE
1 — Add the indicator to your chart
2 — Configure which elements to display (Moon, Sun, Nodes)
3 — Enable future projections to view upcoming declination values
4 — Enable Zodiac coloring to track node sign positions
5 — Set a Zodiac Crossing degree to mark when the North Node crosses that point
6 — Enable Standstill Thresholds to show reference lines
7 — Toggle phase coloring to visualize the lunar cycle
█ THEORY
Lunar Theory: ELP2000-82 by Chapront-Touzé & Chapront
Solar Theory: VSOP87 for Sun position and phase calculation
Reference: Meeus, "Astronomical Algorithms" (2nd Ed., 1998)
█ LIMITATIONS
• Truncated ELP2000-82 theory (~10 arcseconds precision)
• Future projections assume consistent bar timing
• Phase coloring uses 4 phases (not the 8 traditional phases)
• Mean nodes only (no perturbation corrections)
█ OPEN SOURCE
Blueprint Research Ephemeris Libraries:
• lib_elp2000_moon — Lunar position and mean node calculations
• lib_vsop_core — Solar position and coordinate utilities
• lib_ephemeris — Unified planetary API
Third-Party Libraries:
• hsvColor by @kaigouthro — HSV color utilities (MPL 2.0)
© 2025-2026 BlueprintResearch (Javonnii) • CC BY-NC-SA 4.0
5-Day & 20-Day Prior MA Lines (Gap Label)
Daily 5 & 20 Moving Average Levels
This indicator plots the Daily 5-period and Daily 20-period moving averages as horizontal levels on any timeframe. Each level starts at the first bar of the trading day and extends only to the current price, keeping the chart clean and focused on the active session.
The levels update once per day using confirmed daily data and are designed to act as intraday bias, support, and resistance references. Labels are aligned on the right side for a minimal, institutional-style presentation.
Useful for:
* Intraday trading on lower timeframes
* Identifying daily trend bias
* Mean reversion and pullback setups
* Futures, stocks, ETFs, and options
No future extension, no repainting, and no unnecessary clutter.
Chuy's Max DrawDownOutput Behavior
0% → no drawdown
-5% → 5% drop from peak
-20% → 20% max drawdown in selected period
PDH/PDL, PWH/PWL, TDH/TDL + Key Levels for Nifty50This indicator plots high-probability intraday and short-term reference zones including Previous Day High/Low (PDH/PDL), Previous Week High/Low (PWH/PWL), Today’s High/Low (TDH/TDL), and key psychological price levels such as the nearest round 1000 level along with +200, +500, and +800 extensions. All levels are displayed as zones rather than thin lines to better reflect real market interaction, liquidity, and reaction areas.
Primarily for Nifty50
GB-Numbers by AlgoKingsGB-Numbers by AlgoKings
RISK DISCLAIMER: This indicator is an analytical tool for educational purposes only, not financial advice. Trading carries substantial risk of loss. This tool does not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
WHAT IS GB-NUMBERS?
GB-Numbers displays Goldbach mathematical time windows directly on the chart, marking both historical bars and future time periods where time components align with selected Goldbach numbers. Unlike other Goldbach indicators that filter price patterns, this tool shows pure time analysis - when mathematical harmonics occur regardless of price action.
Example: If minute=23 at current bar, label displays "23". If next bar at 11:35 will have minute=35, indicator projects label 60 bars forward showing when this time window will occur.
UNDERLYING METHODOLOGY
This indicator combines three analytical layers:
1. GOLDBACH NUMBER MATCHING
Uses mathematical time component analysis based on Goldbach conjecture principles:
GOLDBACH NUMBER SET:
Master list of 23 key numbers: 0, 3, 11, 17, 29, 41, 47, 53, 59, 71, 83, 89, 97, 100, 7, 14, 23, 35, 44, 50, 56, 65, 77
These numbers represent temporal harmonics derived from number theory analysis. Users can select custom subset via comma-separated list for both Future and History modes.
TIME COMPONENT CALCULATION:
For any given bar timestamp, algorithm extracts four components in selected timezone (New York or Zurich):
- Minute (m): Minute of hour (0-59)
- Hour (h): Hour of day (0-23)
- Sum (h + m): Addition of hour and minute
- Difference (|h - m|): Absolute difference between hour and minute
Example timestamp 14:35:
- m = 35
- h = 14
- h + m = 49
- |h - m| = 21
MATCHING LOGIC:
Two matching modes available:
EXACT MODE:
Number matches if ANY time component exactly equals Goldbach number:
if (m == n) or (h == n) or (h+m == n) or (|h-m| == n)
→ Exact match, display number
ALL MODE (±1 tolerance):
Number matches if ANY time component equals Goldbach number ±1:
if (m == n±1) or (h == n±1) or (h+m == n±1) or (|h-m| == n±1)
→ Near match, display number
Technical implementation:
gbMatch() function tests single number against timestamp's four components. gbMatches() loops through number array, calls gbMatch() for each, returns three arrays: all matches, exact matches, approximate matches. Display uses exact or all based on mode setting.
2. FUTURE TIME PROJECTION
Projects Goldbach matches up to 60 bars into the future:
INITIALIZATION PHASE:
When reaching barstate.islastconfirmedhistory (end of historical data), algorithm performs forward scan:
- Loops from bars_back=-1 to bars_back=-60
- Calls time("", bars_back=idx) to get future timestamps
- Tests each timestamp against selected Goldbach numbers
- Creates labels at future bar positions showing matching numbers
REAL-TIME UPDATES:
On each new bar during live trading (barstate.islast):
- Tests single timestamp 60 bars ahead (time("", bars_back=-60))
- Creates new label if matches found
- Purges oldest future label if it reached current time (last.t <= time)
- Updates all future label y-coordinates to current high for visibility
Rolling window:
Maintains constant 60-bar forward projection. As chart progresses, oldest future label converts to current bar, new label added 60 bars ahead, creating rolling wave of future time windows.
Visual management:
Future labels positioned at high price for visibility. On each bar, all future labels updated to current high (set_y(high)) so they remain visible as price moves. When future bar becomes current, label deleted from nexts array.
3. HISTORICAL BAR MARKING
Marks past bars where Goldbach matches occurred:
DETECTION:
On each new bar (time != previous time):
- Tests current bar timestamp against historical Goldbach array
- If matches found, creates label at bar's high
- Label text contains matched numbers sorted descending, newline-separated
ARRAY MANAGEMENT:
Maintains rolling history array with configurable size (0-400 bars):
- Unshifts new Bar object (contains timestamp and label reference)
- When array exceeds history limit, pops oldest and deletes label
- Enables dynamic history depth adjustment without performance degradation
VERTICAL OFFSET:
Optional vertical offset parameter (0-9) adds newlines to label text, pushing numbers higher above bar. Each increment adds one newline, creating visual separation when multiple indicators overlap.
Difference from future:
Historical labels remain at creation coordinates. Future labels dynamically adjust to current high. Historical mode optional (can be disabled), future mode default enabled.
WHY CLOSED-SOURCE?
This script protects proprietary algorithms:
- Goldbach number set: Proprietary selection of 23 specific numbers (0, 3, 11, 17, 29, 41, 47, 53, 59, 71, 83, 89, 97, 100, 7, 14, 23, 35, 44, 50, 56, 65, 77) derived from mathematical research
- Future projection engine: Rolling 60-bar forward scan using time("", bars_back=-idx) with dynamic label positioning (set_y updates), purge logic (last.t <= time), and initialization phase optimization (single loop on islastconfirmedhistory vs bar-by-bar processing)
- Dual-mode matching: Separate exact and approximate match arrays with user-selectable filtering, requiring complex conditional logic in gbMatch() that tests four time components with tolerance windows
- Label lifecycle management: Two independent Bar arrays (nexts for future, bars for history) with different update patterns - futures update y-coordinate every bar, history remains static, futures purge by timestamp comparison, history purges by array size
- Timezone abstraction: Single timezone parameter affects all time component calculations (minute, hour extraction) uniformly across historical and future projections
Standard time indicators show current time only. This script provides dual-timeline analysis with mathematically filtered time windows across past and future.
TECHNICAL COMPONENTS
Core structures:
- Bar Object: Container for timestamp (t) and label reference, used in both bars (history) and nexts (future) arrays
- Goldbach arrays: nextGbArray (user-selected for future), barGbArray (user-selected or all 23 for history)
Time component extraction:
- minute(time, timezone): Extracts minute component (0-59)
- hour(time, timezone): Extracts hour component (0-23)
- Arithmetic: h + m for sum, |h - m| for difference
Future projection:
- Initialization: for idx = -1 to -60: test time("", bars_back=idx)
- Live update: test time("", bars_back=-60) on each new bar
- Purge: if (nexts.last().t <= time) pop and delete
- Position update: for all nexts: set_y(high)
Historical marking:
- Detection: if (time != t0) test gbMatches(barGbArray, time, timezone)
- Creation: label.new(time, high, matches.join(" "))
- Purge: if (bars.size() > barHistory) pop and delete
HOW TO USE
Setup:
1. Apply to any chart (works on all symbols and timeframes)
2. Select Timezone (New York or Zurich) for Goldbach calculation
3. Configure Future section: Enable, select Exact/All mode, enter GB/CE numbers, choose color
4. Configure History section: Enable, select Exact/All mode, enter GB/CE numbers or enable "All GB/CE", set history depth, choose color
5. Adjust Text Size and Vertical Offset as needed
Chart Timeframe:
Works on any timeframe. Lower timeframes (1m-5m) show more frequent matches. Higher timeframes (1H-Daily) show fewer, potentially more significant time windows.
Interpretation:
FUTURE (Blue labels by default):
- Labels appear up to 60 bars ahead of current bar
- Numbers show which Goldbach numbers will match at that future time
- Labels move vertically with price to stay visible
- When future bar becomes current, label disappears
- Used for anticipating upcoming mathematical time windows
HISTORY (Gray labels by default):
- Labels appear on past bars where Goldbach matches occurred
- Numbers show which Goldbach numbers matched at that time
- Labels remain at bar's high price (static)
- Quantity controlled by History parameter (0-400 bars)
- Used for reviewing past mathematical time windows
Label content:
Single number (e.g., "23") = One time component matched one Goldbach number
Multiple numbers (e.g., "35 50") = Multiple time components matched different Goldbach numbers, displayed vertically stacked
No label = No Goldbach matches at that timestamp
SETTINGS EXPLAINED
Settings:
- Timezone: Choose New York or Zurich for time component calculation (chart timezone does not affect this)
- Text Size: Label text size for all numbers (Tiny, Small, Normal, Large)
Future:
- Enable: Show/hide future time projection (60 bars ahead)
- Exact: Enable for exact matches only, disable for ±1 tolerance
- GB/CE List: Comma-separated Goldbach numbers to test for future bars (e.g., "23,35")
- Color: Label color for future time windows
History:
- Enable: Show/hide historical bar marking
- Exact: Enable for exact matches only, disable for ±1 tolerance
- All GB/CE: Enable to test all 23 master Goldbach numbers
- GB/CE List: Disable "All GB/CE" to enter custom comma-separated list (e.g., "23,35")
- History: Number of past bars to show (0-400)
- Color: Label color for historical markings
- Vertical Offset: Adds newlines above numbers (0-9), pushes labels higher for multi-indicator setups
Timezone selection:
New York (America/New_York) = EST/EDT timezone
Zurich (Europe/Zurich) = CET/CEST timezone
Chart display timezone does not affect Goldbach calculations. You can view charts in any timezone while calculating Goldbach numbers in New York or Zurich time.
Exact vs All mode:
- Exact: Stricter, only shows exact matches (m=n, h=n, h+m=n, |h-m|=n)
- All: Looser, shows exact and near matches (±1 tolerance)
- Future and History have independent mode settings
Custom number selection:
Enter numbers separated by commas with no spaces: 23,35,50,77
Invalid numbers (not in master list of 23) automatically filtered out
Minimum: 1 number
Maximum: all 23 numbers (or enable "All GB/CE" for History)
Common Configurations:
- ICT Focus: Future enabled with "23,35", History disabled (clean chart, anticipatory)
- Full Analysis: Future enabled with "23,35", History enabled with "All GB/CE", History=60
- Research Mode: Future disabled, History enabled with custom numbers, History=400 (maximum lookback)
- Minimal: Both Future and History enabled with same short list like "35,65", History=20
Vertical offset usage:
If running multiple indicators that create labels at highs, use Vertical Offset to separate GB-Numbers labels. Each increment adds one newline, pushing labels progressively higher. Useful when combining with GB-Evolve or other label-based indicators.
UPDATES
This script is actively maintained. Updates released through TradingView's native update system. For technical questions, use the comment section below.
GB-FVG by AlgoKingsGB-FVG by AlgoKings
RISK DISCLAIMER: This indicator is an analytical tool for educational purposes only, not financial advice. Trading carries substantial risk of loss. This tool does not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
WHAT IS GB-FVG?
GB-FVG identifies Fair Value Gaps that form during Goldbach mathematical time windows. Unlike standard FVG indicators that display all price imbalances, this tool filters for gaps created at specific time harmonics based on Goldbach number theory, highlighting institutional order flow events that occur during mathematically significant moments.
Example: At 11:35 (minute=35, hour=11, sum=46, difference=24), if minute matches Goldbach number 35 AND a three-candle gap forms, the indicator displays this FVG. Standard gaps forming at non-Goldbach times are ignored.
UNDERLYING METHODOLOGY
This indicator combines three analytical layers:
1. THREE-CANDLE FVG DETECTION
Identifies price imbalances using precise gap analysis:
BULLISH FVG:
Candle 3 (two bars back) high < Candle 1 (current) low = Gap between bars that price never traded
BEARISH FVG:
Candle 3 (two bars back) low > Candle 1 (current) high = Gap between bars that price never traded
Technical implementation:
- Uses request.security with lookahead_on to access confirmed bar data (high , low , high , low )
- For bullish FVG: Gap top = low , Gap bottom = high
- For bearish FVG: Gap top = low , Gap bottom = high
- Detects new FVGs when time exceeds previous time (new bar completed on indicator timeframe)
Bar array management:
Maintains rolling array of 10 most recent bars from indicator timeframe. On each security.isNew event, unshifts new bar and pops oldest. Enables lookback for three-bar pattern comparison without repeated security calls.
Higher timeframe precision:
When indicator timeframe exceeds chart timeframe (e.g., 1H FVG on 5m chart), hCtf and lCtf methods search backward through chart bars to find exact bar that created gap extreme, providing precise visual placement.
2. GOLDBACH TIME FILTERING
Only displays FVGs that form during Goldbach number time windows:
GOLDBACH NUMBER SET:
Master list of 23 key numbers: 0, 3, 11, 17, 29, 41, 47, 53, 59, 71, 83, 89, 97, 100, 7, 14, 23, 35, 44, 50, 56, 65, 77
These numbers represent temporal harmonics derived from number theory. Users can select all numbers or specify custom subset.
TIME COMPONENT CALCULATION:
For middle bar of three-candle pattern (bar that created the gap), algorithm extracts four components in selected timezone:
- Minute (m): Minute of hour (0-59)
- Hour (h): Hour of day (0-23)
- Sum (h + m): Addition of hour and minute
- Difference (|h - m|): Absolute difference between hour and minute
MATCHING LOGIC:
FVG only drawn if middle bar timestamp matches ANY Goldbach number ±1:
if (m == n) or (h == n) or (h+m == n) or (|h-m| == n)
→ Exact match, FVG qualifies
if (m == n±1) or (h == n±1) or (h+m == n±1) or (|h-m| == n±1)
→ Near match, FVG qualifies
Example: At 14:35, if user selected Goldbach 35:
- m = 35 → Exact match → FVG qualifies
- Gap drawn with label "35"
Filter effectiveness:
Standard FVG indicator might show 50+ gaps on 5m chart. GB-FVG shows only 5-10 gaps that align with Goldbach timing, reducing noise and highlighting mathematically significant imbalances.
3. MITIGATION TRACKING
Monitors gap fill status with body-based or wick-based options:
MITIGATION TYPES:
- Body Close: FVG considered filled when candle closes inside gap
- Wick Touch: FVG extends until touched (when "Mitigate on body close" disabled)
STATE MANAGEMENT:
- Active: Gap unfilled, box extends to future (x2 = time + offset)
- Mitigated: Price closed inside gap, box stops at mitigation bar
Progressive tracking:
On each new bar from indicator timeframe, if "Mitigate on body close" enabled:
- Bullish FVG: if close <= gap.bottom, set isMit=true, x2=time
- Bearish FVG: if close >= gap.top, set isMit=true, x2=time
Visual consequences:
Active FVGs extend dynamically to future bars. Mitigated FVGs freeze at mitigation point. Unlike standard FVG indicators that show partial fills, GB-FVG uses binary state (active/mitigated).
WHY CLOSED-SOURCE?
This script protects proprietary algorithms:
- Goldbach filtering integration: Combines gbMatches() function with FVG detection, testing middle bar timestamp (s2.t) against user-selected Goldbach array, only creating Fvg object when matches found
- Multi-timeframe precision: hCtf and lCtf methods that search through chart bars using offset calculations (ctfBarCount * idx) and mintick rounding to locate exact bar that created higher timeframe gap extreme
- Bar array synchronization: Security object maintains rolling 10-bar array with isNew flag coordination, preventing duplicate processing while enabling three-bar lookback without repeated security calls
- Time component matching: gbMatch function implementing four-component test (m, h, h+m, |h-m|) with ±1 tolerance against each Goldbach number, returning match status and exact/approximate classification
- Mitigation state machine: isMit flag with body-close detection (close <= l for bullish, close >= h for bearish) that freezes box extension (x2) at mitigation timestamp rather than current time
Standard FVG indicators show all gaps. GB-FVG adds Goldbach timing layer requiring complex timestamp extraction, component arithmetic, and match filtering before gap visualization.
TECHNICAL COMPONENTS
Core structures:
- Bar Object: Stores OHLC and timestamp for single bar from indicator timeframe
- Security Object: Manages request.security calls, maintains Bar array (size=10), tracks isNew flag, provides hCtf/lCtf precision methods
- Fvg Object: Contains gap coordinates (x, h, x2, l), Goldbach numbers text, isMit state, box drawing object
- Option Object: Centralized settings for timezone, Goldbach array, history, colors, mitigation type
Goldbach matching:
- gbMatch(n, t, timezone): Tests single Goldbach number against single timestamp's four components with ±1 tolerance
- gbMatches(nArray, t, timezone): Tests array of Goldbach numbers against timestamp, returns arrays
FVG detection:
- Bullish: if (s3.h < s1.l and gbMatches(array, s2.t) has matches) create FVG
- Bearish: if (s3.l > s1.h and gbMatches(array, s2.t) has matches) create FVG
- Label: Goldbach numbers joined with commas (e.g., "23,35,65")
Mitigation:
- if (sBodyMit and close inside gap) set isMit=true, x2=close_time
- if (not sBodyMit) always extend to future: x2 = time("", bars_back = -4)
HOW TO USE
Setup:
1. Apply to any chart (works on all symbols and timeframes)
2. Select FVG Timeframe (must be >= chart timeframe)
3. Choose Timezone (New York or Zurich) for Goldbach calculation
4. Select "All GB/CE" to use all 23 numbers, or enter custom list
5. Enter custom numbers as comma-separated values (e.g., "23,35,65,77")
6. Enable/disable "Mitigate on body close" for mitigation behavior
Chart Timeframe Requirements:
Chart timeframe must be equal to or lower than FVG Timeframe setting. For 1H FVG analysis, use 1H or lower chart (5m, 15m, 30m, 1H all valid). Cannot use 4H chart for 1H FVG.
Interpretation:
- Green box = Bullish FVG at Goldbach time (gap up, unfilled)
- Red box = Bearish FVG at Goldbach time (gap down, unfilled)
- Numbers in box = Goldbach numbers that matched middle bar timestamp
- Box extends right = Active FVG (not yet mitigated)
- Box stops = Mitigated FVG (price closed inside gap)
- Multiple numbers = Multiple time components aligned with different Goldbach numbers
Visual placement:
Box spans from gap bottom to gap top vertically. Horizontally spans from gap formation bar to current time (active) or mitigation bar (filled). Numbers display at right edge of box.
SETTINGS EXPLAINED
Settings:
- Timeframe: Select FVG detection timeframe (any timeframe >= chart TF valid)
- Timezone: Choose New York or Zurich for Goldbach time component calculation
- All GB/CE: Enable to use all 23 master Goldbach numbers
- GB/CE List: Disable "All GB/CE" to enter custom comma-separated list (e.g., "23,35,65,77")
- History: Number of FVGs to display (default: 9)
- Text Size: Label text size for Goldbach numbers (Auto, Tiny, Small, Normal, Large)
- Text: Text color for Goldbach number labels
- Up: Box color for bullish FVGs
- Down: Box color for bearish FVGs
- Mitigate on body close: Enable to stop box extension when price closes inside gap, disable to extend until current time
Timeframe selection:
Must select timeframe equal to or higher than chart. Examples:
- Chart 5m, FVG 15m = Valid
- Chart 5m, FVG 1H = Valid
- Chart 1H, FVG 15m = Invalid (error message shown)
Timezone selection:
New York (America/New_York) = EST/EDT timezone
Zurich (Europe/Zurich) = CET/CEST timezone
Chart display timezone does not affect Goldbach calculations. You can view charts in Tokyo time while calculating Goldbach numbers in New York time.
Custom number selection:
Enter numbers separated by commas with no spaces: 23,35,65,77
Invalid numbers (not in master list of 23) automatically filtered out
Minimum: 1 number (or enable "All GB/CE")
Maximum: all 23 numbers
Mitigation behavior:
- Enabled: Boxes stop extending when price closes inside gap (recommended for cleaner chart)
- Disabled: Boxes extend to current time regardless of fills (shows all historical gaps)
UPDATES
This script is actively maintained. Updates released through TradingView's native update system. For technical questions, use the comment section below.
GB-Evolve by AlgoKingsGB-Evolve by AlgoKings
RISK DISCLAIMER: This indicator is an analytical tool for educational purposes only, not financial advice. Trading carries substantial risk of loss. This tool does not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
WHAT IS GB-EVOLVE?
GB-Evolve identifies potential market turning points using Goldbach mathematical timing analysis combined with price pivot detection. The indicator marks bars where time components align with specific Goldbach numbers while simultaneously forming three-bar swing patterns, suggesting confluence between mathematical time cycles and price structure.
Example: At 11:23 (hour=11, minute=23, sum=34, difference=12), if minute matches Goldbach number 23 AND price forms a swing high, the indicator marks this as a potential pivot. If confirmed by subsequent bars, the label changes color.
UNDERLYING METHODOLOGY
This indicator combines three analytical layers:
1. GOLDBACH NUMBER MATCHING
Uses mathematical time component analysis based on Goldbach conjecture principles:
GOLDBACH NUMBER SET:
Master list of 23 key numbers: 0, 3, 11, 17, 29, 41, 47, 53, 59, 71, 83, 89, 97, 100, 7, 14, 23, 35, 44, 50, 56, 65, 77
These numbers represent temporal harmonics derived from number theory analysis. Users can select all numbers or specify custom subset via comma-separated list.
TIME COMPONENT CALCULATION:
For any given bar timestamp, algorithm extracts four components in selected timezone (New York or Zurich):
- Minute (m): Minute of hour (0-59)
- Hour (h): Hour of day (0-23)
- Sum (h + m): Addition of hour and minute
- Difference (|h - m|): Absolute difference between hour and minute
Example timestamp 14:35:
- m = 35
- h = 14
- h + m = 49
- |h - m| = 21
MATCHING LOGIC:
Number matches if ANY time component equals Goldbach number ±1 (tolerance window):
- Exact match: Component exactly equals Goldbach number
- Near match: Component equals Goldbach number ±1
Technical implementation:
if (m == n) or (h == n) or (h+m == n) or (|h-m| == n)
→ Exact match
if (m == n±1) or (h == n±1) or (h+m == n±1) or (|h-m| == n±1)
→ Near match
Multi-bar window: Algorithm checks current bar, previous bar, and next bar timestamps to identify matches across pivot formation window.
2. THREE-BAR PIVOT DETECTION
Identifies swing highs and swing lows using classic three-bar pattern:
SWING HIGH:
high < high (current bar makes higher high than previous)
Pattern confirmed when: high < high > high (middle bar exceeds both neighbors)
SWING LOW:
low > low (current bar makes lower low than previous)
Pattern confirmed when: low > low < low (middle bar below both neighbors)
STATE TRANSITIONS:
- Potential Pivot: Current bar creates new extreme (high < high or low > low)
- Confirmed Pivot: Three-bar pattern completes with middle bar as pivot
Label management:
When bar forms potential pivot, creates label with matching Goldbach numbers. If bar later exceeds this extreme, label deleted (pivot invalidated). If bar confirms three-bar pattern, label color changes from gray to green (bullish) or red (bearish).
3. DYNAMIC LABEL UPDATES
Sophisticated label lifecycle management:
CREATION PHASE:
When current bar exceeds previous bar (high < high or low > low):
- Calls gbMatches() to test all Goldbach numbers against time , time , and time("", bars_back = -1)
- Collects matching numbers into array
- Sorts descending for highs, ascending for lows
- Creates label with joined numbers as text
INVALIDATION PHASE:
One bar later, if new bar exceeds previous pivot:
- high >= high → Delete high label (pivot broken)
- low <= low → Delete low label (pivot broken)
This prevents false pivots from persisting on chart.
CONFIRMATION PHASE:
Two bars later, if three-bar pattern confirmed:
- high < high > high → Change high label color to red (bearish reversal confirmed)
- low > low < low → Change low label color to green (bullish reversal confirmed)
Array management maintains only 3 most recent bars to enable this state machine.
WHY CLOSED-SOURCE?
This script protects proprietary algorithms:
- Goldbach matching engine: Custom gbMatch() function that tests four time components (m, h, h+m, |h-m|) against each Goldbach number with ±1 tolerance, implemented as nested conditional logic that processes 23 master numbers against multiple timestamp combinations
- Multi-bar window scanning: gbMatches() function that tests array of Goldbach numbers against array of timestamps (current, previous, next bars), using nested loops with break optimization when match found
- Goldbach number set: Proprietary selection of 23 specific numbers (0, 3, 11, 17, 29, 41, 47, 53, 59, 71, 83, 89, 97, 100, 7, 14, 23, 35, 44, 50, 56, 65, 77) derived from mathematical research
- State machine logic: Bar array management (size=3) with label lifecycle tracking through potential → invalidated/confirmed states, using get(1) and get(2) array indexing for historical bar access
- Label update mechanism: Dynamic textcolor changes (set_textcolor) without redrawing entire object, preserving label coordinates while updating visual state
Standard pivot indicators use price-only logic. This script combines mathematical time harmonics with price structure for confluence-based pivot identification.
TECHNICAL COMPONENTS
Core structures:
- Bar Object: Container for labelH (high label) and labelL (low label), maintained in 3-element rolling array
- Goldbach array: User-selected or full set of 23 master numbers, filtered through gbFilterArray() validation
Time component extraction:
- minute(time, timezone): Extracts minute component (0-59)
- hour(time, timezone): Extracts hour component (0-23)
- Arithmetic: h + m for sum, |h - m| for difference
Pivot detection:
- Potential: if (high < high) create label with gbMatches(gbArray, [time , time, time(-1)], timezone)
- Invalidation: if (high >= high ) delete label
- Confirmation: if (high < high > high ) change label color to red
HOW TO USE
Setup:
1. Apply to any chart (works on all symbols and timeframes)
2. Select Timezone (New York or Zurich) for Goldbach calculation
3. Choose "All GB/CE" to use all 23 numbers, or disable to enter custom list
4. Enter custom numbers as comma-separated values (e.g., "23,35,50")
5. Adjust text size and colors for labels
Chart Timeframe:
Works on any timeframe. Lower timeframes (1m-15m) show more frequent matches. Higher timeframes (1H-Daily) show fewer, potentially more significant confluences.
Interpretation:
- Gray label above bar = Potential swing high at Goldbach time (not yet confirmed)
- Gray label below bar = Potential swing low at Goldbach time (not yet confirmed)
- Red label above bar = Confirmed swing high (bearish reversal)
- Green label below bar = Confirmed swing low (bullish reversal)
- Numbers in label = Goldbach numbers that matched time components
- Multiple numbers = Multiple time components aligned with different Goldbach numbers
Label appearance:
Labels display at exact pivot point (high for swing highs, low for swing lows). Numbers sorted descending for highs, ascending for lows. Disappears if pivot invalidated by subsequent bar exceeding the extreme.
SETTINGS EXPLAINED
Settings:
- Timezone: Choose New York or Zurich for time component calculation (chart timezone does not affect this)
- All GB/CE: Enable to use all 23 master Goldbach numbers
- GB/CE List: Disable "All GB/CE" to enter custom comma-separated list (e.g., "23,35,44,50,77")
- Text Size: Label text size (Tiny, Small, Normal, Large)
- Potential Pivot: Label color for unconfirmed pivots (default: gray)
- Confirmed Pivot: Label colors for confirmed pivots (green for bullish, red for bearish)
Timezone selection:
New York (America/New_York) = EST/EDT timezone
Zurich (Europe/Zurich) = CET/CEST timezone
Your chart's display timezone does not affect Goldbach calculations. You can view charts in any timezone while calculating Goldbach numbers in New York or Zurich time.
Custom number selection:
Enter numbers separated by commas with no spaces: 23,35,50
Invalid numbers (not in master list of 23) automatically filtered out
Minimum: 1 number, Maximum: all 23 numbers
UPDATES
This script is actively maintained. Updates released through TradingView's native update system. For technical questions, use the comment section below.
Cycles by AlgoKingsCycles by AlgoKings
RISK DISCLAIMER: This indicator is an analytical tool for educational purposes only, not financial advice. Trading carries substantial risk of loss. This tool does not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
WHAT ARE CYCLES?
Cycles visualizes institutional time windows and key opening price levels. Instead of analyzing price patterns, this indicator segments the trading day into institutional order flow periods (90-minute, 30-minute, 10-minute cycles) and marks significant opening prices (session, daily, weekly, monthly, yearly) that often act as reference points for intraday price action.
Example: The 09:30 open price marks the start of regular US equity trading and often serves as a pivot level throughout the day. The London 1 (LN 1) 90-minute cycle from 02:30-04:00 EST represents the first institutional accumulation window.
UNDERLYING METHODOLOGY
This indicator combines three analytical layers:
1. INTRADAY CYCLE SEGMENTATION
Divides the trading day into institutional time windows:
ASIA SESSION:
18:00-02:30 EST (overnight session before London open)
90-MINUTE CYCLES:
Nine windows per trading day aligned with ICT methodology:
- LN 1, LN 2, LN 3: London session (02:30-04:00, 04:00-05:30, 05:30-07:00)
- AM 1, AM 2, AM 3: New York AM session (07:00-08:30, 08:30-10:00, 10:00-11:30)
- PM 1, PM 2, PM 3: New York PM session (11:30-13:00, 13:00-14:30, 14:30-16:00)
Technical implementation:
- 90m detection: Calculates ((hour * 60 + minute) - 150) % 90 == 0 to identify cycle boundaries from 02:30 EST baseline
- Session boundaries: Tracks inSession flag using time("", "0230-1600", gTimezone) to detect entry/exit from trading window
- Index tracking: Maintains counter (1-9) to assign sequential names (LN 1, AM 2, etc.) and color rotation (A/M/D pattern)
Color coding:
Each 90m cycle alternates three colors in A-M-D pattern (Accumulation-Manipulation-Distribution phases based on ICT concepts)
30-MINUTE CYCLES:
27 windows per trading day (2:30-16:00 EST), color-coded in A-M-D triplet pattern
10-MINUTE CYCLES:
81 windows per trading day (2:30-16:00 EST), single color for all
Cycle visualization:
- Box backgrounds highlight time ranges
- High/low tracked dynamically as cycle forms
- EQ (equilibrium) line at midpoint for 90m cycles
- Borders (optional) delineate cycle boundaries
2. OPENING PRICE TRACKING
Marks key opening levels that serve as institutional reference points:
SWING OPENS:
- Year Open: First price of calendar year
- Quarter Open: First price of Q1, Q2, Q3, Q4
- Month Open: First price of calendar month
- Week Open: First price of Sunday 18:00 EST (Monday for crypto)
INTRADAY OPENS:
- 00:00 Open: Midnight EST (new trading day for 24h markets)
- 09:30 Open: US equity market open
- Current Cycle Open (C.O): Opening price of most recent 90m cycle
Technical implementation:
- Period opens: Uses request.security to detect new bar on higher timeframe (time != previous time )
- Timed opens: Pattern matches hour/minute (e.g., hour==9 and minute==30 for 09:30)
- Line extension: Opens extend right dynamically (end = time + offset) to stay visible
History parameter controls how many previous opens to display per type.
3. OVERLAP CONSOLIDATION
When multiple opens share the same price level, consolidates into single visual:
ALGORITHM:
At barstate.islast, compares all active Level objects by price coordinate. When match found, merges labels into combined text with bullet separator (e.g., "M.O, W.O •" indicates Month Open and Week Open coincide). Lower precedence level undrawn, higher precedence level preserves visual with concatenated tooltip.
This prevents chart clutter when weekly, monthly, or quarterly opens align at same price.
WHY CLOSED-SOURCE?
This script protects proprietary algorithms:
- 90m cycle detection: Custom time arithmetic ((hour * 60 + minute) - 150) % 90 == 0 that calculates exact 90-minute boundaries from 02:30 baseline, with session boundary detection to exclude overnight periods
- Cycle index management: State machine that resets index to 1 on session start, increments through 1-9, applies modulo arithmetic for color rotation (index % 3), and assigns sequential names based on position
- Dynamic range tracking: Real-time high/low updating during cycle formation (h = math.max(h, high), l = math.min(l, low)) with isFinal flag transition when cycle completes
- Timed open detection: Pattern matching on hour/minute combinations with timezone conversion (gTimezone = "America/New_York") and proper handling of 24h markets vs traditional session starts
- Overlap consolidation: Price-based comparison of all Level objects at barstate.islast, string concatenation of names, selective undrawing to maintain single visual per price level
- Day of week positioning: Complex time offset calculations (newNoonTime = time - D/2, newMidTime for Sunday handling) to center labels at day midpoints considering crypto 24/7 vs traditional market schedules
Standard cycle indicators show fixed time periods. This script provides ICT-aligned institutional windows with smart label management and multi-timeframe open tracking.
TECHNICAL COMPONENTS
Core structures:
- Security Object: Stores timeframe data (open, time, time ) from request.security calls, maintains isNew flag for cycle detection
- Range Object: Represents cycle box with coordinates (start, end, h, l), isFinal state, drawing objects (box, label, eq line)
- Level Object: Represents open price line with coordinates (price, start, end, startCtf), isFinal state, drawing objects (line, label)
- Option Object: Centralized settings container with cycle-specific overrides for colors, styles, history counts
Cycle detection patterns:
- 90m: if (security.isNew and ((hour * 60 + minute) - 150) % 90 == 0 and inSession)
- 30m: if (security.isNew and inSession), index cycles 1-2-3 for color
- 10m: if (security.isNew and inSession)
- Period opens: if (security.isNew) on higher timeframe
- Timed opens: if (security.isNew and hour == h and minute == m)
Extension logic:
- Ranges: end = time, h = max(h, high), l = min(l, low) while not isFinal
- Levels: end = time + offset (offset = ctfSeconds * 12000 for far-right placement)
HOW TO USE
Setup:
1. Apply to intraday chart (works best on 1m-30m timeframes)
2. Enable/disable cycle types in Time Cycles section
3. Enable/disable open types in Opens section
4. Configure History to control how many days/periods to show
5. Adjust colors and line styles to preference
Chart Timeframe Requirements:
Designed for intraday charts (seconds to 30m). Higher timeframes (1H+) will show opens but cycles may not display properly.
Interpretation:
CYCLES (Box Backgrounds):
- ASIA = Gray box covering 18:00-02:30 EST
- LN 1/2/3 = Blue/Red/Green boxes (London 90m cycles)
- AM 1/2/3 = Blue/Red/Green boxes (NY morning 90m cycles)
- PM 1/2/3 = Blue/Red/Green boxes (NY afternoon 90m cycles)
- 30m/10m = Smaller nested cycles within 90m windows
- EQ line = 50% equilibrium level within 90m cycle range
OPENS (Horizontal Lines):
- C.O = Current 90m cycle open (most recent)
- 00:00 = Midnight EST open
- 09:30 = US equity market open
- W.O = Week open (Sunday 18:00)
- M.O = Month open
- Q.O = Quarter open
- Y.O = Year open
- Bullet (•) in label = Multiple opens at same price
DAY OF WEEK:
- Labels at chart bottom (Monday, Tuesday, etc.)
- Vertical dividers at midnight (optional)
SETTINGS EXPLAINED
Time Cycles:
- Asia: Enable/disable Asia session box (18:00-02:30 EST) with color picker
- 90m Cycle: Enable/disable 90m windows with three color pickers (A/M/D phases)
- 90m EQ: Show/hide equilibrium line at midpoint of 90m cycles
- 30m Cycle: Enable/disable 30m windows with three color pickers
- 10m Cycle: Enable/disable 10m windows with single color
- Label: Size for cycle names (LN 1, AM 2, etc.)
- Border: Show/hide cycle box outlines with style picker
- History (Days): Number of days to show cycles (0-4)
Opens:
- Label: Color and size for all open price labels
- Line Width: Thickness for all open price lines
- Current Cycle: Enable/disable C.O (current 90m cycle open)
- 00:00: Enable/disable midnight open with color and history count
- 09:30: Enable/disable equity market open with color and history count
- Week: Enable/disable weekly open with color and history count
- Month: Enable/disable monthly open with color and history count
- Quarter: Enable/disable quarterly open with color and history count
- Year: Enable/disable yearly open with color and history count
History count determines how many previous opens to display (e.g., History=2 for Weekly shows this week and last week's opens)
Day of Week:
- Day: Enable/disable day name labels at chart bottom
- Divider: Enable/disable vertical lines at midnight boundaries with style picker
UPDATES
This script is actively maintained. Updates released through TradingView's native update system. For technical questions, use the comment section below.
FVG by AlgoKingsFVG by AlgoKings
RISK DISCLAIMER: This indicator is an analytical tool for educational purposes only, not financial advice. Trading carries substantial risk of loss. This tool does not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
WHAT ARE FAIR VALUE GAPS?
Fair Value Gaps (FVGs) are price imbalances created when aggressive institutional order flow leaves gaps between consecutive candles. These gaps often act as magnetic zones where price returns to fill the imbalance before continuing in the original direction.
Example: Bullish FVG forms when candle 1's low is above candle 3's high, creating a gap that wasn't traded. Price often returns to fill this gap before moving higher.
UNDERLYING METHODOLOGY
This indicator combines four analytical layers:
1. THREE-CANDLE PATTERN DETECTION
Identifies FVGs using precise gap analysis:
BULLISH FVG:
Candle 1 (current) low > Candle 3 (two bars back) high = Gap between bars that price never traded
BEARISH FVG:
Candle 3 (two bars back) low > Candle 1 (current) high = Gap between bars that price never traded
Technical implementation:
- Uses request.security with lookahead_on to compare high , low (candle 1) against high , low (candle 3)
- For bullish FVG: Gap top = low , Gap bottom = high
- For bearish FVG: Gap top = low , Gap bottom = high
- Detects new FVGs when time exceeds lastTime (new bar completed on indicator timeframe)
Higher timeframe precision:
When indicator timeframe exceeds chart timeframe (e.g., 1H FVG on 5m chart), the algorithm searches backward through chart bars to find the exact bar that created the gap extreme, providing precise entry points rather than using the timeframe's open time.
2. PARTIAL MITIGATION TRACKING
Advanced mitigation system tracks progressive gap fills:
MITIGATION TYPES:
- Wick: Price touches gap boundary (high >= gap for bearish, low <= gap for bullish)
- Body: Candle closes inside gap (close >= gap for bearish, close <= gap for bullish)
STATE MANAGEMENT:
- Unmitigated: Full gap remains (displays in green for bullish, red for bearish)
- Partially Mitigated: Price entered gap but not fully filled (split display: mitigated portion in gray, remaining in green/red)
- Fully Mitigated: Price completely filled gap (displays in gray)
Progressive update algorithm:
- priceMt variable tracks current mitigation level
- On each bar, compares new close/low (bullish) or close/high (bearish) against priceMt
- If deeper mitigation detected, updates priceMt and redraws box boundaries
- When priceMt reaches gap bottom (bullish) or gap top (bearish), marks isMt flag true
Visual updates:
- boxUnMt (unmitigated box) shrinks as priceMt advances
- boxMt (mitigated box) expands from opposite side
- Both boxes share same start/end times, meet at priceMt level
3. MULTI-TIMEFRAME AGGREGATION
Monitors up to 9 timeframes simultaneously:
TIMEFRAME ELIGIBILITY:
Only processes timeframes >= chart timeframe. If chart is 5m, can show 5m, 15m, 1H, 4H, Daily, etc. Cannot show 1m FVGs on 5m chart.
Seconds filter: Excludes seconds-based indicator timeframes when chart is 4H+ (prevents attempting to load 1s/5s data on Daily chart where it doesn't exist)
FVG ARRAY MANAGEMENT:
Each timeframe maintains independent array of FVG objects, sorted newest first. History parameter controls array size (default: 50). When array exceeds history limit, oldest FVG is removed and deleted.
4. TOUCH DETECTION AND VISUAL MANAGEMENT
Tracks when price revisits FVG zones:
TOUCH EVENTS:
Separate from mitigation, tracks when price enters FVG at all (isOutlineMt flag). Uses same logic as mitigation detection but sets flag on first touch regardless of depth.
Visual consequences:
- Before touch: Outline border displays in gray (bdUnWkColor)
- After touch: Outline border removed, indicates price acknowledged zone
- Extension behavior: If "Extend Unmitigated" enabled, only untouched FVGs extend right
BIAS FILTERING:
Optional filter to show only bullish, only bearish, or both (neutral) FVGs. Applied during FVG creation, prevents drawing filtered direction entirely.
WHY CLOSED-SOURCE?
This script protects proprietary algorithms:
- Three-bar gap detection: Precise timestamp matching using time > lastTime to identify new bar completions across multiple timeframes simultaneously, with lookahead_on to access confirmed previous bar data
- Partial mitigation algorithm: Real-time priceMt tracking that compares current bar against existing gap levels, calculates progressive fill depth, updates box boundaries dynamically without redrawing entire object
- Higher timeframe precision: getHighestTime and getLowestTime functions that search backward through chart bars (using offset calculations: length * 3 for 3 bars back) to pinpoint exact bar that created gap extreme rather than using timeframe open
- Multi-state tracking: Complex state machine with isMt (fully mitigated), isOutlineMt (touched), and priceMt (current mitigation level) flags that determine visual rendering and extension behavior
- Dynamic visual updates: Box boundary adjustments (set_top/set_bottom) that maintain object references while changing coordinates, preventing flicker and preserving tooltips
Standard FVG indicators simply draw boxes between wicks. This script provides institutional-grade mitigation tracking with progressive fill monitoring and precise timestamp resolution.
TECHNICAL COMPONENTS
Core structures:
- Security Object: Stores timeframe data including high , low , high , low , time , time from request.security calls
- Fvg Object: Contains gap coordinates (h, l), mitigation level (priceMt), state flags (isMt, isOutlineMt), timestamps (startTime, endTime), and drawing objects (boxes, lines, labels)
- SecurityFvg Object: Manages array of Fvg objects for one timeframe, handles updates, mitigation checks, and history purging
Gap detection logic:
- Bullish: if (l1 > h3 and isBias(bias, Trend.up)) create FVG with h=l1, l=h3, priceMt=l1
- Bearish: if (l3 > h1 and isBias(bias, Trend.dn)) create FVG with h=l3, l=h1, priceMt=h1
- Timestamp precision: startTime = getHighestTime(h3) for bullish or getLowestTime(l3) for bearish on HTF
Mitigation detection:
- Bullish: if (close < priceMt or low < priceMt depending on type) update priceMt = min(close/low, priceMt)
- Bearish: if (close > priceMt or high > priceMt depending on type) update priceMt = max(close/high, priceMt)
- Full mitigation: if (priceMt <= gap.l for bullish or priceMt >= gap.h for bearish) set isMt = true
HOW TO USE
Setup:
1. Apply to any chart (works on all symbols and timeframes)
2. Enable/disable timeframes in settings (9 configurable slots)
3. Select Bias to filter FVG direction (Neutral, Bullish, Bearish)
4. Choose Mitigation Type (Wick for conservative, Body for confirmation)
5. Configure History to control how many FVGs display per timeframe
Chart Timeframe Requirements:
Indicator only shows FVGs from timeframes equal to or higher than chart timeframe. For 5m chart: can show 5m, 15m, 1H, 4H, Daily, Weekly, Monthly. Cannot show 1m FVGs.
Interpretation:
- Green box = Bullish FVG (unmitigated portion)
- Red box = Bearish FVG (unmitigated portion)
- Gray box = Mitigated portion
- Dashed line = 50% equilibrium level (EQ)
- Gray outline = Untouched FVG
- No outline = Price has touched FVG
- Label = Timeframe and direction (e.g., "5m +FVG" or "1H -FVG")
SETTINGS EXPLAINED
Options:
- Bias: Filter FVG direction (Neutral shows both, Bullish shows only green, Bearish shows only red)
- History: Number of FVGs to display per timeframe (default: 50)
- Mitigation Type: Wick (price touches) or Body (candle closes inside)
- EQ: Show/hide 50% equilibrium line
- 25/75%: Show/hide quarter lines within gap
- Label: Show/hide text labels with size and color options
- Unmitigated Border: Color and style for untouched FVG outlines
- Bullish/Bearish/Mitigated: Colors for gap fill states
- Remove Fully Mitigated: Auto-hide FVGs after complete fill
- Extend All: Keep all FVGs extending right (requires Remove Fully Mitigated)
- Extend Unmitigated: Only untouched FVGs extend right
Timeframes:
9 configurable timeframe rows, each with checkbox to enable/disable. Only timeframes >= chart timeframe will display. Default: Chart TF, 1m, 5m, 15m, 1H, 4H, Daily, Weekly, Monthly.
Common Configurations:
- Scalping: Enable chart TF, 1m, 5m with Mitigation Type = Wick
- Day Trading: Enable 5m, 15m, 1H, 4H with Mitigation Type = Body, History = 20
- Swing Trading: Enable 1H, 4H, Daily with Remove Fully Mitigated = false
- Bias Trading: Set Bias = Bullish during uptrends, Bearish during downtrends to reduce noise
UPDATES
This script is actively maintained. Updates released through TradingView's native update system. For technical questions, use the comment section below.
open,high,close,lowthis indicator will mark the previous day, week ,monthly candle (open, high, close and low)
PXX Levels by AlgoKingsPXX Levels by AlgoKings
RISK DISCLAIMER: This indicator is an analytical tool for educational purposes only, not financial advice. Trading carries substantial risk of loss. This tool does not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
WHAT ARE PXX LEVELS?
PXX (Previous X High/Low) displays key support and resistance levels from completed market cycles. Unlike standard pivot indicators that use fixed bars, this tool calculates levels using natural market rhythms (sessions, 90-minute institutional windows, true daily periods) that align with institutional trading behavior.
Example: Previous Day High at 15,200 acts as resistance. Previous London session Low at 15,150 acts as support.
UNDERLYING METHODOLOGY
This indicator combines four analytical layers:
1. CYCLE-BASED PERIOD DETECTION
Tracks 10 cycle types across swing and intraday timeframes:
SWING CYCLES:
- Yearly: 12-month institutional rebalancing highs/lows
- Quarterly: 3-month earnings cycle extremes
- Monthly: Calendar month highs/lows
- Weekly: 7-day swing extremes
- Daily: Standard 18:00-18:00 EST bars
- TrueDay: 00:00-00:00 EST for 24-hour markets (futures, forex, crypto)
INTRADAY CYCLES:
- Session: Asia (18:00-02:00), London (02:00-08:30), NY AM (08:30-12:00), NY PM (12:00-17:00) EST
- 90m: Three 90-minute institutional windows (LN 1/2/3, AM 1/2/3, PM 1/2/3)
- 30m: 30-minute cycle extremes
- 10m: 10-minute cycle extremes
Technical implementation:
- TrueDay calculation: Detects candle closes at exactly 00:00 EST using time modulo arithmetic on 24-hour markets
- Session detection: Pattern matching on hour:minute timestamps (e.g., hr==2 and mn==30 triggers London session end at 02:30)
- 90m subdivision: Three 90-minute windows per session identified by specific time boundaries
- Cycle completion: Uses request.security with lookahead_on to detect when previous period (high , low ) closes
2. LEVEL TRACKING AND STATE MANAGEMENT
Proprietary state machine for each level:
LEVEL STATES:
- Live: Current cycle forming, level updates bar-by-bar as new highs/lows form
- Final: Cycle completed, level locked at cycle's high/low
- Taken: Price has touched/exceeded the level (mitigation)
- Extended: Level continues displaying after cycle completion or mitigation
State transitions:
- New cycle detected → Create Live level at current high/low
- Cycle completes → Transition Live to Final, lock coordinates
- Price touches level → Mark as Taken, optional removal from chart
- History limit reached → Purge oldest levels
Technical components:
- Level Object: Tracks y-price, x-start time, x2-current extension, isFinal/isTaken/isLive/isExtend flags
- Dynamic extension: Levels extend to current bar (x2 = time) until finalized or taken
- Mitigation detection: Compares current high >= level for resistance, low <= level for support
3. OFF-CHART LEVEL BACKFILL
Handles higher timeframe levels that formed before chart data:
When chart timeframe is lower than cycle period (e.g., 5m chart showing Daily levels), the indicator backfills up to 4 historical cycles using nested request.security calls (high , low , high , low , etc.). These off-chart levels are marked with tag in tooltips.
Anchor detection: If price matches an off-chart level's value, the indicator anchors it to the current bar time, removing the off-chart designation and making it actionable.
4. OVERLAP CONSOLIDATION AND PURGE HIERARCHY
Advanced filtering to prevent chart clutter:
OVERLAP DETECTION:
When multiple cycles produce identical levels (same y-price and x2-extension), the indicator combines them into a single visual with merged labels. Example: "P D, P W H" shows Previous Day and Previous Week High coincide.
Algorithm compares all levels at barstate.islast, identifies duplicates by y-coordinate and x2-endpoint, undraws lower precedence levels, and appends their names to higher precedence level's tooltip.
PURGE HIERARCHY:
- "Purge 10m/30m on new 90m Cycle": When 90m cycle completes, removes all 10m and 30m sub-cycle levels from chart
- "Purge 90m on new Session Cycle": When Session cycle completes, removes all 90m levels from chart
- This prevents clutter by automatically cleaning sub-levels when parent cycle resets
Implementation uses array-based tracking where higher cycle types (Session, 90m) hold references to lower cycle Pxx objects, allowing cascading purge operations on cycle completion.
WHY CLOSED-SOURCE?
This script protects proprietary algorithms:
- Cycle boundary detection: Custom logic for TrueDay (00:00 EST detection), Session identification (time-based pattern matching for 5 sessions), 90m subdivision (9 windows per day with specific time triggers), requiring complex hour/minute arithmetic
- Off-chart backfill system: Nested request.security calls to retrieve 4 historical cycles with isOffChart flagging and dynamic anchor detection when price revisits historical levels
- Level state machine: Multi-state tracking (Live/Final/Taken/Extended) with transition logic, including dynamic y-coordinate updates during Live state and precise finalization timing
- Overlap consolidation algorithm: Compares all active levels at each bar using y-coordinate and x2-endpoint matching, merges duplicate levels, preserves highest precedence visual while concatenating names
- Purge hierarchy system: Parent-child relationships between cycle types (Session→90m→30m/10m) with cascading cleanup operations triggered on cycle completion events
Standard support/resistance indicators show fixed pivot points. This script provides institutional-level cycle tracking with intelligent state management and visual optimization.
TECHNICAL COMPONENTS
Core structures:
- Cycle Object: Tracks cycle type, period string, current bar data, and array of historical CycleBar objects (up to 5 cycles deep)
- CycleBar Object: Stores high/low values, timestamps (open, close, high-time, low-time), cycle name, and off-chart status
- Level Object: Contains y-price, start/end coordinates, state flags (isFinal, isTaken, isLive, isExtend, isOffChart, isCurrent), and drawing objects (line, labels)
- Pxx Object: Manages array of high levels and array of low levels for one cycle type, handles updates/extensions/purging
Cycle detection:
- TrueDay: Tests hour==0 and minute==0 at time_close OR dayofweek change (excluding Monday for non-crypto)
- Session: Matches hour:minute pairs (17:00=ASIA, 02:30=LN, 07:00=AM, 11:30=PM, 16:00=VOID)
- 90m: Nine specific time boundaries from 02:30 to 16:00 EST
- Default cycles: Uses previous period close time (time ) from request.security
HOW TO USE
Setup:
1. Apply to any chart (works on all symbols and timeframes)
2. Enable/disable cycle types in settings (Swing Cycles, Intraday Cycles)
3. Configure History count for each cycle (how many previous levels to show)
4. Enable "Live" to see current cycle levels forming in real-time
5. Enable "Extend" to keep levels visible after mitigation
Chart Timeframe Requirements:
- Swing cycles: Chart TF must be <= cycle period and divide evenly (e.g., Daily requires 1H or lower)
- Intraday cycles: Chart TF must divide evenly into cycle (e.g., Session/90m/30m require 30m or lower, 10m requires 10m or lower)
- TrueDay: Automatically used instead of Daily on 1H and below for 24-hour markets
Interpretation:
- Horizontal lines show Previous High (resistance) and Previous Low (support) from completed cycles
- "P" prefix = Previous cycle (e.g., "P D H" = Previous Day High)
- No prefix = Current cycle forming (e.g., "LN 2 L" = Current London 2nd 90m Low)
- Dotted line = Level has been taken (mitigated)
- Solid line = Level still active
- Dot at left = Level formation point
- Label at right = Cycle name and high/low designation
- in tooltip = Level formed before chart data, not yet anchored
SETTINGS EXPLAINED
Time Cycles (Each cycle has 5 settings):
- Checkbox: Enable/disable cycle
- Color: Line color for this cycle's levels
- History: Number of previous cycles to display (1-4, or higher for intraday)
- Extend: Keep level visible after mitigation
- Live: Show current cycle's level as it forms bar-by-bar
Swing Cycles Available:
Year, Quarter, Month, Week, Day (uses TrueDay automatically on 1H and below for 24h markets)
Intraday Cycles Available:
Session (5 sessions per day), 90m (9 windows per day), 30m, 10m
Options:
- Line Width: Thickness of level lines (default: 1)
- Label: Show/hide text labels with size and color options
- Show Mitigated: Keep levels on chart after taken (shows as dotted) or remove them
- Purge 10m/30m on new 90m Cycle: Auto-remove sub-levels when 90m completes
- Purge 90m on new Session Cycle: Auto-remove 90m levels when Session completes
Common Configurations:
- Scalping: Enable 10m, 30m, 90m with History=1-3, Live=true, Extend=false
- Day Trading: Enable Session, 90m, Day with History=1-4, Live=true
- Swing Trading: Enable Day, Week, Month with History=1-2, Extend=true
- Position Trading: Enable Week, Month, Quarter, Year with Extend=true
UPDATES
This script is actively maintained. Updates released through TradingView's native update system. For technical questions, use the comment section below.
SMT Cycles by AlgoKingsSMT Cycles by AlgoKings
RISK DISCLAIMER: This indicator is an analytical tool for educational purposes only, not financial advice. Trading carries substantial risk of loss. This tool does not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
WHAT ARE SMT CYCLES?
This indicator identifies Smart Money Technique divergences using cycle-based analysis rather than standard timeframes. Cycles represent natural market rhythms (sessions, 90-minute institutional windows, true daily periods) that better align with institutional trading patterns than arbitrary timeframe bars.
Example: During the London session, NQ makes a new high but ES fails to follow = Bearish SMT divergence within the London cycle
UNDERLYING METHODOLOGY
This indicator combines four analytical layers:
1. AUTOMATIC CORRELATION MAPPING
Built-in correlation intelligence for 40+ pairs (identical to SMT Custom):
- Futures: NQ, ES, YM cross-correlation | GC/SI | 6E/6B
- Forex: EURUSD/GBPUSD/DXY(inverse) | AUDUSD/NZDUSD
- Stocks: MAG7 (META, NVDA, MSFT, etc.) vs NDX
- Crypto: BTCUSD/ETHUSD
Algorithm automatically mirrors contract types and exchange prefixes using regex-based parsing for futures contracts and micro variants.
2. CYCLE-BASED PERIOD DETECTION
Unlike standard timeframe analysis, this indicator uses market structure cycles:
SWING CYCLES (Position Trading):
- Yearly: 12-month institutional rebalancing periods
- Quarterly: 3-month earnings and fund rotation cycles
- Monthly: Calendar month institutional flows
- Weekly: 7-day swing trading cycles
- Daily: Standard 18:00-18:00 EST bars
- TrueDay: 00:00-00:00 EST for 24-hour markets (futures, forex, crypto)
INTRADAY CYCLES (Day Trading):
- Session: Asia (18:00-02:00), London (02:00-08:30), NY AM (08:30-12:00), NY PM (12:00-17:00) EST
- 90m: Three 90-minute windows per trading day (02:00-03:30, 03:30-05:00, etc.)
- 30m: 30-minute institutional order flow windows
- 10m, 3m, 1m: Scalping cycles for precise entry timing
Technical implementation:
- TrueDay calculation: Detects candle closes at exactly 00:00 EST using time modulo arithmetic on 24-hour markets. Differs from standard Daily bars which use futures settlement times (18:00 EST).
- Session detection: Regex pattern matching on hour/minute timestamps to identify cycle boundaries (e.g., h==2 and m==0 triggers Asia session end)
- 90m hierarchy: Groups sub-90m cycles (30m, 10m, 3m, 1m) under their parent 90m window using group timestamp tracking (gx field)
- Intermediate accumulation: For multi-bar cycles (TrueDay, Sessions, 90m), maintains running high/low (nh1, nl1) across constituent bars until cycle completion
3. MULTI-TIMEFRAME CYCLE ANALYSIS
Proprietary cycle synchronization:
- Tracks price structure across up to 11 configurable cycles simultaneously
- Maintains independent high/low tracking for each symbol pair using request.security()
- Compares previous cycle extremes (high , low ) across correlated pairs
- Timestamps divergence formations at chart timeframe precision
- Implements adaptive purge logic (1min to 12M) based on cycle type
4. DIVERGENCE CLASSIFICATION SYSTEM
Bullish SMT: Chart symbol makes lower low within cycle, correlated pair does NOT = Institutional buying pressure
Bearish SMT: Chart symbol makes higher high within cycle, correlated pair does NOT = Institutional selling pressure
Advanced features include level tracking (monitors when extremes are revisited), automatic extension until both levels violated, 90m hierarchy overlap filtering (hides sub-90m SMT within parent 90m window), and inverse correlation support for DXY relationships.
WHY CLOSED-SOURCE?
This script protects proprietary algorithms:
- Cycle boundary detection: Custom logic for TrueDay calculation (00:00 EST candle close detection using modulo arithmetic on 24h markets), Session identification (time-based regex for Asia/London/NY periods), and 90m window calculation (minute offset from 02:00 EST baseline)
- Intermediate cycle accumulation: Complex state management for multi-bar cycles (Sessions, 90m, TrueDay) that build complete cycle values across constituent bars before finalizing
- 90m hierarchy system: Proprietary grouping algorithm (gtype, gca, gx fields) that links sub-90m cycles to parent windows for intelligent overlap filtering
- Automatic symbol mapping: Custom logic for 40+ correlation pairs including futures contract recognition and exchange inheritance
- Adaptive purge system: Cycle-specific memory management (1S to 12M) optimized through backtesting
- Multi-level tracking: Simultaneous monitoring of multiple active divergences across different cycle types with state management for "taken" levels
Standard SMT indicators use fixed timeframes. This script analyzes institutional cycles that don't align with standard bar periods, requiring complex time arithmetic and multi-bar aggregation logic.
TECHNICAL COMPONENTS
Core structures:
- Cycle Object: Tracks high/low/time for each cycle type with intermediate values (nh1, nl1) for multi-bar cycles and complete cycle values (h1, l1, t1) upon cycle completion
- CycleType Enum: Defines 11 cycle types (year, quarter, month, week, day, trueday, session, m90, m30, m10, m3, m1) with associated period strings and purge thresholds
- Point Object: Stores divergence formation data for chart symbol level and correlated symbol level with "taken" status tracking
- SMT Object: Visual representation with line extension, tooltip showing formation time (EST), and optional 90m group timestamp (gx) for hierarchy filtering
Cycle detection logic:
- TrueDay: Tests if hour==0, minute==0 at candle close OR day-of-week changes (with Monday exception for markets closed weekends)
- Session: Matches specific hour:minute combinations (16:30=Void, 02:00=Asia end, 06:30=London end, 11:00=NY AM end, 15:30=NY PM end)
- 90m: Calculates (hour*60 + minute - 120) % 90 == 0 to detect 90-minute boundaries from 02:00 EST baseline
HOW TO USE
Setup (Automatic Mode - Recommended):
1. Apply to chart of supported pair (see correlation list above)
2. Indicator automatically detects optimal comparison symbols
3. Enable/disable specific cycle categories (Swing or Intraday) in settings
4. Enable/disable individual cycles within each category
5. Adjust visual preferences (colors, line styles, labels)
Setup (Manual Mode):
1. Uncheck "Automatic Symbol Mode" in settings
2. Enter "Manual Symbol #1" (e.g., ES1! when chart shows NQ1!)
3. Optional: Enter "Manual Symbol #2" for three-way comparison
4. Check "Invert" if symbol is inversely correlated (e.g., DXY vs EURUSD)
Chart Timeframe Requirements:
- Swing cycles: Chart TF must be <= cycle period (e.g., Daily cycle requires 1H or lower chart)
- Intraday cycles: Chart TF must divide evenly into cycle (e.g., 90m cycle requires 30m, 15m, 10m, 5m, or lower chart)
- TrueDay: Automatically selected for 1H and below chart TF on 24-hour markets (futures, forex, crypto)
Interpretation:
- Blue lines = Bullish SMT (chart made lower low within cycle, correlated pair held higher). Potential reversal up.
- Red lines = Bearish SMT (chart made higher high within cycle, correlated pair stayed lower). Potential reversal down.
- Dots in labels = Multiple SMT signals overlap. Hover to see all cycles showing divergence.
SETTINGS EXPLAINED
Symbols:
- Automatic Symbol Mode: Uses built-in correlation intelligence (recommended)
- Manual Symbol #1/2: Override automatic selection
- Invert: For inverse correlations (DXY vs majors)
- Hide Exact Overlap: Removes duplicate signals with identical start/end times
- Hide 90m Hierarchy Overlap: Hides sub-90m SMT (30m, 10m, 3m, 1m) when contained within parent 90m window
- Hide All Overlap: Hides lower precedence SMT when start/end points overlap higher precedence SMT
Intraday Cycles (Enable/Disable per symbol):
- Session: Asia (18:00-02:00), London (02:00-08:30), NY AM (08:30-12:00), NY PM (12:00-17:00) EST
- 90m: Three 90-minute institutional windows per day
- 30m: 30-minute cycles
- 10m, 3m, 1m: Scalping cycles
- Each cycle has two checkboxes: left for Symbol #1, right for Symbol #2
Swing Cycles (Enable/Disable per symbol):
- Yearly: 12-month cycles
- Quarterly: 3-month cycles
- Monthly: Calendar month cycles
- Weekly: 7-day cycles
- Daily: Standard daily bars (18:00-18:00 EST) OR TrueDay (00:00-00:00 EST on 1H and below chart TF for 24h markets)
- Each cycle has two checkboxes: left for Symbol #1, right for Symbol #2
Display:
- Bull/Bear: Enable/disable directional signals
- Line colors, styles (solid/dashed/dotted), widths
- Label: Show/hide text labels with color and size options
- SMT formation time: Displays timestamp in tooltip (New York time)
UPDATES
This script is actively maintained. Updates released through TradingView's native update system. For technical questions, use the comment section below.
SMT Custom by AlgoKingsSMT Custom by AlgoKings
RISK DISCLAIMER: This indicator is an analytical tool for educational purposes only, not financial advice. Trading carries substantial risk of loss. This tool does not guarantee profitable trades. Always use proper risk management and never risk more than you can afford to lose.
WHAT IS SMART MONEY TECHNIQUE (SMT)?
SMT identifies divergences between correlated market pairs when one asset makes a new high/low but its correlated counterpart fails to do so. These divergences often signal institutional repositioning and potential reversal points.
Example: NQ makes a new high at 15,200 but ES fails to exceed its previous high = Bearish SMT divergence
UNDERLYING METHODOLOGY
This indicator combines three analytical layers:
1. AUTOMATIC CORRELATION MAPPING
Built-in correlation intelligence for 40+ pairs:
- Futures: NQ, ES, YM cross-correlation | GC/SI | 6E/6B
- Forex: EURUSD/GBPUSD/DXY(inverse) | AUDUSD/NZDUSD
- Stocks: MAG7 (META, NVDA, MSFT, etc.) vs NDX
- Crypto: BTCUSD/ETHUSD
Algorithm automatically mirrors contract types (perpetual/quarterly futures) and exchange prefixes using regex-based parsing. Recognizes quarterly contracts (NQU2025), micro contracts (MNQ, MES), and perpetual syntax (NQ1!).
2. MULTI-TIMEFRAME CYCLE ANALYSIS
Proprietary cycle detection algorithm:
- Tracks price structure across 9 configurable timeframes simultaneously
- Maintains independent high/low tracking for each symbol pair using request.security()
- Identifies cycle completions with time-synchronized bar analysis
- Implements adaptive purge logic (1min to Monthly) to balance historical context vs performance
Technical implementation compares previous period extremes (high , low ) across correlated pairs and timestamps divergence formations at chart timeframe precision.
3. DIVERGENCE CLASSIFICATION SYSTEM
Bullish SMT: Chart symbol makes lower low, correlated pair does NOT = Institutional buying pressure
Bearish SMT: Chart symbol makes higher high, correlated pair does NOT = Institutional selling pressure
Advanced features include level tracking (monitors when extremes are revisited), automatic extension until both levels violated, overlap filtering to remove redundant signals, and inverse correlation support for DXY relationships.
WHY CLOSED-SOURCE?
This script protects proprietary algorithms:
- Automatic symbol mapping: Custom logic for 40+ correlation pairs including futures contract recognition (expiration codes, micro contracts) and exchange inheritance
- Cycle synchronization engine: Complex timestamp matching ensures divergences only flagged when both symbols' cycle periods align perfectly (prevents false signals from data lag)
- Adaptive purge system: Timeframe-specific memory management (1S to 12M) optimized through backtesting
- Multi-level tracking: Simultaneous monitoring of multiple active divergences with state management for "taken" levels
- Overlap intelligence: Algorithm determines when to hide/combine signals from different timeframes while preserving information in tooltips
Standard divergence indicators simply compare two moving averages. This script performs real-time institutional flow analysis across correlated instruments.
HOW TO USE
Setup (Automatic Mode - Recommended):
1. Apply to chart of supported pair (see correlation list above)
2. Indicator automatically detects optimal comparison symbols
3. Enable/disable specific timeframes in settings
4. Adjust visual preferences (colors, line styles, labels)
Setup (Manual Mode):
1. Uncheck "Automatic Symbol Mode" in settings
2. Enter "Manual Symbol #1" (e.g., ES1! when chart shows NQ1!)
3. Optional: Enter "Manual Symbol #2" for three-way comparison
4. Check "Invert" if symbol is inversely correlated (e.g., DXY vs EURUSD)
Interpretation:
- Blue lines = Bullish SMT (chart made lower low, correlated pair held higher). Potential reversal up.
- Red lines = Bearish SMT (chart made higher high, correlated pair stayed lower). Potential reversal down.
- Dots in labels = Multiple SMT signals overlap. Hover to see all timeframes.
SETTINGS EXPLAINED
Symbols:
- Automatic Symbol Mode: Uses built-in correlation intelligence (recommended)
- Manual Symbol #1/2: Override automatic selection
- Invert: For inverse correlations (DXY vs majors)
- Hide Exact Overlap: Removes duplicate signals with identical start/end times
- Hide All Overlap: Hides lower timeframe SMT within higher timeframe ranges
Timeframes:
- 9 configurable timeframe rows
- Toggle each symbol independently (Sym #1, Sym #2 checkboxes)
- Default: Chart TF, 1m, 5m, 15m, 1H, 4H, Daily, Weekly, Monthly
Display:
- Bull/Bear: Enable/disable directional signals
- Line colors, styles (solid/dashed/dotted), widths
- Label: Show/hide text labels with color and size options
- SMT formation time: Displays timestamp in tooltip (New York time)
UPDATES
This script is actively maintained. Updates released through TradingView's native update system. For technical questions, use the comment section below.
Custom Timeframe Candles [Metrify]This script lets you build custom timeframe candles (like 7m, 11m, 2h, 3D, etc.) by manually aggregating price data from a lower chart timeframe.
While it doesn’t fully replace TradingView’s native custom TF — especially in terms of perfect timestamp alignment, it gives you a very close (same calculation) and practical alternative for analysis.
How it works
Candles are manually aggregated from the current chart timeframe
Instead of relying on request.security(), candles are constructed directly from the current chart data.
For best results, use a chart timeframe that is divisible and as close as possible to your custom timeframe
Example: Custom TF = 10m → use 5m chart (1m chart also works, but the gap will be larger and less efficient)
Smaller gaps = cleaner candles, better visual accuracy, and smoother updates
MTF SMA Zones + EMA Trend (Bull & Bear) + EMA DisplayMTF SMA Zones + EMA Trend (Bull & Bear) + EMA Display
[TehThomas] - Aligned Timeframe Liquidity Sweeps█ OVERVIEW
The Liquidity Sweeps ICT MTF indicator automatically detects and visualizes buyside and sellside liquidity levels based on higher timeframe (HTF) swing points. Designed specifically for traders using Smart Money Concepts and ICT (Inner Circle Trader) methodology, this tool helps identify where institutional players are likely hunting liquidity before making directional moves.
█ KEY FEATURES
✓ Automatic ICT-Aligned Timeframe Selection
• Intelligently selects the higher timeframe based on your current chart
• Follows ICT's recommended correlations (5min→1h, 15min→4h, 1h→Daily, etc.)
• No manual timeframe selection needed - adapts automatically
✓ Precise Liquidity Level Placement
• Lines start exactly at the LTF candle that created the HTF swing point
• Searches backwards through historical data to find exact placement
• Eliminates guesswork about where institutional orders cluster
✓ Real-Time Sweep Detection
• Solid lines indicate untouched liquidity (active levels)
• Lines automatically turn dotted when price sweeps through them
• Swept lines stop at the exact bar of the sweep (clean visualization)
• Both wicks and candle bodies trigger sweep detection
✓ Fully Customizable Per Timeframe
• Individual swing detection settings for each HTF (1m, 15m, 1h, 4h, D, W, M)
• Adjust sensitivity to show major levels only or capture granular liquidity pools
• Customizable colors and line width
• Organized settings groups for easy navigation
█ HOW IT WORKS
The indicator identifies swing highs and swing lows on a higher timeframe using pivot point detection. These swing points represent areas where stop-loss orders from retail traders concentrate, creating "liquidity pools" that smart money targets.
Timeframe Alignment (Automatic):
• 15s chart → 1min HTF
• 1min chart → 15min HTF
• 5min chart → 1hour HTF
• 15min chart → 4hour HTF
• 1hour chart → Daily HTF
• 4hour chart → Weekly HTF
• Daily chart → Monthly HTF
Swing Detection:
The indicator uses customizable left/right bar counts to identify valid swing points on the HTF. Default values are optimized per timeframe (e.g., 10 bars for 1h, 5 bars for Daily), but can be adjusted to your preference.
Visualization:
• Green lines = Buyside liquidity (swing highs where long stops sit)
• Red lines = Sellside liquidity (swing lows where short stops sit)
• Solid style = Untouched liquidity
• Dotted style = Swept liquidity
█ SETTINGS
Swing Detection Group:
• Swing Bars - 1 Minute: Default 5 bars
• Swing Bars - 15 Minutes: Default 8 bars
• Swing Bars - 1 Hour: Default 10 bars
• Swing Bars - 4 Hours: Default 6 bars
• Swing Bars - Daily: Default 5 bars
• Swing Bars - Weekly: Default 3 bars
• Swing Bars - Monthly: Default 2 bars
Tip: Increase values for cleaner charts with major levels only. Decrease for more sensitive detection.
Display Group:
• Buyside Liquidity Color: Default green
• Sellside Liquidity Color: Default red
• Line Width: Adjustable 1-5
█ HOW TO USE
Reading the liquidity levels:
🟢 Green solid line = Untouched buyside liquidity (potential magnet for price)
🔴 Red solid line = Untouched sellside liquidity (potential magnet for price)
🟢 Green dotted line = Swept buyside liquidity (bulls trapped)
🔴 Red dotted line = Swept sellside liquidity (bears trapped)
Trading Applications:
1. Liquidity Grab Reversals: Watch for sweeps followed by immediate reversals
2. Stop Hunt Detection: Multiple sweeps often precede strong counter-moves
3. Target Identification: Use untouched levels as potential price magnets
4. Market Structure Analysis: Understand institutional order flow
5. Confluence Zones: Combine with order blocks, FVGs, or other ICT concepts
Best Practices:
• Focus on liquid markets (major FX pairs, indices, large-cap stocks)
• Consider higher timeframe trend - sweeps against trend are higher probability
• Look for liquidity clusters (multiple levels close together)
• Wait for confirmation after sweeps before entering
• Not all sweeps result in reversals - context matters
█ TRADING STRATEGY EXAMPLES
Liquidity Sweep Reversal:
1. Identify untouched liquidity level
2. Wait for price to sweep through (line turns dotted)
3. Look for reversal price action (engulfing, rejection)
4. Enter in reversal direction with stop beyond the sweep
5. Target next liquidity level or structure
Liquidity-to-Liquidity:
1. Price sweeps sellside liquidity (red dotted)
2. Enter long positions
3. Target buyside liquidity above (green solid)
4. Exit when buyside liquidity is swept
█ IDEAL FOR
• ICT Methodology Traders
• Smart Money Concept Practitioners
• Liquidity-Based Strategies
• Multi-Timeframe Analysis
• Price Action Traders
• Stop Hunt Avoidance
█ TECHNICAL SPECIFICATIONS
• Maximum Lines: 500
• Lookback Range: Up to 1000 bars for precise placement
• Compatible: All markets and timeframes
• Data: Works on both real-time and historical bars
█ NOTES & DISCLAIMERS
• This indicator is a tool for analysis, not a standalone trading system
• Always use proper risk management and combine with other analysis
• Performance may vary across different markets and conditions
• Based on ICT concepts - familiarity with Smart Money trading is recommended
█ LIQUIDITY FOR SINGLETIMEFRAMES
If you prefer normal liquidity lines you can use my other free liquidity indicator
PaisaPani - Demo Performance (Silver)This indicator shows a DEMO performance snapshot
to explain how a rule-based framework behaves on charts.
It is NOT a live trading system.
It does NOT provide Buy/Sell signals.
No profit guarantees are implied.
🔹 Separate indicators are designed for different instruments
(Nifty, BankNifty, Silver etc.)
🔹 Intended to be used only on the mentioned timeframes
🔹 Focused on structure, discipline, and risk awareness
🔒 Full PaisaPani strategy is Invite-Only.
If you have any queries, you may message "ACCESS" on TradingView.
⚠ Disclaimer:
This demo is for educational purposes only.
Trading involves risk. Please use your own judgment.






















