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.
Educational
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.
DOUBLE_MACDDOUBLE MACD is an advanced momentum indicator that combines two MACD calculations to provide a clearer view of market trends and entry points. Instead of relying on a single MACD, it analyzes both fast and slow momentum to improve signal accuracy.
With DOUBLE MACD, traders can:
Identify overall trend direction
Spot strong buy and sell opportunities
Filter out false signals
Understand market momentum more effectively
This indicator is useful for scalping, intraday, and swing trading. When both MACD lines align in the same direction, trade confidence increases and helps traders make better decisions.
Alpha ORB Key Levels v4.3Key Levels Indicator – Futures Market Structure
This indicator plots the most commonly used key reference levels for futures and intraday traders to map support/resistance and likely liquidity targets.
It includes:
Prior Day High & Low (RTH only – avoids Sunday/Globex contamination)
Current Day High, Low, and Open
Prior Week High & Low
Prior Month High & Low
Session Highs & Lows (where enabled)
Levels are designed to be futures-safe, non-repainting, and remain visible through after-hours until updated by the next session.
Advanced Bull-Bear Power IndicatorAdvanced Bull–Bear Power Indicator
The Advanced Bull–Bear Power Indicator is a momentum and market strength tool that quantifies the balance of power between buyers (bulls) and sellers (bears) over a selected lookback period. Rather than focusing only on price direction, it measures how much effort each side applies to move the price, combining both candle magnitude and candle frequency into a normalized strength metric.
How It Works
For every candle, the indicator calculates the absolute percentage change between the open and close. This represents the true price effort of that candle, independent of direction.
Each candle is then classified:
- Bullish candle: close > open
- Bearish candle: close ≤ open
Bullish candles contribute their strength only to bulls, while bearish candles contribute only to bears.
Over the selected period, the indicator computes:
- Average bullish candle strength
- Average bearish candle strength
- Percentage of bullish candles
- Percentage of bearish candles
Using the average strength values, a Power Ratio is calculated:
Power Ratio = Bull Avg / (Bull Avg + Bear Avg) × 100
This produces a clean 0–100 scale:
- Above 50 → Bullish dominance
- Below 50 → Bearish dominance
Visual Interpretation
The main line represents the Bull–Bear Power Ratio. Color gradients reflect dominance, where green tones indicate bullish control and red tones indicate bearish control.
Key reference levels:
- 50 → Neutral balance
- 60 → Strong bullish dominance
- 40 → Strong bearish dominance
Background highlights appear in extreme conditions:
- Above 70 → Extreme bull pressure
- Below 30 → Extreme bear pressure
Statistics Table
An optional statistics table displays:
- Average bullish strength
- Average bearish strength
- Bullish and bearish candle ratios
- Current power ratio
- Market state classification (Strong Bull, Weak Bull, Weak Bear, Strong Bear)
This allows quick assessment of whether dominance comes from consistent pressure or isolated strong moves.
Alerts
Alerts are triggered when:
- Power crosses above 60 → Strong bullish momentum
- Power crosses below 40 → Strong bearish momentum
- Power crosses 50 → Market balance shift
Practical Applications
This indicator can be used for trend strength confirmation, detecting early dominance shifts before breakouts, filtering trades in sideways or low-quality markets, and comparing momentum quality across assets or timeframes.
Key Insight
This indicator does not simply ask “Is price going up or down?”
It answers a more important question:
Which side is truly exerting more force on the market right now?
Disclaimer
This indicator should not be used as a standalone decision-making tool. It is designed to complement other forms of technical, fundamental, or contextual analysis. Always confirm signals with additional indicators, market structure, and risk management techniques. The user is solely responsible for any trading decisions made using this indicator.
Intraday Toolkit1. Visual Components of the Indicator
Understanding the visual cues is essential for quick decision-making during fast-moving intraday sessions:
Trend Background: The background color represents the Primary Cycle (80-period) bias. Green indicates a bullish trend (price is above the primary cycle), and red indicates a bearish trend (price is below the primary cycle).
The Three Cycles:
Yellow Line: Short Cycle (20) – Used for momentum triggers.
Orange Line: Mid Cycle (40) – Represents the baseline for volatility envelopes.
Red Line: Primary Cycle (80) – Defines the overall trend direction.
Volatility Envelopes: Two green lines plotted at a distance (1.5x ATR) from the Mid Cycle. These act as exhaustion zones where price is likely to revert or consolidate.
Rule 3 Signals (Purple Circles): These appear when a specific 3-candle momentum breakout occurs.
2. Trading Strategy for 5m & 15m
This toolkit is most effective when you use the 15m chart for trend confirmation and the 5m chart for precise entries.
Long (Buy) Setup
Enter a long position when the following alignment occurs:
Bullish Bias: The background must be Green (Price > Primary Cycle).
Cycle Low: A pivot low must have been detected (the indicator identifies a local bottom).
Momentum Trigger: Price must close above the Yellow Short Cycle line while the previous candle was below it.
Rule 3 Confirmation: If a purple circle appears simultaneously, it confirms strong buying momentum.
Short (Sell) Setup
Enter a short position when the following alignment occurs:
Bearish Bias: The background must be Red (Price < Primary Cycle).
Cycle High: A pivot high must have been detected (the indicator identifies a local top).
Momentum Trigger: Price must close below the Yellow Short Cycle line while the previous candle was above it.
Rule 3 Confirmation: A purple circle above the price confirms a bearish momentum shift.
3. Exit and Take-Profit Logic
The script includes "State Control" to manage your exits effectively:
Targeting the Envelopes: The primary profit target is the Outer Green Envelope. If price touches the upper envelope (for longs) or lower envelope (for shorts), the trend may be exhausted.
Momentum Exit: If price crosses back over the Yellow Short Cycle line in the opposite direction of your trade, the toolkit considers the move over and signals an exit.
4. Specific Tips for Day Trading
Avoid "Counter-Trend" Signals: Do not take Buy signals if the background is Red, or Sell signals if the background is Green. The logic is built to filter these out for better win rates.
The "Rule 3" Advantage: Use the purple circles as a "second chance" entry. If you missed the initial Buy/Sell signal, a Rule 3 circle indicates momentum is still strong in that direction.
Timeframe Synergy: * 15m: Best for seeing the "Big Picture" and avoiding noise.
5m: Best for finding entries with smaller stop-losses near the Yellow Short Cycle line.
Inside Bar Breakout ( candlestick pattern).📌 What Is This Indicator?
BOIB Pro identifies a very strict form of inside bar:
✅ The inside bar candle’s entire range (body + wicks) must be inside the BODY of the previous candle (mother candle).
❌ If even a single wick is outside the mother body, the setup is rejected.
This filters out weak and noisy inside bars and focuses only on true compression candles.
⸻
📐 Pattern Rules (Strict)
1️⃣ Mother Candle
• The candle immediately before the inside bar
2️⃣ Body-Only Inside Bar (BOIB)
A valid BOIB must satisfy:
• Inside bar high ≤ mother candle body high
• Inside bar low ≥ mother candle body low
⚠️ Normal inside bars (inside wicks only) are ignored.
⸻
⏱️ Breakout Window Logic
After a valid BOIB forms:
• The indicator waits for the next 1 to 5 candles (user-configurable)
• Entry is triggered only if price CLOSES outside the BOIB range
✅ Long Signal
• Candle closes above BOIB high
✅ Short Signal
• Candle closes below BOIB low
If no breakout occurs within the window → setup expires automatically
⸻
🎯 Entry, Stop Loss & Take Profit Logic
Once a valid breakout/breakdown occurs, the indicator automatically draws a professional trade template:
Entry
• At the close of the breakout candle
Stop Loss
• Long → below BOIB low
• Short → above BOIB high
• Optional buffer:
• ATR-based
• Percentage-based
• Or none
Take Profits
• TP1: Risk-Reward based (default 1R)
• TP2: Extended target (default 2R)
All levels are clearly visualized using:
• Horizontal price lines
• Risk and reward boxes
• Informational labels
⸻
📊 Best Use Cases
• Crypto (BTC, ETH, major alts)
• Timeframes:
• Scalping: 5m
• Day trading: 15m / 30m
• Works best when combined with:
• Market structure
• Trend bias
• Support / resistance
⸻
⚠️ Important Notes
• This is NOT an auto-trading system
• Signals should always be used with:
• Proper risk management
• Market context
• Inside bars in sideways or low-volume markets may fail
⸻
📚 Educational Purpose Disclaimer
This indicator is provided for educational and analytical purposes only.
It does not constitute financial advice.
Trading involves risk, and past behavior does not guarantee future results.
SMC Velocity Scalper (15 M)Concept & Methodology : The SMC Precision Scalper v6 is a specialized adaptation of the classic Smart Money Concepts (SMC) framework, re-engineered specifically for the fast-paced environment of 15-minute scalping. While traditional SMC indicators often lag by focusing on macro-trends, this script prioritizes Internal Market Structure and recent order flow to provide timely entries for intraday traders.
It is built on the latest Pine Script v6 engine, ensuring strict type safety, faster execution, and cleaner visuals.
Key Features
Rapid Structure Detection: Unlike standard Swing Structure (which requires 50+ bars), this script utilizes a sensitive Internal Structure algorithm (customizable length) to detect minor Breaks of Structure (BOS) and Changes of Character (CHoCH) in real-time.
15m Optimized Order Blocks: Filters out old, irrelevant institutional footprints. It automatically identifies and draws only the most recent Order Blocks (OB) that are relevant to current price action.
Fair Value Gaps (FVG): Detects imbalances where price often returns to "fill" orders before continuing the trend.
Liquidity Sweeps: Automatically highlights Equal Highs (EQH) and Equal Lows (EQL), which often act as magnets for liquidity grabs.
Premium/Discount Zones: Draws dynamic Fibonacci-based zones to help you avoid buying in a "Premium" (expensive) area or selling in a "Discount" (cheap) area.
How to Use This Indicator This tool is designed to be a complete decision-support system for scalpers.
Determine Bias: Look at the Internal Structure lines (dashed). A green "BOS" indicates a bullish continuation; a red "BOS" indicates bearish.
Wait for the Pullback: Do not chase the breakout. Wait for price to retrace into a colored Order Block box or a Fair Value Gap.
Confirm Entry: Watch for a CHoCH (Change of Character) signal within your zone. For example, if price hits a bullish Order Block, wait for a green internal CHoCH label to confirm buyers are stepping in.
Target: Aim for the weak structural points, marked as "Weak High" or "Weak Low" by the script.
Settings & Customization
Swing Length (Scalp): Controls the sensitivity of the major trend. Default is 10 for 15m charts.
Internal Structure Length: Controls the speed of minor structure signals. Lower this to 3 or 4 for hyper-aggressive scalping.
Order Blocks: You can toggle Swing vs. Internal OBs and adjust how many are displayed to keep your chart clean.
Risk Disclaimer
Important Risk Factors & Limitations
Repainting on Historical Data: This script uses request.security with lookahead to calculate Multi-Timeframe (MTF) Fair Value Gaps. While this provides accurate levels for closed candles, historical backtesting may visually "repaint" signals that were not valid in real-time. Always wait for a candle close before confirming a signal.
Lag is Natural: Even with optimized settings, structure-based indicators inherently lag because a High/Low is only confirmed after price moves away from it. This tool identifies structure breaks, not prediction.
Not Financial Advice: This indicator is a technical analysis tool, not a trading bot. It visualizes market data to aid decision-making. Trading cryptocurrency, forex, or stocks carries a high level of risk, and you can lose more than your initial investment.
False Signals: In ranging (sideways) markets, structure indicators can produce frequent "flip-flop" signals (BOS followed immediately by opposite CHoCH). Use discretion during low-volume hours.
Sessions Major & Minor |Yvon-J|Session major and minor
Identify ICT Killzone
mark previous Day HIgh / Low
mark previous Week HIgh / Low
mark previous Month HIgh / Low
Predictive Emini SP500 SystemWhat this indicator does
Purpose
A smart-money + market-dynamics trading system that predicts short-term direction, highlights high-probability zones, and filters bad trades.
Core functions
1. Market Structure (SMC)
Detects FVGs, Order Blocks, BOS, CHoCH
Shows where institutions likely buy/sell
Auto-removes zones when mitigated
2. Liquidity Logic
Tracks Asia / London / NY highs & lows
Detects liquidity sweeps
Identifies cascade sweeps (multi-session stop hunts → high conviction reversal)
Warns on fakeouts (both sides swept = stay out)
3. Direction Prediction Engine
Scores bullish vs bearish using:
Momentum
Volume pressure
Delta
Absorption
Sweeps
Structure breaks
Outputs:
Forecast: BULL / BEAR / NEUTRAL
Strength % (confidence)
4. Trade Signal System
Only triggers trades when:
Forecast strength is high
Volume confirms (RVOL)
EMA trend aligns
Candle confirms
Not in danger zone
Auto-sets:
Stop (ATR based)
Target (R multiple)
5. Danger Zone Filter (very important)
Blocks trading when:
Low volume
Low volatility
Tight range
Lunch hours
This prevents chop and overtrading.
6. Sessions & Context
Draws Asia, London, NY boxes
Helps you know when moves are likely to happen
7. Stats Table (decision panel)
One glance tells you:
Trade or wait
Direction & confidence
Trend, momentum, pressure
Session
Danger status
This indicator waits for smart money to grab liquidity, confirms direction with momentum + volume + structure, blocks bad conditions, then signals only high-probability trades.
RA Renko Strategy v1.7.1RA Renko Strategy v1.7
2-Brick Flip + Controlled Scale-Up (Renko Execution Framework)
1. Purpose of the Strategy
RA Renko Strategy v1.7 is a rule-based Renko execution framework designed to:
Capture directional shifts using 2-brick confirmation
Avoid premature flips during single-brick noise
Support controlled position scaling during pullbacks
Respect session-based trading behavior aligned with CME definitions
Provide execution discipline, not signal prediction
This strategy is execution-first, not indicator-first.
2. Chart & Instrument Requirements
Required
Chart Type: Renko (Traditional)
Instrument: Futures (CME recommended)
MNQ, MES, ES, NQ, CL, GC
Timezone: America/Chicago (CST)
Recommended
Fixed Renko brick size appropriate to volatility
Use on liquid contracts only
Avoid thin overnight products
3. Core Trading Logic (Plain English)
Entry Logic (Flip)
A trade triggers only after the 2nd Renko brick confirms direction
First brick = awareness
Second brick = permission to act
Scenario Action
2 blue bricks after red sequence Long
2 red bricks after blue sequence Short
This prevents one-brick whipsaws.
Reversal Handling
Existing position is closed first
New direction opens immediately after
Flip cooldown prevents rapid flip-flopping
4. Trade Modes (Critical Section)
Trade Mode Options
1. Intraday
Definition:
Positions must be flat by the end of the selected session.
NY selected → force flat at 3:29 PM CST
Asia or London selected → flat at session end
No trading during CME maintenance (3:30–5:00 PM CST) if NY is last session
Use this for:
Prop firm rules
Daily risk caps
Session-only trading
2. Overnight
Definition:
Positions may carry through the 5:00 PM CST reopen.
Use this when:
Holding trades across NY → Asia
Swing-style Renko continuation
CME overnight risk is acceptable
3. Swing
Same execution as Overnight, but intended for multi-session / multi-day holding.
5. Session Selection Logic
Session selection gates entries, not exits.
Session CST Time
Asia 17:00 – 02:00
London 02:00 – 08:30
NY 08:30 – 15:30
Key Rules
If Use Session Selection = ON, trades only occur inside selected sessions
If no session selected, strategy treats all sessions as valid
Intraday + NY selected enforces hard flat at 15:29 CST
6. Scale-Up (A) Logic
Scaling is not martingale.
Conditions to Add
Initial flip trade exists
Price pulls back against position (defined bricks)
Direction re-confirms with new bricks
Flip cooldown is not active
Max adds per trend not exceeded
Purpose
Improve average entry
Participate in trend continuation
Maintain position control
7. Risk Management
Protective Stop (Optional)
Stop defined in Renko bricks
Applies to:
Base position
Scale-up positions
This is a failsafe, not an optimized stop model.
8. Visual Elements (What You See on Chart)
Strategy-Generated
L / S → Flip entries
A → Scale-up entries
TradingView-Generated (Cannot Be Removed by Code)
Order arrows
Fill markers
Small numeric annotations (contract/order metadata)
These are TradingView UI elements, not Pine outputs.
9. Brick Suggestion Panel (Optional)
Purpose
Estimates reasonable Renko brick sizes
Based on:
Consolidation range
ADX filter
EMA smoothing
Important Notes
Informational only
Relevant for time-based charts
Not used in execution logic
Table is OFF by default
10. What This Strategy Is NOT
❌ Not a prediction model
❌ Not a holy-grail system
❌ Not optimized for all markets
❌ Not designed to trade low-liquidity periods
❌ Not a replacement for risk management
This is an execution framework, not a signal generator.
11. Recommended Usage Guidelines (Internal)
Start with 1 contract
Observe behavior across:
NY → Asia transitions
High-volatility opens
Validate Renko size before trading
Do not over-optimize inputs
Combine with:
Market structure
HTF bias
Session context
12. Internal Disclaimer
Internal Use Only
This strategy is provided for educational and internal research purposes.
It does not constitute financial advice, trading advice, or investment recommendations.
Futures trading involves substantial risk and is not suitable for all participants.
Past performance does not guarantee future results.
Users are fully responsible for risk management, position sizing, and compliance with firm-specific trading rules.






















