Ichimoku Cloud Breakout [Full System + Black Labels]Ichimoku Cloud Breakout & Twist System This indicator implements a disciplined Ichimoku Cloud Breakout strategy designed to filter noise and capture high-probability trends. Unlike simple crossovers, it enforces a "Triple Confluence" setup: price must break the Cloud, the Future Cloud must match the trend direction, and the Chikou Span (Lagging Span) must be free of past price traffic to confirm momentum. To keep your charts clean, it features a State Filter that blocks repetitive alerts (alternating Buy/Sell signals only) and includes a predictive "Twist Ahead" warning system, which visually alerts you to future Cloud twists, often a precursor to reversals or volatility, 26 periods in advance.
Indicadores y estrategias
Cloud Donchian + Keltner + Bollinger**XAUUSD M1 - Upper, Middle & Lower Combination Clouds**
This indicator combines three widely used volatility channels — Donchian, Keltner, and Bollinger Bands — into a single, clear cloud overlay optimized for the XAUUSD 1-minute chart.
**What it does:**
- Calculates upper, middle, and lower volatility zones by combining the three channels.
- The **Upper Cloud** shows the potential upper price boundary based on the highest highs of the combined indicators.
- The **Lower Cloud** shows the potential lower price boundary from the lowest lows of the combined indicators.
- The **Middle Cloud** fills the area between the upper cloud’s bottom and lower cloud’s top, colored dynamically: green for rising trends and red for falling trends.
- Visible lines highlight the upper and lower cloud boundaries for precise reference.
**Why it’s useful:**
- Helps traders identify support and resistance zones based on multiple volatility measures.
- The dynamic middle cloud coloring provides intuitive visual cues on trend direction and strength.
- Designed specifically for scalpers and short-term traders focused on fast-moving gold markets (XAUUSD, 1-minute timeframe).
- Fully customizable input parameters allow users to adjust channel lengths and sensitivities to fit their trading style.
**Inputs:**
- Donchian channel length
- Keltner channel EMA length and ATR multiplier
- Bollinger Bands length and multiplier
- Customizable cloud colors and line colors
**Usage notes:**
- This is a tool to support decision-making — it should be used in conjunction with other analysis techniques.
- It does not provide explicit buy or sell signals but highlights key volatility zones and trend shifts.
- Performance depends on market conditions; backtest results do not guarantee future outcomes.
- The indicator is open-source and configurable to fit individual preferences.
**Important:**
- No guaranteed profits — trade responsibly.
- Always combine this tool with sound risk management.
Weekly Regime Filter - Trend + Momentum + Structure (MTF)A multi-timeframe weekly regime indicator that classifies market conditions into BULL , BEAR , or CHOP using three components: trend, momentum, and market structure.
Works on any timeframe while always referencing weekly data — no repainting.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IT DOES
Answers one question: What is the weekly regime?
• Trend — EMA hierarchy (Price > EMA Fast > EMA Slow)
• Momentum — DI+ vs DI- with optional ADX filter
• Structure — Break of Structure (BOS) and Change of Character (CHOCH)
BULL = All three bullish
BEAR = All three bearish
CHOP = Mixed signals
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ KEY FEATURES
• Multi-Timeframe (MTF) — View on 1H, 4H, Daily; regime stays consistent
• Auto-Detect Asset Type — Automatically applies optimized settings for Crypto, Stocks, Forex, Gold, Silver, Oil, Commodities
• BOS/CHOCH Labels — Visual market structure breaks on chart
• Live Status Panel — Shows regime, components, and active parameters
• Non-Repainting — Uses confirmed weekly closes only
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 ASSET PRESETS
• Crypto — EMA 50/200, ADX Off, Pivot 2
• Stocks/Indices — EMA 50/200, ADX >20, Pivot 3
• Forex — EMA 30/100, ADX >25, Pivot 2
• Gold — EMA 40/150, ADX >20, Pivot 3
• Silver — EMA 40/150, ADX >22, Pivot 3
• Oil — EMA 30/100, ADX >25, Pivot 2
• Commodities — EMA 40/120, ADX >20, Pivot 3
Select "Custom" to use your own values.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 HOW TO USE
For Swing Trading:
• Set chart to Daily
• Use Auto-Detect or select preset
• Long only when BULL, short only when BEAR
• Reduce size or avoid when CHOP
Structure Signals:
• CHOCH ↑ after bear regime = Early reversal signal
• CHOCH ↓ after bull regime = Tighten stops
• BOS in regime direction = Trend continuation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 ALERTS
• Regime → BULL
• Regime → BEAR
• CHOCH → Bull
• CHOCH → Bear
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ SETTINGS
Preset: Auto-Detect, Crypto, Stocks, Forex, Gold, Silver, Oil, Commodities, Custom
Custom Settings (when Custom selected):
• EMA Fast/Slow lengths
• ADX Length & Threshold
• ADX Filter toggle
• Pivot Left/Right
Display:
• Plot Weekly EMAs
• Show BOS/CHOCH Labels
• Show Regime Background
• Background Opacity
• Show Status Label
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 NOTES
• Needs ~200 weeks of history for full calculation
• Weekly signals are slower by design — filters noise
• Not a standalone system — combine with entries and risk management
• When using presets, Custom input fields won't visually update (Pine limitation) — status label shows actual values
ABCD Strategy (v7 Ready)//@version=6
indicator("ABCD Strategy v7 – MTF S/R Filter", overlay=true, max_lines_count=300, max_labels_count=300)
//━━━━━━━━━━━━━━━━━━━━━
// INPUTS
//━━━━━━━━━━━━━━━━━━━━━
pivotLen = input.int(5, "Swing Strength", minval=2)
bcMin = input.float(0.618, "BC Min Fib")
bcMax = input.float(0.786, "BC Max Fib")
cdMin = input.float(1.272, "CD Min Extension")
cdMax = input.float(1.618, "CD Max Extension")
htfTF = input.timeframe("240", "Higher Timeframe (S/R)")
srLookback = input.int(200, "HTF S/R Lookback")
srTolerance = input.float(0.002, "S/R Zone Tolerance (0.2%)")
showSR = input.bool(true, "Show HTF S/R Zones")
showTargets = input.bool(true, "Show Targets")
//━━━━━━━━━━━━━━━━━━━━━
// HIGHER TF SUPPORT / RESISTANCE
//━━━━━━━━━━━━━━━━━━━━━
htfHigh = request.security(syminfo.tickerid, htfTF, ta.highest(high, srLookback))
htfLow = request.security(syminfo.tickerid, htfTF, ta.lowest(low, srLookback))
srHighZoneTop = htfHigh * (1 + srTolerance)
srHighZoneBottom = htfHigh * (1 - srTolerance)
srLowZoneTop = htfLow * (1 + srTolerance)
srLowZoneBottom = htfLow * (1 - srTolerance)
//━━━━━━━━━━━━━━━━━━━━━
// DRAW HTF ZONES
//━━━━━━━━━━━━━━━━━━━━━
if showSR
box.new(bar_index - 5, srHighZoneTop, bar_index + 5, srHighZoneBottom,
bgcolor=color.new(color.red, 85), border_color=color.red)
box.new(bar_index - 5, srLowZoneTop, bar_index + 5, srLowZoneBottom,
bgcolor=color.new(color.green, 85), border_color=color.green)
//━━━━━━━━━━━━━━━━━━━━━
// SWING DETECTION
//━━━━━━━━━━━━━━━━━━━━━
ph = ta.pivothigh(high, pivotLen, pivotLen)
pl = ta.pivotlow(low, pivotLen, pivotLen)
var float A = na
var float B = na
var float C = na
var float D = na
var int Ab = na
var int Bb = na
var int Cb = na
var int Db = na
if not na(pl)
A := B
Ab := Bb
B := C
Bb := Cb
C := low
Cb := bar_index
if not na(ph)
A := B
Ab := Bb
B := C
Bb := Cb
C := high
Cb := bar_index
//━━━━━━━━━━━━━━━━━━━━━
// ABCD LOGIC
//━━━━━━━━━━━━━━━━━━━━━
ab = math.abs(B - A)
bc = math.abs(C - B)
bcFib = bc / ab
validBC = bcFib >= bcMin and bcFib <= bcMax
bull = C > B
cdMinPrice = bull ? C - bc * cdMin : C + bc * cdMin
cdMaxPrice = bull ? C - bc * cdMax : C + bc * cdMax
inDzone = low <= cdMaxPrice and high >= cdMinPrice
//━━━━━━━━━━━━━━━━━━━━━
// MTF STRUCTURE FILTER
//━━━━━━━━━━━━━━━━━━━━━
nearResistance = close <= srHighZoneTop and close >= srHighZoneBottom
nearSupport = close <= srLowZoneTop and close >= srLowZoneBottom
structureOK =
(bull and nearSupport) or
(not bull and nearResistance)
//━━━━━━━━━━━━━━━━━━━━━
// FINAL D CONFIRMATION
//━━━━━━━━━━━━━━━━━━━━━
if validBC and inDzone and structureOK
D := close
Db := bar_index
//━━━━━━━━━━━━━━━━━━━━━
// TARGETS
//━━━━━━━━━━━━━━━━━━━━━
tp1 = bull ? D + math.abs(D - C) * 0.382 : D - math.abs(D - C) * 0.382
tp2 = bull ? D + math.abs(D - C) * 0.618 : D - math.abs(D - C) * 0.618
//━━━━━━━━━━━━━━━━━━━━━
// DRAW PATTERN
//━━━━━━━━━━━━━━━━━━━━━
if not na(D)
line.new(Ab, A, Bb, B, width=2, color=color.blue)
line.new(Bb, B, Cb, C, width=2, color=color.orange)
line.new(Cb, C, Db, D, width=2, color=color.green)
label.new(Db, D, "D (HTF CONFIRMED)", style=label.style_label_down, color=color.yellow)
if showTargets
line.new(Db, tp1, Db + 12, tp1, color=color.green)
line.new(Db, tp2, Db + 12, tp2, color=color.teal)
alertcondition(validBC and inDzone and structureOK,
"ABCD v7 Confirmed",
"ABCD Pattern confirmed at Higher-Timeframe Support/Resistance — wait for price action.")
SB - Print MachineIntraday Trading (Buying Only), Observation - Nifty 50, Trade - Nifty options (ATM)
Rules Call Options (ATM):
1. VWDEMA turns Green (Bullish)
2. VDema turns Green and crossing VWDema upside (Bullish)
3. ATR turns Green (Bullish)
4. VCP background turns Green (Bullish)
Rules Put Options (ATM):
1. VWDEMA turns Red (Bearish)
2. VDema turns Red and crossing VWDema downside (Bearish)
3. ATR turns Red (Bearish)
4. VCP background turns Red (Bearish)
Indicator Settings :
1. VWDEMA Length - 44
2. VDema Length - 21
3. ATR Length - 14
4. ATR Multiplier - 1.5
5. BB - Ignore and Skip (Hide)
6. Pivot Calculation Method - Wick
7. Pivot Left Length (Low/High) - 4
8. Pivot Right Length (Low/High) - 1
9. Pivot Levels - Enable All
10. Pivot Markers - Disable
11. Pivot Values - Disable
12. VPC Length - 14
13. VPC Time Frame - 3 Minutes
14. Main Chart Time Frame - 5 Minutes
Display Settings : As per your eye comfort
Note - All settings are customisable here and most are with dynamic colour code (Different colours for upside and downside movement)
Setting shown here are used by me and deliver good results to me only, you can find out your own settings which suits you the best.
Good Luck !!
Gold Futures Prop-Firm Strategy (GC) 1-18-2026Overview
This is a long-only, session-based, multi-regime trading strategy designed specifically for Gold futures (GC / GC1!) on intraday timeframes (typically 5–15 minutes).
The strategy aims to capture high-probability moves during the New York and Asian sessions while avoiding major economic news events and enforcing strict daily risk limits — making it suitable for prop firm challenges (e.g. FTMO, FundedNext, Apex, etc.) that require consistent profitability, limited drawdown, and disciplined risk management.
Core Philosophy
Trade longs only (shorts were removed after analysis showed they were consistently unprofitable)
Different logic depending on session and market regime (trending vs ranging)
Heavy filtering using trend strength (ADX), volume confirmation, EMA alignment, Bollinger Bands, and RSI
Strict position sizing, daily loss cap, per-session trade limits, and news blackout periods
Trailing stop mechanism to let winners run while protecting against reversals
Trading Sessions & Time Windows (Eastern Time)
NY Session: 08:30 – 15:00 ET
NY AM (trend/breakout zone): 08:30 – 11:30 ET
NY PM (mean-reversion zone): 11:30 – 15:00 ET
Asia Session (mean-reversion zone): 18:00 – 02:00 ET
News blackouts: short windows around high-impact releases (CPI/NFP, ISM/Fed, FOMC)
Entry Logic (Long Only)
NY AM – Trend Following & Breakouts (strongest trend filter)
ADX > 30 (strong trend)
Price above 200 EMA (bull regime)
Fast EMA (21) crosses above Slow EMA (55) or breakout above 20-bar high
Volume spike (> 1.4 × 20-period SMA)
Max 2 trades per NY session per day
NY PM & Asia – Mean Reversion
ADX ≤ 30 (ranging market)
Price below lower Bollinger Band (20, 2.0)
RSI < 25 (deep oversold)
No volume filter required here
Max 2 trades per Asia session per day
Risk Management Rules
Position size: Fixed 1–2 contracts (user selectable)
Initial stop: 1.7 × ATR(14) below entry (tightened from original)
Trailing stop:
Activates after price moves +1.0 × ATR in profit
Trails by 1.0 × ATR (locked-in profits aggressively)
Daily loss limit: -$600 (stops all trading for the day once hit)
No trading during defined news windows
Pyramiding disabled (only one position at a time)
No short entries (removed after backtest analysis)
Indicators Used
EMA 21 / 55 / 200 (trend direction & filter)
ATR(14) × 0.85 (volatility base)
ADX(14) threshold 30 (strong trend confirmation)
Bollinger Bands (20, 2.0) for mean-reversion entries
RSI(14) with oversold < 25
Volume spike filter (1.4× SMA) for trend/breakout entries
20-bar highest high / lowest low for breakout detection
Visual Elements on Chart
Fast (blue), Slow (orange), and Filter (red) EMAs
Bollinger Bands (gray, semi-transparent fill)
Background coloring:
Red tint during news blackout periods
Purple tint when daily loss limit is hit
Intended Use Case
Prop trading firm evaluation accounts
Conservative intraday gold trading
Focus on high-quality long setups in trending (NY AM) and mean-reverting (Asia/PM) environments
Goal: positive expectancy with controlled drawdown, suitable for passing drawdown and profit targets
[SMC] Binet Nexus Alpha : Institutional Liquidity & Order BlocksBINET™ NEXUS ALPHA : The Institutional SMC Terminal
Overview
The BINET™ NEXUS ALPHA is a professional-grade execution terminal designed to bridge the gap between retail "Smart Money Concepts" and actual institutional data. Built on the proprietary BINET™ Core v17.5 engine, this terminal prioritizes Price Action Narrative over lagging signals.
Unlike basic SMC indicators that clutter charts with unverified boxes, the Nexus Alpha uses an Institutional Confluence Engine to filter out retail "stop-run" noise and identify high-conviction zones where big money is actually positioning.
The Narrative Engine (Visual Intelligence)
The terminal replaces abstract lines with a high-visibility geometric narrative designed for rapid scanning on 4K/high-res monitors:
█ (Solid Blue Block): Institutional Vol Spike. Represents a "Foundation Surge" where volume significantly exceeds retail averages.
◆ (Gold Diamond): Liquidity Hunt. Direct identification of price tapping into resting Order Blocks (OB) or Fair Value Gaps (FVG).
● (Blue Circle): Macro Accumulation. Alerts you to long-term institutional position building.
▲/▼ (Triangles): Market Structure Breaks. Real-time Break of Structure (BOS) tracking.
The Command HUD (Mission Control)
The terminal features a real-time Hierarchical HUD that audits every trade before you enter:
Signal Quality (Sync Score): A 0-100% confluence rating. 85%+ represents "Elite Institutional Sync."
Stop Advisor & Risk Meter: Calculates the highest-volume liquidity bin for stop placement and warns you if the Max Stop Distance (%) is exceeded.
Market Health Engine: Automatically detects the current regime (Scalp, Swing, or Position) to adjust your execution strategy.
Success Probability: A rolling trajectory of the system's performance, showing whether recent win-rates are trending up (▲) or down (▼).
Institutional Workflow
Filter: Check the Trade Bias (Long/Short) on the HUD.
Confirm: Wait for the Sync Score to cross your threshold (Default 65%).
Audit: Verify that the Risk Meter is not in "High Exposure" mode.
Execute: Target the provided TP1/TP2 levels projected on the chart.
Technical Specifications
Language: Pine Script® v6
Logic: Smart Money Concepts (SMC) + Volume Delta Analysis
Core: BINET™ v17.5 Concurrency Engine
Founder's Note
The BINET™ NEXUS ALPHA was designed for traders who demand institutional-grade transparency. It is the final piece of the BINET Suite, designed to be used alongside the Macro Sector Rotation and Trend Matrix tools for a complete Top-Down to Bottom-Up trading workflow.
SB - Print MachineIntraday Trading @ 5 Minutes TF -Observation @ Nifty 50 Index , Trade on - Nifty options
Rules : Call options (ATM) Entry :
1. VWDEMA is Green (Bullish)
2. Vdema is Green and Crossing VWDema upside (Bullish)
3. ATR Turns Green (Bullish)
4. Vwap Channel Background is Green
Put Options (ATM) Entry :
1. VWDEMA is RED (Bearish)
2. Vdema is Red and Crossing VWDema downside(Bearish)
3. ATR Turns Red (Bearish)
4. Vwap Channel Background is red
Settings :
VWDEMA - 44
VDema - 21
ATR - 14
ATR Multiplier - 1.5
BB - Skip
Pivot Calculation Method - Wick
Left length - 4
Right Length - 1
Pivot Lebels - Enable all
Pivot arkers - Skip All
Pivot Values - Skip All
VPC Length - 14
VPC Time Frame - 3 minutes
Main Chart Time Frame - 5 Minutes
Colour Display Settings : As per you eyes comfort. Parameters have dynamic colour coding (different for uptrend and downtrend, use accordingly)
Parameters here are customisable, Shared here is what I am using and getting good results. Test your settings which suits you best. Good Luck !!
BTCUSD 1D Trend Strategy [Gemini]1Dchart
100% of equity per trade
0.1% commission
1 tick slippage
please convert this indicator to a trading strategy as you see fit
find attached the date of the chart and the indicator on BTCUSD 1D chart so you can make a better decision when to buy and sell
avoid forward looking and repainting at all costs.
Don't add tables to the chart
don't ever use line breaks in function calls:
long only
2018-2069
1D chart
100% of
Multi-Data Chart-AnalyticsDynamic Sentiment & Contextual Trend Analysis
Function Description
The Multi-Data Chart-Analytics is a comprehensive market context indicator designed to convert complex technical data into a readable, real-time narrative. Unlike traditional visual-only indicators, this script acts as an on-chart "trading assistant" that evaluates price action, momentum, volatility, and institutional volume simultaneously.
Key Technical Features:
Adaptive Trend Engine: Automatically scales its lookback period based on available historical data (up to 200 periods). This ensures accurate analysis for "young" assets or high timeframes (like BTC on Monthly charts) where standard fixed-length EMAs fail.
Momentum & Feel Tracking: Integrates RSI and DMI (ADX) to determine if the market is overextended (expensive) or undervalued (cheap), and whether the trend has sufficient strength.
Volatility Squeeze Detection: Monitors Bollinger Band width to alert users to "coiling" phases, signaling imminent breakouts.
Institutional Volume Filter: Compares current volume against its 20-period moving average to identify "Smart Money" conviction.
Who is this for?
Discretionary Traders: Who want a quick "second opinion" or sanity check before entering a trade.
Beginners: Who find it difficult to read multiple indicators at once; the terminal translates lines into actionable insights.
Systematic Traders: Who need to maintain awareness of higher-timeframe context without cluttering their main chart window.
How to Use It
Look at the Environment: Start by checking the long-term trend status to ensure you aren't trading against the dominant market force.
Verify Momentum: Check "Market Feel" to avoid buying at exhaustion points (Overbought) or selling at bottoms (Oversold).
Prepare for Breakouts: Keep an eye on the "Volatility" section. If it indicates a "Squeeze," tighten your stops or prepare for a large move.
Confirm with Smart Money: Only trust significant moves if the terminal confirms "Institutional Activity" is present.
Customize: Use the settings menu to adjust the box width, colors, and font size to fit your personal chart layout.
Technical Breakdown (Short Form)
Trend: Adaptive EMA/SMA (max 200).
Momentum: RSI (14) + ADX (14).
Volatility: Bollinger Band Width (20).
Volume: SMA (20) based Volume multiplier.
You might want to use this script in combination with our "Range Indicator Golden Pocket" and "Multi Asset & Multi Timeframe Trend Dashoboard" and the "Risk & Reward Position Planner"
TimeframeAlignTHE PROBLEM THIS LIBRARY SOLVES
When you use `request.security()` to get data from a Higher Timeframe (HTF) and try to draw objects like boxes, lines, or labels, they appear at the wrong horizontal position . This is the "floating in space" problem.
Why does this happen?
The `bar_index` in Pine Script refers to where data was RECEIVED , not where the event OCCURRED .
Consider this scenario:
• You're on a 5-minute chart
• You request 1-hour data for drawing an FVG (Fair Value Gap)
• A 1H candle spans 12 chart bars (60min / 5min = 12)
• But your code draws at `bar_index - 1` or `bar_index - 3`
• The result: your FVG box is only 2-3 bars wide instead of spanning the correct 12-36 bars
This library solves that by tracking where HTF bars actually start and end on your chart timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE THIS LIBRARY
Step 1: Import the Library
```
import ArunaReborn/TimeframeAlign/1 as tfa
```
Step 2: Create a Tracker for Each HTF
```
var tfa.HTFTracker tracker1H = tfa.createTracker("60")
```
Step 3: Update the Tracker Every Bar
```
tfa.updateTracker(tracker1H, "60")
```
Step 4: Use Synced Drawing Functions
```
if tfa.htfBarChanged(tracker1H)
tfa.syncedBox(tracker1H, 3, 1, topPrice, bottomPrice, color.new(color.green, 80))
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXPORTED TYPES
TimeframePair
Stores metadata about the relationship between source and chart timeframes.
• sourceTimeframe - The HTF/LTF being compared
• chartTimeframe - Current chart timeframe
• isHTF - True if source is higher than chart
• isLTF - True if source is lower than chart
• barRatio - Chart bars per source bar
• secondsRatio - Time ratio between timeframes
MTFEventData
Stores synchronized event data with correct bar positions.
• price - Price level of the event
• eventTime - Unix timestamp of the event
• chartBarStart - Chart bar_index where event's TF bar started
• chartBarEnd - Chart bar_index where event's TF bar ended
• htfOffset - The HTF offset used
• isValid - True if synchronization succeeded
HTFTracker
Tracks HTF bar boundaries. Create one per timeframe you need to track.
• htfTimeframe - The timeframe being tracked
• currentStartBar - Where current HTF bar started
• currentEndBar - Where current HTF bar ends (provisional)
• startHistory - Array of historical start positions
• endHistory - Array of historical end positions
• lastUpdateBar - Last bar_index when updated
• barJustChanged - True if HTF bar changed on this chart bar (set by updateTracker)
SyncedBox
Managed box with synchronization metadata.
• bx - The Pine Script box object
• htfTimeframe - Source timeframe
• leftHtfOffset / rightHtfOffset - HTF offsets for edges
• topPrice / bottomPrice - Price boundaries
• extendRight - Auto-extend flag
SyncedLine
Managed line with synchronization metadata.
• ln - The Pine Script line object
• htfTimeframe - Source timeframe
• htfOffset - Anchor offset
• price - Price level (horizontal lines)
• isHorizontal - Line orientation
• extendRight - Auto-extend flag
SyncedLabel
Managed label with synchronization metadata.
• lbl - The Pine Script label object
• htfTimeframe - Source timeframe
• htfOffset - Anchor offset
• price - Price level
• anchorPoint - "start", "end", or "middle"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXPORTED FUNCTIONS
━━ CORE FUNCTIONS ━━
getTimeframeInfo(sourceTimeframe)
Analyzes relationship between a source TF and chart TF.
Returns: TimeframePair with comparison metadata
createTracker(htfTimeframe)
Creates a new HTF tracker. Call once per timeframe, store with `var`.
Returns: HTFTracker instance
updateTracker(tracker, htfTimeframe, historyDepth)
Updates tracker with current bar data. Call on every bar.
• htfTimeframe: The timeframe string (must match createTracker)
• historyDepth: Max HTF bars to track (default 500)
Returns: Updated tracker
getStartBar(tracker, htfOffset)
Gets chart bar_index where a specific HTF bar started.
• htfOffset: 0=current, 1=previous, 2=two bars ago, etc.
Returns: bar_index or na
getEndBar(tracker, htfOffset)
Gets chart bar_index where a specific HTF bar ended.
Returns: bar_index or na
htfBarChanged(tracker)
Detects when HTF bar just changed.
Returns: True on first chart bar of new HTF bar
findBarAtTime(timestamp, maxLookback)
Searches backward to find chart bar containing a timestamp.
• maxLookback: How far back to search (default 500)
Returns: bar_index or na
syncEventToChart(tracker, eventPrice, eventTime, anchorPoint)
Generic sync function mapping any event to correct chart position.
• anchorPoint: "start", "end", or "middle"
Returns: MTFEventData
━━ DRAWING CREATION FUNCTIONS ━━
syncedBox(tracker, leftHtfOffset, rightHtfOffset, topPrice, bottomPrice, bgcolor, ...)
Creates a box at correct HTF-aligned position.
• leftHtfOffset: HTF bars back for left edge
• rightHtfOffset: HTF bars back for right edge
• extendRight: Auto-extend to current bar
Returns: SyncedBox or na
syncedHLine(tracker, htfOffset, price, lineColor, lineStyle, lineWidth, extendRight)
Creates horizontal line anchored to HTF bar start.
• extendRight: If true, extends to current bar (default true)
Returns: SyncedLine or na
syncedVLine(tracker, htfOffset, atStart, lineColor, lineStyle, lineWidth)
Creates vertical line at HTF bar boundary.
• atStart: True=start of HTF bar, False=end
Returns: SyncedLine or na
syncedLabel(tracker, htfOffset, price, labelText, anchorPoint, ...)
Creates label at correct HTF-aligned position.
• anchorPoint: "start", "end", or "middle"
Returns: SyncedLabel or na
syncedPlotValue(tracker, value, htfOffset)
Returns value for plotting only at synced positions.
Returns: value if current bar is within HTF range, otherwise na
━━ UPDATE FUNCTIONS ━━
updateSyncedBox(syncedBox, extendToCurrentBar)
Extends existing box's right edge to current bar.
Returns: Updated SyncedBox
updateSyncedLine(syncedLine, extendToCurrentBar)
Extends existing horizontal line to current bar.
Returns: Updated SyncedLine
updateSyncedLabel(syncedLabel, tracker, newText, newPrice)
Updates label text/price while maintaining sync.
Returns: Updated SyncedLabel
━━ CONVENIENCE FUNCTIONS ━━
htfBarStartIndex(htfTimeframe, htfOffset, historyDepth)
Simple function to get HTF bar start without explicit tracker.
⚠️ Only tracks ONE timeframe. For multiple TFs, use createTracker pattern.
Returns: bar_index or na
htfBarEndIndex(htfTimeframe, htfOffset, historyDepth)
Simple function to get HTF bar end without explicit tracker.
⚠️ Only tracks ONE timeframe. For multiple TFs, use createTracker pattern.
Returns: bar_index or na
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
COMPLETE USAGE EXAMPLES
Example 1: FVG Box with Auto-Extend
```
//@version=6
indicator("FVG with Synced Drawing", overlay=true)
import ArunaReborn/TimeframeAlign/1 as tfa
htfInput = input.timeframe("60", "HTF for FVG")
// Create tracker for chosen timeframe
var tfa.HTFTracker fvgTracker = tfa.createTracker(htfInput)
tfa.updateTracker(fvgTracker, htfInput)
// Get FVG data from HTF (confirmed bars with offset)
= request.security(syminfo.tickerid, htfInput,
[low , high , low > high ],
lookahead=barmerge.lookahead_off)
// Store managed box
var tfa.SyncedBox fvgBox = na
// Create synced box when FVG detected
if fvgDetected and tfa.htfBarChanged(fvgTracker)
fvgBox := tfa.syncedBox(fvgTracker, 3, 1, fvgTop, fvgBot,
color.new(color.green, 85), color.green, 1, "FVG", color.white, true)
// Extend box to current bar each tick
if not na(fvgBox)
tfa.updateSyncedBox(fvgBox, true)
```
Example 2: HTF Support/Resistance Lines
```
//@version=6
indicator("HTF S/R Lines", overlay=true)
import ArunaReborn/TimeframeAlign/1 as tfa
htfInput = input.timeframe("240", "HTF for S/R")
// Create and update tracker
var tfa.HTFTracker srTracker = tfa.createTracker(htfInput)
tfa.updateTracker(srTracker, htfInput)
// Get HTF high/low (confirmed with offset)
= request.security(syminfo.tickerid, htfInput,
[high , low ], lookahead=barmerge.lookahead_off)
// Track lines
var tfa.SyncedLine resistanceLine = na
var tfa.SyncedLine supportLine = na
// Create new lines when HTF bar changes
if tfa.htfBarChanged(srTracker)
resistanceLine := tfa.syncedHLine(srTracker, 1, htfHigh, color.red, line.style_solid, 2, true)
supportLine := tfa.syncedHLine(srTracker, 1, htfLow, color.green, line.style_solid, 2, true)
// Auto-extend lines each bar
if not na(resistanceLine)
tfa.updateSyncedLine(resistanceLine, true)
if not na(supportLine)
tfa.updateSyncedLine(supportLine, true)
```
Example 3: Multiple Timeframes
```
//@version=6
indicator("Multi-TF Boxes", overlay=true)
import ArunaReborn/TimeframeAlign/1 as tfa
// Create separate tracker for each timeframe
var tfa.HTFTracker tracker1H = tfa.createTracker("60")
var tfa.HTFTracker tracker4H = tfa.createTracker("240")
var tfa.HTFTracker trackerD = tfa.createTracker("1D")
// Update ALL trackers every bar (pass the same TF string)
tfa.updateTracker(tracker1H, "60")
tfa.updateTracker(tracker4H, "240")
tfa.updateTracker(trackerD, "1D")
// Now use each tracker independently for drawing
// Each tracker maintains its own separate boundary history
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NON-REPAINTING COMPLIANCE
To ensure non-repainting behavior, always use this pattern with request.security:
```
= request.security(syminfo.tickerid, htfTimeframe,
[value1 , value2 ], // Use offset for confirmed data
lookahead=barmerge.lookahead_off) // Never use lookahead_on
```
The ` ` offset ensures you're using the previous completed HTF bar, not the current forming bar.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HISTORY DEPTH PARAMETER
The `historyDepth` parameter controls how many HTF bars are tracked:
• Default: 500 HTF bars
• Maximum: Limited by Pine Script's array constraints
• Higher values = more historical accuracy but more memory usage
• Lower values = less memory but may return `na` for older offsets
Adjust based on your needs:
```
tfa.updateTracker(tracker, 100) // Track 100 HTF bars (light)
tfa.updateTracker(tracker, 1000) // Track 1000 HTF bars (heavier)
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
IMPORTANT NOTES
1. One Tracker Per Timeframe : If you need multiple HTFs, create separate trackers for each. The convenience functions (htfBarStartIndex, htfBarEndIndex) only track one TF.
2. Update Every Bar : Always call updateTracker() unconditionally on every bar, not inside conditionals.
3. HTF Only : This library is designed for Higher Timeframe data. For LTF aggregation, use findBarAtTime() for time-based lookups.
4. Drawing Limits : Pine Script has limits on drawing objects. Use box.delete(), line.delete(), label.delete() to clean up old objects.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TROUBLESHOOTING
Q: My boxes/lines still appear at wrong positions
A: Make sure you're calling updateTracker() on every bar (not inside an if statement) and using the correct htfOffset values.
Q: Functions return na
A: The htfOffset might be larger than available history. Increase historyDepth or use a smaller offset.
Q: Multiple timeframes don't work correctly
A: Don't use the convenience functions for multiple TFs. Create separate HTFTracker instances with createTracker() for each timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CHANGELOG
v1 - Initial release
• HTFTracker pattern for reliable multi-TF tracking
• Synced drawing functions for boxes, lines, labels
• Update functions for extending drawings
• Convenience functions for simple single-TF use cases
Commodity Channel Index// BUY CONDITION
buySignal = direction < 0 and ta.crossover(cci, -100)
// ENTRY PRICE
entryPrice = close
// STOP LOSS AT SUPERTREND
stopLoss = supertrend
// RISK CALCULATION
risk = entryPrice - stopLoss
// TARGET 1:2
target = entryPrice + (risk * 2)
// ALERT
alertcondition(buySignal, title="BUY", message="Supertrend Green + CCI Cross Above -100 | RR 1:2")
// OPTIONAL PLOTS
plotshape(buySignal, title="BUY Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plot(stopLoss, title="Stop Loss", color=color.red)
plot(target, title="Target 1:2", color=color.green)
Apex Adaptive Trail [Neuro-Core Auto]Self-tuning trend and trade management framework
This version is a major functional upgrade of the original Apex Adaptive Trail.
It introduces an Auto-Pilot engine that dynamically adapts the indicator’s behavior to the active chart timeframe, reducing the need for manual tuning while preserving full transparency and control.
1. What Makes This Version Different
Unlike previous versions, v6 AUTO is not configured manually by default.
When Auto-Pilot is enabled, the script:
Detects the chart timeframe
Automatically adjusts ATR length and multiplier
Dynamically sets confidence thresholds
Modifies decay speed and add cooldowns
The result is a timeframe-aware execution model, not a fixed-parameter indicator.
Manual mode remains available for advanced users.
2. Core Architecture (Not a Simple Mashup)
This script is built as a single, state-driven system where each component influences the others.
Adaptive ATR Trail The trailing level defines both:
Trend direction
Dynamic exit logic
Its sensitivity is adjusted using volatility statistics and Auto-Pilot parameters.
Volatility Regime Detection
An ATR Z-Score is used to identify abnormal volatility conditions:
Expands the trail during high volatility
Restricts position adds when volatility is excessive
3. Confidence-Driven Decision Engine
Instead of binary signals, the script computes a normalized confidence score based on:
EMA distance (trend alignment)
ADX (trend strength)
Choppiness Index (market structure)
Daily higher-timeframe bias
All values are merged into a single confidence metric that controls:
Initial entries
Additional entries (pyramiding)
Emergency exits
4. Auto-Pilot Logic (Timeframe Adaptive)
When Auto-Pilot is active, the script selects a behavioral profile:
Turbo Mode (M1–M5): fast reaction, tight decay
Scalp Mode (M15): balanced sensitivity
Day Mode (M30): moderate trend persistence
Swing Mode (H1+): conservative and stable
This allows the same script to be used across multiple timeframes without retuning inputs.
5. Trade State & Risk Governance
The script internally tracks trade state:
FLAT LONG SHORT
Position adds are allowed only when: Price pulls back toward the adaptive trail
Confidence remains above a dynamic threshold
Volatility and cooldown conditions are respected
A Guardian system can force exits when confidence collapses during active trades.
6. How to Use
Follow the trail for trend direction INIT labels indicate potential trend starts
ADD labels indicate controlled continuation opportunities
Exit occurs on trail breaks or Guardian protection
Designed for trend-following and trade management, not for scalping or signal-only use.
7. Difference vs Previous Apex Adaptive Trail
Compared to earlier versions, update introduces:
Timeframe-aware Auto-Pilot configuration
Dynamic thresholds for entries, adds, and exits
Reduced need for manual parameter optimization
Improved usability for non-programmers
Earlier versions remain suitable for users who prefer full manual control.
8. Open-Source & Credits
This script is published as open-source under the Mozilla Public License 2.0.
© mentalExpert19609
Gann Octogram - Sacred Geometry Confluence Ver 1.0📐 Gann Octogram - Sacred Geometry Confluence Ver 1.0
Overview
Advanced Gann analysis tool combining W.D. Gann's Square of Nine principles with sacred geometry and multi-factor confluence signals. This indicator automatically detects swing highs/lows and projects octogram grids forward in time and price, identifying high-probability trading opportunities where multiple factors align.
Understanding Gann Octograms
W.D. Gann believed markets move in geometric patterns through time and price. The octogram (8-sided figure) represents the square of nine principle where:
Price divisions (1/8ths) create natural support/resistance
Time cycles mark potential reversal points
Diagonal angles show dynamic price-time relationships
Confluence zones where geometry aligns offer highest probability trades
This indicator makes these complex calculations automatic and visual.
Key Features
🎯 Intelligent Auto-Detection
Auto Gann Number Selection: Automatically chooses optimal Gann period (11, 22, 44, 88, 176) based on timeframe and data availability
Adaptive Half-Period Mode: Uses Gann/2 for faster swing detection while validating with full period
Smart Grid Projection: Projects octagrams near current price action for relevance
📊 Sacred Geometry Visualization
Octogram Grids: Complete octagonal geometry with inner square, angled square, and connecting lines
Gann Angles: 1×1 and 2×1 diagonal support/resistance angles
Time Cycles: Quarter, half, and three-quarter cycle markers
Price Levels: Automatic 1/8th division levels (0%, 12.5%, 25%, 37.5%, 50%, 62.5%, 75%, 87.5%, 100%)
⚡ Advanced Confluence System
Adjustable 4-Factor Confluence (Levels 0-4):
Price Level Touch: Precise detection of key support/resistance levels
Time Cycle Alignment: Major (25%, 50%, 75%) and minor (1/8th divisions) cycles
Octogram Geometry: Proximity to vertices and diagonal angles
Price Action: Bullish/bearish candle confirmation
Confluence Levels:
Level 0: Signals on price touch only (most signals)
Level 1: Minimum 1 factor required
Level 2: Minimum 2 factors (⭐ recommended - balanced)
Level 3: Minimum 3 factors (strict quality)
Level 4: All 4 factors required (highest quality, fewer signals)
🛡️ Signal Quality Controls
Max Signals Per Cell: Limit signals to 1-10 per grid cell
Cooldown Period: Minimum bars between consecutive signals
Cell Signal Tracking: Automatic reset when entering new time cells
Adjustable Tolerances: Fine-tune price and geometry sensitivity
How It Works
Swing Detection: Identifies significant market swings using pivot highs/lows
Grid Construction: Builds octogram grid from swing high to swing low
Multi-Grid Projection: Projects multiple cells forward (time) and vertically (price)
Confluence Analysis: Monitors all 4 factors continuously
Signal Generation: Fires BUY/SELL when confluence threshold is met
BUY Signals trigger when:
Price touches LOW zones (0%-50%)
At key time cycle points
Near octogram geometry
Bullish candle forms
SELL Signals trigger when:
Price touches HIGH zones (50%-100%)
At key time cycle points
Near octogram geometry
Bearish candle forms
Settings Guide
Structure Settings
Auto Gann Number: Enable for automatic period selection (recommended)
Manual Gann Number: 11, 22, 44, 88, or 176 bars
Use Half Period: Faster detection using Gann/2 lookback
Grid Stability: Adaptive (1/8th) / Strict (1/4th) / Relaxed (1/16th)
Signal Settings ⚙️
Confluence Level: 0-4 (start with 2)
Price Tolerance: 1-8% (default 3%)
Geometry Tolerance: 0.5-5% (default 2.5%)
Min Bars Between Signals: 1-20 (default 3)
Max Signals Per Cell: 1-10 (default 4-6)
Display Options
Toggle grid squares, octagrams, triangles, Gann angles
Customizable colors for all elements
Time cycle visualization
Swing high/low markers
Info panel with swing statistics
Best Practices
For Day Trading (5min-15min charts):
Confluence Level: 2
Auto Gann: ON
Grid Stability: Adaptive
Max Signals Per Cell: 4-6
For Swing Trading (1H-4H charts):
Confluence Level: 3
Auto Gann: ON
Grid Stability: Strict
Max Signals Per Cell: 2-4
For Position Trading (Daily charts):
Confluence Level: 3-4
Manual Gann: 88 or 176
Grid Stability: Strict
Max Signals Per Cell: 2-3
Alert Setup
Built-in alert conditions:
Gann Octogram Buy - Fires on BUY signal
Gann Octogram Sell - Fires on SELL signal
Configure alerts using TradingView's alert system to get notified when confluence zones trigger.
Backtesting Tips
Start with Confluence Level 2 (balanced approach)
Increase level to 3-4 if too many signals
Decrease to 1 if missing opportunities
Adjust tolerances based on asset volatility
Test different Gann numbers for your specific market
Credits & Theory
Based on W.D. Gann's principles:
Square of Nine
Time-Price Geometry
Sacred Geometry (Octograms)
Natural Market Cycles
Developed with modern Pine Script for reliability, efficiency, and user control.
Version History
Ver 1.0 - Initial Release
4-factor confluence system
Auto Gann number selection
Adjustable confluence levels (0-4)
Sacred geometry visualization
Signal quality controls
Support
For questions, suggestions, or issues:
Comment on this indicator
Check the code (open source)
Experiment with settings for your trading style
Happy Trading! 📈
Disclaimer
This indicator is for educational and informational purposes only. Past performance does not guarantee future results. Always practice proper risk management and never risk more than you can afford to lose. Backtest thoroughly before live trading.
TradeSkull Opening Candle Range BoxThis will give you and extended range box of the opening candle of your choice on what ever timeframe you like
Baekdoo VWAP & High-Volume Node Momentum Breakout (V6)Indicator Name: Baekdoo VWAP & High-Volume Node Momentum Breakout (V6)
Description Summary: This indicator tracks the interaction between the VWAP (Volume Weighted Average Price)—the market's "fair value"—and the High-Volume Node (Resistance) from the past 20 bars. The goal is to identify "True Breakouts" where the average entry price of all participants, not just the spot price, successfully surmounts a major supply zone.
Key Features:
Annual Cumulative VWAP: Uses a yearly-anchored VWAP to filter out daily noise on 1D charts and provide a stable trend baseline.
Volume-Based Resistance: Identifies the high of the candle with the maximum volume over 20 periods as a critical supply wall.
Institutional Volume Filter: Signals are only triggered when volume exceeds 2x the 5-day average, ensuring significant market interest.
Dual Exit Strategy: Incorporates a 1.5 ATR Trailing Stop for partial profit-taking and a 20 SMA crossunder for a full risk-off exit.
---------------
지표 명칭: 백두 VWAP 매물대 모멘텀 돌파 전략 (V6)
설명 요약: 본 지표는 시장의 평균 합의 가격인 **VWAP(Volume Weighted Average Price)**과 최근 20일간 가장 강력한 거래가 발생한 **매물대(High Volume Node)**의 상호작용을 추적합니다. 단순히 가격이 뚫는 것이 아니라, 시장 참여자들의 평균 단가 자체가 저항선을 넘어서는 '진성 돌파'를 포착하는 데 목적이 있습니다.
주요 특징:
연간 누적 VWAP: 일봉 차트에서의 노이즈를 줄이기 위해 연간 단위로 누적된 평균 단가를 사용합니다.
매물대 저항선: 지난 20일 중 최대 거래량이 터진 봉의 고점을 저항선으로 설정하여, 악성 매물이 쏟아질 수 있는 구간을 시각화합니다.
거래량 필터: 5일 평균 거래량 대비 2배 이상의 거래가 실릴 때만 신호를 발생시켜 기관 및 세력의 개입 여부를 확인합니다.
스마트 엑싯: 1.5 ATR 트레일링 스톱을 통한 수익 보존과 20일 이평선 이탈을 통한 리스크 관리를 동시에 수행합니다.
Axis-Pro System | Trend Structure + Fibonacci Pullbacks Axis-Pro System is a comprehensive Trend Following strategy designed to trade high-probability pullbacks. Unlike indicators that merely chase price, this system patiently waits for market structure alignment before seeking an entry.
The system is built on the premise of "Quality over Quantity", utilizing volatility and structure filters to avoid choppy markets (ranges) and false breakouts.
🧠 Strategy Logic
The system makes decisions based on a strict 4-step hierarchy:
Higher Timeframe (HTF) Bias:
Analyzes the trend on a higher timeframe to ensure we are trading in the direction of the dominant flow.
Structure & BOS (Break of Structure):
Identifies clear impulses that break previous highs or lows. Once a BOS is confirmed, the system "arms" the trade and waits.
Fibonacci Zone Pullback:
It does not chase the breakout. Instead, it waits for a pullback into the "Discount Zone" (Golden Zone, configurable between 0.382 and 0.618) to improve the Risk/Reward ratio.
Validation & Trigger:
Uses an ATR expansion check to filter out low-volatility periods.
Requires candle confirmation and alignment with fast EMAs before pulling the trigger.
🛡️ Risk Management
The system incorporates advanced position management using a split execution model (50/50):
Dynamic Stop Loss: Automatically calculated using an ATR multiplier or the recent Swing High/Low (whichever offers better protection).
TP1 (Take Profit 1): Closes 50% of the position at a fixed R-multiple (e.g., 1.5R) to lock in profit and moves the Stop Loss to Break-Even.
TP2 (Runner): The remaining 50% is left to run for higher targets (e.g., 3.0R) or until the trend bends, maximizing gains during strong moves.
Trailing Stop: Optional feature to trail price with a fast EMA once the first target is hit.
⚙️ Settings & Features
The script is highly customizable for different assets (Crypto, Forex, Indices):
Date Range Filter: Includes a date selector to perform precise Backtesting on specific periods (e.g., testing specifically during a Bear Market vs. Bull Market).
Auto Trendlines: Automatically draws relevant trendlines for visual support.
Quality Filters: Options to toggle the EMA 200 filter and breakout buffers.
⚠️ Disclaimer
This strategy is a tool for analysis and backtesting purposes. Past performance does not guarantee future results. It is highly recommended to test the strategy on a Demo account first and adjust parameters according to the volatility of the specific asset being traded. Always use responsible risk management.
TradeSkull Opening Candle Box range of your choiceopening candle range box....pick your time and you will have the high/low and extended range box that you can edit
Cloud Matrix [CongTrader]Cloud Matrix – Ichimoku Confluence System
Cloud Matrix is a rule-based Ichimoku confluence framework, designed to filter noise and low-probability setups by requiring multi-condition confirmation instead of single signals.
Unlike traditional Ichimoku usage (visual interpretation), this script converts Ichimoku states into a matrix scoring model.
Each setup is validated using 5 structural dimensions:
• Tenkan–Kijun relationship
• Price position vs Kumo
• Kumo polarity (Span A vs Span B)
• Chikou Span confirmation
• Price vs Kijun acceptance
Only when ≥ 3 conditions align, signals are allowed.
🔹 Signal Logic
Cloud Matrix generates two validated signal types:
• TK Cross Signals – Tenkan/Kijun crosses filtered by matrix confirmation
• Kumo Break Signals – Breakouts confirmed by cloud structure and momentum context
All signals can be configured to trigger on candle close to reduce noise and repainting.
🔹 Trend Alignment (Optional)
An optional Higher Timeframe EMA200 filter is included:
• Long signals only in HTF uptrend
• Short signals only in HTF downtrend
This improves consistency by preventing counter-trend trades.
🔹 Presets
Built-in presets allow fast adaptation:
• Traditional Ichimoku
• Crypto Fast
• Crypto Medium
• Custom mode
🔹 Usage
Use Cloud Matrix as a decision filter, not a buy/sell machine:
identify trend → wait for TK cross or Kumo break → confirm matrix alignment → execute with price action and structure-based risk management...
Wick & Body % with upper wick thresholdA simple indicator to give the sizes of wicks and main body of the last candle as percentage of high - low. No negative figures. If the candle is red, the table will be red and vice versa. Table could be located as per user preference. Upper wick threshold is user defined and will be red beyond the threshold.
Plan Limit TimerA Pine Script library that helps developers monitor script execution time against TradingView's plan-specific timeout limits. Displays a visual debug table with runtime metrics, percentage of limit consumed, and color-coded status warnings.
WHAT THIS LIBRARY DOES
TradingView enforces different script timeout limits based on subscription tier:
• Basic : 20 seconds
• Essential / Plus / Premium : 40 seconds
• Ultimate : 100 seconds
This library measures your script's total execution time and displays it relative to these limits, helping you optimize indicators for users on different plans.
THE DEBUG TABLE
When enabled, a table appears on your chart showing:
• Plan : The selected TradingView subscription tier
• Limit : Maximum allowed execution time for that plan
• Runtime : Measured script execution time
• Per Bar : Average time spent per bar
• Bars : Number of bars processed
• % Used : Percentage of timeout limit consumed (color-coded)
• Status : OK (green), WARNING (yellow), DANGER (orange), or EXCEEDED (red)
HOW IT WORKS
The library captures a timestamp at the start of your script using timenow, then calculates the elapsed time at the end. It compares this against the selected plan's timeout limit to determine percentage used and status.
Technical Note : Pine Script's timenow variable has approximately 1-second precision. Scripts that execute in under 1 second may display 0ms. This is a platform limitation, not a library issue. For detailed per-function profiling, use TradingView's built-in Pine Profiler (More → Profiler mode in the Editor).
EXPORTED FUNCTIONS
startTimer()
Call at the very beginning of your script. Returns a timestamp.
getStats(startTime, plan)
Calculates timing statistics. Returns a TimingStats object with all metrics.
showTimingTable(stats, plan, tablePosition, showOnlyOnLast)
Renders the debug table on the chart.
debugTiming(startTime, plan, tablePosition)
Convenience function combining getStats() and showTimingTable() in one call.
isApproachingLimit(stats, threshold)
Returns true if execution time has reached the specified percentage of the limit.
getRemainingMs(stats)
Returns milliseconds remaining before timeout.
formatSummary(stats)
Returns a compact single-line string for labels or tooltips.
addTimingLabel(stats, barIdx, price, labelStyle, textSize)
Creates a color-coded chart label displaying timing statistics. Useful for visual debugging without the full table. Returns the label object for further customization.
EXPORTED CONSTANTS
• LIMIT_BASIC = 20
• LIMIT_ESSENTIAL = 40
• LIMIT_PLUS = 40
• LIMIT_PREMIUM = 40
• LIMIT_ULTIMATE = 100
EXPORTED TYPE: TimingStats
Object containing:
• totalTimeMs (float): Total execution time in milliseconds
• timePerBarMs (float): Average time per bar
• barsTimed (int): Number of bars measured
• barsSkipped (int): Bars excluded from measurement
• planLimitMs (int): Plan timeout in milliseconds
• percentUsed (float): Percentage of limit consumed
• status (string): "OK", "WARNING", "DANGER", or "EXCEEDED"
HOW TO USE IN YOUR INDICATOR
//@version=6
indicator("My Indicator", overlay = true)
import YourUsername/PlanLimitTimer/1 as timer
// User selects their TradingView plan
planInput = input.string("basic", "Your Plan", options = )
// START TIMING - must be first
startTime = timer.startTimer()
// Your indicator calculations here
sma20 = ta.sma(close, 20)
rsi14 = ta.rsi(close, 14)
plot(sma20)
// END TIMING - must be last
timer.debugTiming(startTime, planInput)
ADVANCED USAGE EXAMPLE
//@version=6
indicator("Advanced Example", overlay = true)
import YourUsername/PlanLimitTimer/1 as timer
planInput = input.string("basic", "Plan", options = )
startTime = timer.startTimer()
// Your calculations...
sma = ta.sma(close, 200)
plot(sma)
// Get stats for programmatic use
stats = timer.getStats(startTime, planInput)
// Option 1: Use addTimingLabel for a quick visual indicator
if barstate.islast
timer.addTimingLabel(stats, bar_index, high)
// Option 2: Show custom warning label if approaching limit
if timer.isApproachingLimit(stats, 70.0) and barstate.islast
label.new(bar_index, low, "Warning: " + timer.formatSummary(stats),
color = color.orange, textcolor = color.white, style = label.style_label_up)
// Display the debug table
timer.showTimingTable(stats, planInput, position.bottom_right)
IMPORTANT LIMITATIONS
1. Precision : Timing precision is approximately 1 second due to timenow behavior. Fast scripts show 0ms.
2. Variability : Results vary based on TradingView server load. The same script may show different times across runs.
3. Total Time Only : This library measures total script execution time, not individual function timing. For per-function analysis, use the Pine Profiler in the Editor.
4. Historical Bars : On historical bars, timenow reflects when the script loaded, not individual bar processing times.
USE CASES
• Optimization Debugging : See how close your script is to timeout limits
• Multi-Plan Support : Help users select appropriate settings for their subscription tier
• Performance Regression : Detect when changes increase execution time
• Documentation : Show users the performance characteristics of your indicator






















