STRX - AutoCorrelationSTRX – AutoCorrelation is a quantitative analysis tool designed to monitor real‑time correlations between up to five assets, using the Pearson correlation coefficient over a customizable period and timeframe. The script displays a correlation matrix as a heatmap table together with a structured textual reading, providing an immediate operational view of the strength and direction of relationships across assets.
The “Assets to Correlate” panel allows the user to select up to five instruments (for example Gold, US100, USDX, Silver, Platinum) and to enable or disable each slot individually, so the correlation set can be quickly adapted to different market contexts. Through the “Settings” panel, the user can define an independent calculation timeframe, the lookback period for the correlation, whether to show the textual reading table, and the position of the panel on the chart.
The matrix highlights, for each pair, the normalized correlation value between −1 and +1, with a color scheme that distinguishes positive and negative correlations and emphasizes their intensity. The textual reading table classifies each relationship as “Strong”, “Moderate”, “Weak” or “Negligible” and specifies the sign (“Positive” / “Negative” / “Independent moves”), helping the user assess co‑movements, diversification, hedging behavior and potential concentration of risk across the selected assets.
This indicator is intended as a decision‑support tool for multi‑asset analysis and does not generate standalone entry or exit signals. It does not constitute financial advice or a guarantee of performance; any trading or investment decisions remain solely the responsibility of the user. Indicator

Indicator

Daily Trade Plan Generator [AGPro Series]Daily Trade Plan Generator
Daily Trade Plan Generator — complete morning briefing tool that generates a structured, rules-based trade plan for every new trading day. Combines key levels, multi-timeframe bias, projected volatility range, and adaptive Plan A/B/C playbooks into one premium dashboard.
🔷 OVERVIEW
Most traders start their day scattered — flipping through charts, trying to remember yesterday's highs and lows, guessing where the market might move. Daily Trade Plan Generator replaces that chaos with a single structured briefing. Every new trading day (either at UTC midnight for crypto or at a configurable exchange session open), the script automatically generates a complete plan: where the key levels are, which direction has the stronger multi-timeframe bias, how wide the day is likely to trade, and what the Plan A, Plan B, and Plan C playbooks look like. It is the first tool to open every morning — and it is self-updating, so you never have to reset it.
This is not a signal generator and not a strategy. It is a briefing tool, designed for traders who want to start every session with the same structured preparation a professional desk would do — without spending 30 minutes on it manually.
🎯 UNIQUE EDGE
What separates this script from generic level indicators and daily-high-low plotters:
• All-in-one daily briefing — levels, bias, volatility, and Plan A/B/C in one dashboard, not four separate indicators cluttering the chart.
• Multi-timeframe bias score (0 to 100) blending 1H, 4H, Daily, and Weekly EMA structure with three configurable weighting modes (Fast, Balanced, Conservative) so the bias matches your trading style.
• Asset-class-aware round numbers — the script auto-detects price magnitude and picks sensible round-number intervals (1000 for BTC-scale assets, 0.01 for forex majors, and so on) without manual setup.
• Projected daily range as a visual zone — ATR-based expected high and low rendered either as a semi-transparent rectangle, dashed lines, or both, giving you an immediate read on where price is likely to operate.
• Plan A / Plan B / Plan C structure (user-configurable 1 to 3) — deliberate "Plan" terminology to avoid confusion with pivot S/R notation. Plan language uses historical-pattern framing with no forecasting claims.
• Two refresh anchors plus a "both visible" option — crypto traders get UTC midnight, equities/futures traders get configurable session open, swing traders can see both markers.
• Timeframe-adaptive behavior — on weekly and higher timeframes, PDH/PDL automatically hide (since "previous day" is not meaningful there), and Plan A/B references shift to PWH/PWL for consistency.
• Smart label collision avoidance — PROJ HI/LO, PDH/PDL, and PWH/PWL labels intelligently reposition when too close together, keeping every chart readable at any scale.
• Volatility regime classification (Low / Normal / High) with a context-aware risk note that adapts to market conditions.
🧩 METHODOLOGY
LEVELS. Previous Day High/Low and Previous Week High/Low are pulled via higher-timeframe requests and rendered as persistent lines extending from today's session open to the right. The nearest round number is drawn as a single dotted line on the chart; the full list of nearby round numbers is shown in the dashboard panel to keep the chart clean.
BIAS SCORE. For each timeframe (1H, 4H, 1D, 1W), three components are evaluated: fast EMA versus slow EMA relationship, close versus fast EMA position, and fast EMA slope direction. Each component contributes plus or minus one, averaged to a per-timeframe score between -1 and +1. The four timeframe scores are then combined using the selected weighting mode and normalized to a 0-100 scale. Scores above 65 are labeled Bull, below 35 Bear, and in between Neutral.
VOLATILITY. Daily ATR over the configurable length (default 14) determines the expected range. The range is centered on today's session open and expanded by the Range Multiplier input. ATR as a percentage of open price classifies the regime: below 1% is Low, above 4% is High, in between is Normal.
PLANS. The script composes Plan A (primary, aligned with bias), optionally Plan B (alternative, opposite-side rejection path), and optionally Plan C (range / mean-reversion, activated when volatility is low or bias is neutral). Plan references adapt automatically to chart timeframe — intraday and daily charts use PDH/PDL, weekly and higher charts use PWH/PWL. The language is deliberately conditional and references historical patterns rather than predicting future prices.
🔔 SIGNALS & ALERTS
The script includes five built-in alert conditions:
• New Daily Plan Generated — fires when the daily refresh anchor triggers.
• Price Broke PDH — crossover above Previous Day High.
• Price Broke PDL — crossunder below Previous Day Low.
• Price Exceeded Projected High — crossover above ATR-projected high (volatility expansion).
• Price Exceeded Projected Low — crossunder below ATR-projected low (volatility expansion).
Each alert includes the ticker and relevant price in the message payload, ready to route into any alert handler.
⚙️ KEY INPUTS
• Daily Refresh Anchor — UTC Midnight, Exchange Session, or Both Visible.
• Exchange Session Open Hour — 0 to 23, used when Exchange or Both is selected.
• Key Levels toggles — PDH/PDL, PWH/PWL, Round Numbers individually toggleable.
• Round Numbers in panel — 1 to 5 levels above and below the current price.
• Bias Calculation Mode — Fast (HTF-weighted), Balanced, or Conservative (MTF-weighted).
• EMA Fast / Slow periods — defaults 20 and 50.
• ATR Length and Range Multiplier — control the width of the projected daily range.
• Expected Range Visualization — Zone (Box), Dashed Lines, or Both.
• Number of Plans — A, A+B, or A+B+C.
• Panel Location — six corner/middle positions.
• Panel and Label font sizes — Tiny through Huge, default Normal.
• Panel Theme — Dark or Light, adapts to chart background.
🛠️ HOW TO USE
1. Add the script to your chart at the start of each trading day (or leave it on permanently — it refreshes automatically).
2. Read the dashboard panel top to bottom: LEVELS tell you where the battle lines are, BIAS tells you the dominant direction, VOLATILITY tells you how much room the market has, PLANS give you conditional playbooks for the day.
3. Check the "Risk Note" line — it adapts to the volatility regime and bias. Low volatility suggests patience, high volatility suggests reducing size, neutral bias suggests waiting for a clean break.
4. Use the plotted levels as structural references for your own entries and exits. The projected range box highlights where mean-reversion trades are statistically more likely to work.
5. Set alerts on PDH/PDL breaks and projected-range expansion events to get notified when your Plan A or Plan B is being tested.
6. Adjust the bias mode to match your style: intraday scalpers benefit from Fast (HTF-weighted), position traders often prefer Conservative (MTF-weighted).
⚠️ LIMITATIONS & TRANSPARENCY
• This is a briefing tool, not a strategy or signal generator. It does not open, close, or manage trades.
• All levels and plans are derived from historical data (previous day/week highs and lows, ATR, EMA structure). Past structure does not guarantee future behavior.
• Projected ranges are statistical estimates based on ATR — actual daily ranges can and do exceed them, especially during news events or regime shifts.
• The multi-timeframe bias score is a momentum/trend structure measurement, not a prediction. Markets can reverse at any time regardless of bias.
• Plan language uses historical-pattern framing deliberately. No plan is a forecast; it is a conditional reference for discretionary decision-making.
• On weekly and higher timeframes, PDH/PDL are hidden by design because "previous day" is not a meaningful unit for weekly-horizon decisions. Plan A and Plan B use PWH/PWL as reference in those cases.
• The script does not repaint on closed higher-timeframe bars. The daily open, PDH, PDL, PWH, PWL are locked once the respective higher-timeframe bar closes.
• Round-number auto-detection uses price magnitude; for unusual instruments (very high or very low priced), review the levels manually.
🛡️ RISK DISCLOSURE
Trading involves substantial risk of loss. This script is a technical analysis tool provided for informational and educational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to trade any instrument. Past performance of any pattern, level, or methodology shown is not indicative of future results. Always conduct your own analysis, manage your position size according to your risk tolerance, and consider consulting a qualified financial professional before making trading decisions. The author and AGProLabs assume no liability for any trading outcomes resulting from the use of this tool.
Indicator

Auto Trendline Break Quality [AGPro Series]Auto Trendline Break Quality
🔹 OVERVIEW
Auto Trendline Break Quality is a structural break-quality engine. It automatically detects bullish and bearish trendlines from swing pivots, monitors every break event in real time, and assigns each break a 0–100 quality score derived from four independent quantitative factors. The tool separates Major (structural) and Minor (tactical) trendlines, so the same break can be evaluated against multiple layers of market structure at once.
The script is purpose-built to answer the single most practical question a price-action trader faces at a trendline break: "Is this break real, or is it a fake-out?"
🧭 UNIQUE EDGE
Most trendline scripts either draw trendlines or flag a break. They stop there. This indicator continues where they stop — and measures the break.
Key differentiators:
• Four-factor composite quality score (Volume · Slope · Impulse · Retest) calibrated to ATR, so the scoring is consistent across assets and timeframes.
• Major/Minor trendline hierarchy. A Major structural break automatically earns a score bonus and is visually flagged with a "MAJ" tag, so structural breaks are never confused with noise breaks.
• State-based visual language. Active trendlines render in a neutral tone. On break, the trendline transitions to the break-direction color (bullish break = bull color, bearish break = bear color), so the chart communicates state without ambiguity.
• Retest logic built directly into the score. A break that is retested and holds within the defined window receives an upgrade; a failed retest downgrades the score. The chart label reflects the final, updated quality.
• Optional zone-band rendering around Major trendlines, letting the user see each structural line as a reaction zone rather than a bare line.
• Label confluence grouping to prevent chart clutter when multiple breaks occur near the same price level.
⚙️ METHODOLOGY
1) Trendline detection
Pivots are identified using standard pivot-high and pivot-low logic with two configurable lookbacks — one for Major trendlines and one for Minor. A new trendline is validated between the two most recent same-side pivots when the slope (ATR-normalized) exceeds the minimum threshold. Nearly-flat trendlines are rejected by design.
2) Break detection
A trendline is considered broken when the current candle closes on the opposite side of the projected line while the previous candle closed on the valid side. This one-bar confirmation rule avoids intra-bar flicker.
3) Quality scoring (0–100)
• Volume expansion vs 20-bar average — up to 25 points
• ATR-normalized slope steepness — up to 20 points
• Break-bar impulse measured in ATR from the line — up to 25 points
• Retest base score — 18 points, upgraded by +15 on a held retest, or reduced by 10 on a failed retest
• Major trendline bonus — +10 points
4) Retest tracking
After a break, the script watches a configurable window (default 3–8 bars) for price to return to the broken trendline within an ATR tolerance. Held retests and failed retests are tracked independently and reflected in the panel's Retest Held Rate. Retest markers are offset from the trendline in ATR units to prevent overlap with candles.
📊 SIGNALS & STATES
• Break label: "BREAK Q: · " and an optional "MAJ" tag for Major trendlines. Label color tier: High quality renders in full state color, Medium quality in neutral amber, Low quality in a muted tone.
• Retest marker: Small circular marker with "retest held" or "retest failed" text, offset from the trendline for clarity.
• Break bar border: Optional candle-border color that reflects break direction.
• Panel: Active trendlines per side, last break score and direction, overall break-direction breakdown, retest held rate, quality distribution (High/Medium/Low), total breaks tracked, and the current detection mode.
• Alerts: "High Quality Trendline Break" and "Major Trendline Break" — both standard alertcondition entries.
🎛️ KEY INPUTS
• Major / Minor Pivot Length — controls how many bars each side of a pivot must be a local extreme.
• Show Minor Trendlines — toggle tactical layer on top of structural layer.
• Max Active Trendlines per Side — caps the chart clutter.
• Volume Spike Threshold (x Avg) — ratio at which a volume expansion is considered full.
• Retest Min/Max Bars — bar range for a valid retest.
• Retest Tolerance (ATR) — how close price must come to the broken line to count as a retest.
• High / Medium Quality Thresholds — cutoffs for the three quality tiers (defaults: 70 / 50).
• Show Trendline Zone Band — renders a subtle ATR-based band around Major trendlines.
• Zone Band Width (ATR) — controls the thickness of the zone band.
• Label Confluence Grouping (ATR) — merges break labels that land within this ATR distance on nearby bars.
• Label Offset (ATR) — vertical padding so labels never embed in candles.
• Label / Panel / Help font sizes — all default to Normal.
• Panel Position and Theme — six positions, Dark/Light theme.
🧩 HOW TO USE
The indicator is a decision-support layer, not a standalone trading system.
• Treat a break with Q ≥ 70 and a "MAJ" tag as a structural event worth reviewing the higher-timeframe bias for.
• Use the retest window as a patience filter. A break with Q 55–69 that retests and holds often upgrades to a higher-quality setup after the retest.
• Failed retests are not "bad" — they are information. A failed retest on a low-quality break is a strong hint that the break was noise.
• The neutral-color active trendlines are intentional — they tell you where structure exists without biasing your read. Color appears only when structure breaks.
• Combine with your own confluence (volume profile, horizontal support/resistance, higher-timeframe trend). The script does not enter trades; it tells you how reliable a break looks at the moment it happens.
⚠️ LIMITATIONS & TRANSPARENCY
• Quality scores describe historical pattern behavior. They are not predictive probabilities.
• Trendlines are generated from pivots; the final pivot is always confirmed after the pivot-length bars have elapsed. This is standard pivot behavior and is not a repaint of historical marks — past labels remain fixed once a break bar closes.
• The script draws up to the platform's line/label limits. Older trendlines are removed when the active cap is reached.
• Parameter defaults target 4H–1D charts; lower timeframes benefit from smaller pivot lengths and tighter retest windows.
📜 RISK DISCLOSURE
This script is an analytical tool. It does not provide financial advice, investment recommendations, or a trading strategy. Past performance of any pattern, including trendline breaks, does not guarantee future results. Always perform your own analysis and apply proper risk management before making any trading decision. Indicator

Liquidity Grab Detector [AGPro Series]🧲 LIQUIDITY GRAB DETECTOR
Detects single-bar multi-level liquidity raids — the precise moment price sweeps a cluster of 2 or more distinct liquidity pools within a single candle and immediately reverses. Built for ICT, Smart Money, and institutional order-flow analysis, this engine identifies the liquidity raids that matter most: simultaneous multi-level stop hunts that typically precede the sharpest reversals.
═══════════════════════════════════════
🔹 OVERVIEW
Most liquidity tools either track single sweeps or lifecycle-based breach-and-reclaim patterns. This detector focuses on a different, rarer, and higher-conviction event: the single-bar multi-level raid. When one candle sweeps a cluster of two or more untouched liquidity levels (swing highs/lows, session H/L, previous day H/L, previous week H/L) in a single motion, the odds of a meaningful reversal increase significantly. The engine validates each grab with four independent filters, deduplicates overlapping levels, merges adjacent reversal zones for a clean chart, tiers signals by quality, and projects forward target zones.
One-click preset modes (Aggressive / Balanced / Conservative / Custom) make the detector instantly suitable for any style — from high-frequency scalping to premium-only confluence trading — without manual tuning.
This is not a strategy and makes no directional prediction. It is a detection and visualization engine for a specific institutional order-flow footprint.
═══════════════════════════════════════
🔹 UNIQUE EDGE — HOW THIS DIFFERS
The single-bar multi-level criterion is the defining separator from conventional liquidity tools:
▪ Traditional liquidity sweep detectors flag any single-level sweep. High signal rate, low conviction per signal.
▪ Breach-and-reclaim engines (equal-highs / equal-lows style) require a full lifecycle across multiple bars. Different mechanic, different timing.
▪ This detector requires a cluster of 2+ distinct liquidity levels to be swept in a single candle, within a user-defined ATR proximity. ATR-normalized thresholds adapt across all timeframes and symbols.
▪ ATR-based level deduplication merges coincident sources (e.g. Swing + PDH stacked at the same price) into a single logical level, preventing inflated sweep counts.
▪ Zone overlap-awareness: adjacent same-direction reversal zones are merged into a single extended zone rather than piling multiple boxes on top of each other. Premium, chart-clean visualization.
▪ Strikethrough length clamp keeps historical consumed-level lines from crossing the entire chart, even on long-running indicators.
▪ Preset modes encapsulate calibrated filter stacks, making the detector genuinely plug-and-play.
The combined filter stack (cluster + volume + wick + reversal + cooldown + dedup + zone-merging) produces fewer but significantly higher-quality signals with a clean visual footprint.
═══════════════════════════════════════
🔹 METHODOLOGY
Preset modes calibrate the detection engine with one selection:
▪ Aggressive — minimum 2 levels, 0.7 ATR cluster, 1.1× volume, 0.15 ATR wick, 2 bar cooldown.
▪ Balanced — minimum 2 levels, 0.45 ATR cluster, 1.5× volume, 0.3 ATR wick, 5 bar cooldown. Default.
▪ Conservative — minimum 3 levels, 0.35 ATR cluster, 2.0× volume, 0.45 ATR wick, 10 bar cooldown. Premium-only.
▪ Custom — honors manually configured input values.
Level registry with deduplication. The script maintains a live registry of untouched liquidity levels built from four configurable sources. Incoming levels within a configurable ATR tolerance of an existing level are merged. Each level is time-stamped, capped at a configurable maximum count, and pruned once it ages beyond the lookback window or is consumed by a grab.
Cluster detection. On every bar, the engine scans active levels on both sides and classifies a bar as a multi-level sweep candidate when it penetrates the minimum level count whose vertical span fits within the ATR proximity band.
Confirmation layers:
1. Volume spike — grab bar volume must exceed the rolling SMA by the preset multiplier.
2. Wick ratio — rejection wick on the grab side must exceed the preset ATR fraction.
3. Immediate reversal — within a configurable window, price must close back beyond the swept cluster.
4. Cooldown — after a confirmed grab, new detections are suppressed.
Zone overlap-awareness. When a new grab's reversal zone falls within a configurable ATR distance of a recent same-direction zone, the existing zone is extended rather than drawing a new overlapping box. Aggregate targets stay clean.
Quality tier classification. Confirmed grabs are automatically tiered by level count, with 4-level grabs and 5+ level grabs receiving progressively stronger visual emphasis.
═══════════════════════════════════════
🔹 SIGNALS & VISUALS
Confirmed bullish grab — triangle marker below the bar, "LIQ GRAB · N levels swept" label with tier stars for high-quality grabs, and a forward-projected reversal zone above the cluster with a target micro-label.
Confirmed bearish grab — mirror image with bear coloring.
Stagger-aware label placement. When multiple confirmed grabs occur close together on the chart, their labels are automatically offset vertically to prevent visual overlap.
Clean default visual profile. Swept-level strikethrough lines are disabled by default for a premium chart-clean look; enable them for detailed post-grab review. When enabled, a max-age clamp prevents extremely long lines.
Statistics panel (8 rows) — active level count, total grabs, bars since last grab, last grab source composition (dynamic, e.g. "PDL+Swing"), bullish vs bearish breakdown, reversal success rate, and average levels swept per grab.
Alerts — separate alert conditions for bullish and bearish grab confirmations, triggered on bar close.
═══════════════════════════════════════
🔹 KEY INPUTS
Detection Engine
▪ Preset Mode — Aggressive / Balanced / Conservative / Custom.
▪ Minimum Levels Swept, Cluster Proximity, Cooldown — honored in Custom mode.
▪ Level Deduplication (ATR) — merge tolerance for coincident levels.
▪ Level Lookback, Max Active Levels — registry housekeeping.
Liquidity Level Sources — swing highs/lows, session H/L, PDH/PDL, PWH/PWL.
Confirmation Filters — volume multiplier and averaging length, reversal window, minimum wick ratio, ATR length.
Visuals
▪ Toggle labels, strikethroughs, zones, statistics panel.
▪ Label and panel font size (default Normal).
▪ Panel position (8 options) and theme (Dark / Light).
▪ Zone projection length, zone height, zone transparency.
▪ Zone merge distance (ATR-based overlap suppression).
▪ Max strikethrough length (bars).
═══════════════════════════════════════
🔹 HOW TO USE
1. Start with Balanced preset on any timeframe. The ATR-based cluster logic adapts automatically, but 15m–4H timeframes on liquid instruments produce the cleanest signal set.
2. Switch to Conservative for premium-only signals at key institutional levels, or Aggressive when scalping intraday liquidity dynamics.
3. Watch for grab labels near well-defined liquidity clusters — session opens, PDH/PDL interactions, and at range edges. Tiered grabs (4+ levels raided in one bar) deserve special attention.
4. Use the reversal projection zone as a reference target area, not a mechanical take-profit. Combine with your existing structure, order blocks, or mean-reversion levels.
5. Check the "Last Sources" panel row to see which specific liquidity pools were raided most recently.
6. For detailed post-grab analysis, enable "Show Swept Level Strikethroughs" in the Visuals group. For a clean chart, leave disabled.
7. For fine-grained control, select Custom mode and adjust each filter manually.
═══════════════════════════════════════
🔹 LIMITATIONS & TRANSPARENCY
▪ No repaint on confirmed signals — grabs are finalized only after the reversal window closes with all filters passing. Swing pivots used as level sources are inherently delayed by the pivot length (standard pivot behavior).
▪ The reversal success metric uses a fixed 1 ATR / 10 bar definition and is provided as context only. It is not a performance claim or win rate.
▪ In strongly trending markets, multi-level sweeps can occur without reversal, producing failed grabs. The filter stack reduces but does not eliminate this.
▪ On very low-liquidity symbols or extremely short timeframes, volume data can be noisy. Consider disabling the volume filter in those conditions.
▪ Session, PDH/PDL, and PWH/PWL levels are derived from the chart symbol's native session definition.
═══════════════════════════════════════
🔹 RISK DISCLOSURE
This indicator is an analytical and visualization tool. It does not generate buy or sell recommendations, does not guarantee any outcome, and is not a trading strategy. All trading decisions are the sole responsibility of the user. Past pattern behavior does not guarantee future results. Always combine indicator output with your own analysis, risk management, and position sizing framework. Indicator

Trend Strength Meter [AGPro Series]Trend Strength Meter
⚡ OVERVIEW
Trend Strength Meter is a multi-factor composite oscillator that quantifies how strong a directional trend actually is, on a single 0-to-100 score. It merges five independent trend dimensions (ADX, slope angle, momentum ROC, moving-average alignment, and pullback depth) into one weighted reading, then classifies the market into three clear states: Strong Trend (80+), Mild Trend (50-80), and Weak / Range (<50). The goal is to give a trader the answer to one of the most common daily questions in technical analysis: "Is the trend strong enough to act on right now, or is it fading?"
The indicator is built for discretionary and systematic traders who want a single, normalized number instead of reading half a dozen separate trend tools. It is scale-invariant (ATR-normalized) and works across timeframes and instruments.
🎯 UNIQUE EDGE
Trend-strength tools usually give a single-factor reading (for example, ADX alone) which can be misleading. ADX can be high during range contractions, slopes can spike during noise, MA stacks can be aligned while price sits deep in pullback. This indicator fuses all five dimensions so that no single factor can dominate the score without confirmation from the others.
Three design choices set it apart:
1. Weighted multi-factor composite. Every factor is independently normalized to 0-100, then combined with user-adjustable weights that auto-normalize. A Strong reading therefore requires broad agreement across independent trend dimensions, not just one signal firing.
2. Dominant Factor readout. The information panel shows which of the five factors is contributing most to the current score, so the trader understands why the score is where it is. A score of 84 driven by ADX and a score of 84 driven by Alignment are structurally different markets, and the readout makes that visible.
3. Historical context built in. The panel exposes Historical Max Score over a configurable lookback window, and Strong-Trend Duration (how many bars the score has held above the Strong threshold). Both of these help gauge trend maturity and exhaustion risk.
📊 METHODOLOGY
The composite score is built from five independently scored factors, each normalized to 0-100:
• Factor 1 — ADX. Directional movement strength from the standard DMI/ADX system, linearly mapped so that ADX = 60 maps to a score of 100.
• Factor 2 — Slope Angle. The slope of an EMA over its length window, normalized by ATR to be scale-invariant, then converted to a 0-100 score via an arctangent curve. High slope in either direction yields a high score.
• Factor 3 — Momentum ROC. Rate of Change normalized by ATR and converted to a bounded 0-100 value. Captures impulse magnitude independent of price scale.
• Factor 4 — MA Alignment. Stacked EMA alignment across Fast / Mid / Slow timeframes, plus price position relative to the fast MA. Full bullish or bearish stack yields 100; partial stacks are scored proportionally (70, 40, or 15).
• Factor 5 — Pullback Depth. Distance from the nearest recent extreme (highest high or lowest low over lookback) measured in ATR units. Shallow pullback = strong trend = high score.
Each factor is multiplied by its weight, summed, and divided by total weight to produce the final 0-100 score. All five weights are independently adjustable and auto-normalize, so changing one weight does not force manual rebalancing of the others.
Directional bias (Bull / Bear / Range) is determined by the combination of DMI crossover state and close-vs-mid-MA position. State color shifts between strong bull green, strong bear magenta, neutral yellow, and weak gray based on score plus direction.
🔥 VISUAL SYSTEM
Six coordinated visual elements deliver the information without clutter:
• Score histogram on the sub-panel, colored per bar by that bar's own score level (green for Strong, yellow for Mild, gray for Weak / Range). Each historical bar shows its true state at the time, not the current state.
• Horizontal reference lines at the Strong (green) and Mild (yellow) thresholds on the sub-panel.
• Historical Max step line in indigo accent, showing the highest score reached within the lookback window, so past trend peaks are immediately visible.
• Mini Gauge on the right edge of the sub-panel. A compact vertical meter split into two halves: left half shows the fixed 0-100 zone reference (Weak / Mild / Strong), right half fills up to the current score, with a bold needle line marking the exact level.
• Price badge floating above the last candle, showing "TSM " so the reading is visible without needing to look at the panel.
• Information panel on the price chart with seven rows: Score, State, Direction, Dominant Factor, Historical Max, and Strong Bars duration.
🧭 SIGNALS AND ALERTS
Three built-in alerts:
• Strong Bull Entry — Score crosses above the Strong threshold while directional bias is Bull.
• Strong Bear Entry — Score crosses above the Strong threshold while directional bias is Bear.
• Trend Fade — Score drops below the Mild threshold, indicating the trend is weakening.
All alerts fire once per bar close, so there is no intra-bar repainting.
🧮 KEY INPUTS
Core Settings
• ADX Length, Slope MA Length, Momentum ROC Length, MA Alignment Fast / Mid / Slow, Pullback ATR Length
• Score Smoothing (EMA applied to score for optional overlay line)
• Strong Threshold (default 80), Mild Threshold (default 50), Historical Lookback (default 100 bars)
Factor Weights (auto-normalized)
• ADX 30, Slope 20, Momentum 20, Alignment 20, Pullback 10
Visual
• Badge toggle, Background tint toggle, Reference lines toggle, Mini Gauge toggle, Historical Max line toggle, Smoothed Score line toggle, Label size, Badge ATR offset
Panel
• Show / hide, Position (6 anchors), Theme (Dark / Light), Font size
📈 HOW TO USE
1. Add the indicator to any chart and any timeframe. Defaults are calibrated for 4H / Daily; for lower timeframes consider reducing the ADX and ROC lengths.
2. Use the 0-100 score as a regime filter. Many trend-following setups perform better when the score is above 50, and breakout / continuation setups perform best when the score is crossing above 80 with a clear Bull or Bear direction.
3. Watch the Dominant Factor. A score of 85 driven primarily by Momentum may fade fast; the same score driven by Alignment tends to be more structural.
4. Use Historical Max and Strong Bars to gauge maturity. A Strong-Bars reading of 30+ on a daily chart often signals late-cycle conditions where continuation risk increases and fresh entries need tighter risk management.
5. Combine with structure tools (support / resistance, order blocks, market-structure tools) for entries. This indicator is designed to answer "how strong is the trend," not "where do I enter."
⚠️ LIMITATIONS AND TRANSPARENCY
• This is an indicator, not a trading strategy. It does not produce buy / sell recommendations and it does not backtest trade outcomes.
• The score is a lagging composite built from historical price data. It does not predict future price movement.
• During sharp regime transitions (news events, gap opens), the score can change rapidly from one bar to the next. This is by design, not a bug.
• Factor weights are user-adjustable. Defaults are a reasonable starting point but may need tuning per instrument / timeframe.
• The Pullback factor assumes trending behavior. In tight consolidations it can read misleadingly high, which is why the Dominant Factor readout exists as a cross-check.
• No-repaint: all calculations are based on confirmed (closed) bar data; alerts fire on bar close only.
📌 RISK DISCLOSURE
Trading carries substantial risk. This indicator is an analytical tool for research and study purposes and does not constitute financial advice, a trading signal, or a recommendation to buy or sell any instrument. Past behavior of any indicator is not indicative of future results. Users are solely responsible for their trading decisions and should conduct their own due diligence and risk management.
Indicator

Key Levels Pro [AGPro Series]Key Levels Pro
🔑 Overview
Key Levels Pro is a comprehensive, non-repainting level tracker that consolidates every institutionally significant price reference into one clean overlay. Previous day, week, and month highs/lows (PDH, PDL, PWH, PWL, PMH, PML) are plotted alongside Asian, London, and New York session highs and lows. Every level is actively monitored — touch count, break count, and respect rate update in real time, giving you a live quality score for each price zone.
Most level scripts stop at drawing lines. Key Levels Pro goes further: lines automatically thicken on repeated touches, switch to dashed style when broken, and fade to muted color to signal invalidation. Zone rectangles extend back to the formation bar of each level, making historical respect visible at a glance. An ATR-aware label collision system keeps the chart readable on every timeframe, and same-price levels are intelligently deduplicated so you never see four overlapping labels at the same price.
───────────────────────────────────────────────────────
📐 Unique Edge
Unlike generic pivot or S/R scripts, Key Levels Pro tracks the behavioral quality of each level — not just its existence. A level that has been tested five times without breaking carries a different weight than a fresh, untested one. Key Levels Pro surfaces that difference automatically through line width, style, and panel data.
What makes it distinct:
🔹 Complete previous-period coverage (PDH/PDL, PWH/PWL, PMH/PML) in one overlay, without redundant current-period duplicates.
🔹 Live session tracking for Asian, London, and New York simultaneously, with automatic hiding on Daily and higher timeframes.
🔹 Per-level touch count, break count, and respect rate computed from actual historical price interaction.
🔹 Dynamic line thickening on repeated touches (width 1 → 2 → 3).
🔹 Auto-broken state with dashed style + muted color — no distracting flags or banners.
🔹 Historical zone boxes extending back to the formation bar of each level.
🔹 ATR-aware label collision resolution that stacks overlapping labels vertically.
🔹 Price-based deduplication: when two levels share the same price, the higher-priority one wins (Monthly > Weekly > Daily > Session).
🔹 ATR-normalized proximity to the nearest level above and below the current price.
───────────────────────────────────────────────────────
🔬 Methodology
Previous-period levels are pulled from the daily, weekly, and monthly timeframes using request.security() with lookahead enabled for the completed-period values. This approach is standard, transparent, and non-repainting — historical data does not change.
Session levels are tracked bar by bar using customizable session time inputs. Each session resets at its start time and tracks the running high and low until the session closes. The Asian, London, and New York sessions can each be configured independently.
Touch detection uses an ATR-based tolerance band (default 10% of ATR). When price closes within that tolerance of a level, the touch counter increments. A break is registered when price closes on the opposite side of a level compared to the prior bar. Respect rate is calculated as touches / (touches + breaks) × 100.
Line width scales with touch count: 1 touch = width 1, 2–4 touches = width 2, 5+ touches = width 3. Broken levels switch to dashed style and a muted color.
The label collision system operates in three stages: first, all enabled levels are collected into a sorted array; second, same-price levels are deduplicated based on priority (Monthly highest, Session lowest); third, an upward sweep enforces minimum vertical spacing using a blend of ATR and chart-range heuristics, ensuring labels never overlap regardless of market volatility.
───────────────────────────────────────────────────────
📊 Signals & States
This script is a visualization and data tool — it does not generate buy or sell signals.
Level states are communicated visually:
🔹 Active (solid line, full color): level has not been broken.
🔹 Touched (thicker line, 2–3px): level has been tested one or more times.
🔹 Broken (dashed line, muted slate color): level has been decisively closed through.
Info panel states:
🔹 Session: active market session (Asian / London / New York / Off-Hours / N/A on Daily+).
🔹 Near Above / Near Below: price of the closest active level on each side of the current close.
🔹 Dist Above / Below ATR: distance expressed as a multiple of ATR(14).
🔹 Touch and respect rate data for PDH, PDL, PWH, PWL.
───────────────────────────────────────────────────────
⚙️ Key Inputs
Level Groups: Toggle previous day, week, month, and session levels independently.
Session Times: Fully customizable start/end times for Asian, London, and New York sessions in exchange timezone.
Zone Style: Enable/disable S/R zones and adjust zone transparency.
Lines & Labels: Set line extension length, toggle labels, choose label density (All / Reduced / Minimal), set font size, and enable or disable same-price deduplication.
Info Panel: Toggle panel, set location (six positions), and choose theme (Dark / Light).
ATR Settings: Set ATR period and touch tolerance as an ATR multiple (0.02 to 0.50).
───────────────────────────────────────────────────────
📖 How to Use
1. Add the script to a chart — all major levels appear immediately.
2. Adjust session times if trading non-crypto markets.
3. Watch line thickness: thicker = more tested = stronger historical reaction zone.
4. Dashed + muted color = broken. Treat broken levels as potential new S/R from the opposite side (role reversal).
5. Use the panel's Near Above and Near Below fields to gauge proximity before entry or exit decisions.
6. Use "Reduced" density (default) for cleaner charts, or switch to "All" when you need session context.
7. Works on all asset classes: crypto, forex, equities, indices, commodities.
Recommended timeframes: 15m–4H for session levels; 1H–1D for previous-period levels.
───────────────────────────────────────────────────────
⚠️ Limitations & Transparency
🔹 Session tracking is session-relative and resets each new session.
🔹 Touch tolerance is an ATR-based heuristic and may need adjustment on extremely low-volatility instruments.
🔹 All data is historical. Touch count and respect rate describe past price behavior, not future outcomes.
🔹 This script is not a trading strategy, does not issue trade signals, and cannot predict market direction.
🔹 On exotic or illiquid instruments with large gaps, formation-bar zone boxes may appear truncated if the level formed outside the chart's visible range.
───────────────────────────────────────────────────────
🛡️ Risk Disclosure
This script is provided for informational and educational purposes only. It does not constitute financial advice, investment advice, or a recommendation to buy or sell any financial instrument. All trading involves risk. Past level behavior does not guarantee future results. Always use proper risk management and test any approach in a demo environment before committing real capital. Indicator

Market Correlation Matrix [NikaQuant]Market Correlation Matrix
A real-time correlation dashboard that displays Pearson correlation coefficients between the current chart symbol and up to 6 user-defined comparison symbols.
═══ FEATURES ═══
• Track correlations for up to 6 symbols simultaneously (default: BTCUSDT, GOLD, SPX, DXY, US10Y, QQQ)
• Heatmap-colored table with intuitive color coding from strong positive (green) to strong negative (red)
• Correlation change tracking — see how correlations are shifting over a configurable lookback period
• Visual strength bars showing absolute correlation magnitude at a glance
• Signal classification labels: STRONG+/-, MOD+/-, WEAK+/-, NEUTRAL
• Built-in alerts for strong positive/negative crosses (±0.7) and zero-line crosses
• Fully customizable: table position, text size, all colors, border styling
═══ HOW IT WORKS ═══
The indicator calculates Pearson correlation over a user-defined period (default: 50 bars) between the chart’s close price and each comparison symbol’s close price. It then renders a compact table showing:
1. Symbol — Ticker of the comparison asset
2. Corr — Current correlation value (-1 to +1)
3. Change — How much the correlation shifted vs N bars ago (with directional arrows)
4. Strength — Block-style visual bar representing absolute correlation
5. Signal — Classification from NEUTRAL to STRONG+/-
═══ SETTINGS ═══
Symbols: Configure up to 6 comparison symbols (leave blank to skip)
Correlation Period: Lookback length for Pearson calculation (default: 50)
Change Lookback: Compare current vs past correlation (default: 10 bars)
Display: Table position, show/hide title
Style: Full color customization for heatmap, headers, borders, and change indicators
═══ ALERTS ═══
• Strong positive correlation cross (above +0.7) per symbol
• Strong negative correlation cross (below -0.7) per symbol
• Any symbol crossing the zero line
═══ USE CASES ═══
• Monitor intermarket relationships in real time
• Identify regime changes when correlations break down or strengthen
• Confirm or filter trade setups using cross-asset correlation context
• Track USD, bonds, equities, and crypto correlations from a single chart Indicator

Arbitrage Scanner Pro [Multi-Asset Dashboard]⚡ Arbitrage Scanner Pro
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 OVERVIEW
Arbitrage Scanner Pro is a multi-asset monitoring and arbitrage detection system that displays 3 assets simultaneously on one chart. It detects trend divergences between correlated assets, identifies arbitrage opportunities in real-time, and uses speed simulation to make indicators react as if running on sub-minute timeframes (10s, 15s, 30s).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 HOW IT WORKS
🔹 Speed Simulation Engine
PulseWire's minimum timeframe is 1 minute. This indicator mathematically scales indicator parameters to simulate faster reactions:
• Normal (1m) → Standard indicator behavior
• Simulate 30s → Parameters divided by 2 (2x faster reactions)
• Simulate 15s → Parameters divided by 4 (4x faster reactions)
• Simulate 10s → Parameters divided by 6 (6x faster reactions)
Example in 15s mode: EMA 20 becomes EMA 5, RSI 14 becomes RSI 4, Supertrend Length 5 becomes 1.
🔹 Signal Logic
Each asset runs the same strategy independently using its own price data:
LONG conditions (all must be true):
✅ Supertrend = Bullish (green)
✅ Close > EMA of Highs (breakout above channel)
✅ RSI > 60 (strong momentum)
✅ RSI > RSI Moving Average (momentum accelerating)
✅ Supertrend outside EMA channel (trending, not choppy)
SHORT conditions (all must be true):
✅ Supertrend = Bearish (red)
✅ Close < EMA of Lows (breakdown below channel)
✅ Supertrend outside EMA channel (trending, not choppy)
The "Supertrend outside EMA channel" filter is the key innovation — it eliminates false signals during sideways consolidation by only allowing signals when the market shows a clean directional trend.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 MULTI-ASSET DISPLAY
The indicator creates a stacked 3-panel layout in a single pane:
• Asset A (Main) → Your chart's symbol with overlay indicators
• Asset B (Secondary) → Normalized candles in 0-100 range with full OHLC
• Asset C (Third) → Normalized candles shifted below with adjustable gap
Each secondary asset displays:
📊 Ticker name (e.g., ETHUSDT)
🏛️ Exchange/broker name (e.g., BINANCE) — auto-parsed from symbol
💲 Live price with up to 4 decimal precision
📈 Bar-to-bar percentage change with color coding
Price normalization formula:
Normalized = (Price - 200-bar Low) ÷ (200-bar High - 200-bar Low) × 100
All indicators (EMA channels, Supertrend) are also normalized to the same scale.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔍 ARBITRAGE DETECTION
The core feature — compares trend directions and signal timing across all 3 assets.
🔹 Signal Divergence (strongest signal):
Fires when two assets generate OPPOSITE signals on the same bar.
Example: Asset A = LONG while Asset B = SHORT → ⚠️ Arbitrage Opportunity
🔹 Trend Divergence (ongoing):
Tracks when assets have different Supertrend directions.
Measured as a Divergence Score from 0/3 (all aligned) to 3/3 (all different).
🔹 Convergence Detection:
Fires when ALL 3 assets trigger the same signal simultaneously.
All LONG → Maximum bullish confirmation.
All SHORT → Maximum bearish confirmation.
🔹 Visual Feedback:
• Yellow background flash → Signal divergence detected
• Green background flash → All assets triggered LONG
• Pink background flash → All assets triggered SHORT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 DASHBOARD
The professional dashboard table shows real-time data for all assets:
• ASSET → Parsed ticker name with emoji identifier
• EXCHANGE → Auto-detected exchange/broker (BINANCE, COINBASE, FX, etc.)
• PRICE → Live close price
• CHANGE → Bar-to-bar % change (green/red)
• TREND → Supertrend direction (▲ BULL / ▼ BEAR)
• SIGNAL → Current state (🚀 LONG! / 🔻 SHORT! / 🟢 Long / 🔴 Short / ⚪ Neutral)
Arbitrage Status Section:
• Overall divergence assessment with descriptive message
• Pair-by-pair comparison (A↔B, A↔C, B↔C) — DIVERGED or ALIGNED
• RSI values for all 3 assets side-by-side
• Divergence score (0/3 to 3/3)
Dashboard size, position, and label sizes are all adjustable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ SETTINGS
🔹 Speed Mode:
Scan Speed → Normal (1m) / Simulate 30s / Simulate 15s / Simulate 10s
🔹 Detection Settings:
Trend Detection Length → Supertrend ATR lookback (default: 5)
Sensitivity Factor → Supertrend ATR multiplier (default: 1.0)
Channel Length → EMA lookback for high/low channel (default: 20)
Momentum Length → RSI period (default: 14)
🔹 Asset Configuration:
Asset B and Asset C can be independently enabled/disabled with custom symbols and candle colors.
🔹 Display Settings:
Show Trend Overlays → Toggle EMA and Supertrend on secondary charts
Signal Style → Labels / Arrows / Both
Gap Between Charts → 80 to 500 (vertical spacing)
Signal Label Offset → Distance of signal labels from candles
🔹 Size Settings:
Dashboard Text Size → Tiny / Small / Normal / Large
Chart Label Size → Tiny / Small / Normal / Large / Huge
Signal Label Size → Tiny / Small / Normal / Large / Huge
Dashboard Position → 9 positions (Top/Mid/Bottom × Left/Center/Right)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 ALERTS (12 Total)
Individual (6):
• Asset A LONG / SHORT
• Asset B LONG / SHORT
• Asset C LONG / SHORT
Combined (2):
• ANY asset LONG
• ANY asset SHORT
Arbitrage-Specific (4):
• ⚠️ Signal Divergence detected (opposite signals on same bar)
• 🟢 All 3 assets LONG convergence
• 🔴 All 3 assets SHORT convergence
• 🔶 High divergence score (2+/3)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 USE CASES
🔹 Cross-Exchange Arbitrage:
Monitor BTC on BINANCE, COINBASE, and BYBIT simultaneously. When one exchange shows LONG while another shows SHORT, a price discrepancy exists.
🔹 Crypto Correlation Trading:
Watch BTC, ETH, and SOL together. BTC often leads — when BTC triggers LONG first, altcoins typically follow. Enter altcoins on confirmation.
🔹 Forex Multi-Pair Scanning:
Monitor EURUSD, GBPUSD, and USDJPY. When EUR and GBP both show LONG while JPY shows SHORT, it confirms broad USD weakness.
🔹 Index + Sector Rotation:
Track S&P 500 futures alongside QQQ (tech) and XLF (financials). Divergences between sectors reveal which is driving the market.
🔹 News Event Reaction:
Monitor Gold, Dollar Index, and 10-Year Yields during economic releases. The 10s simulation catches reactions within the first minute candle.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ IMPORTANT NOTES
• This uses 1-minute OHLC data — it does NOT create actual sub-minute candles
• Signals fire at bar close, not mid-candle
• The 0-100 normalization can make small moves appear larger
• This is a detection tool — trade execution requires separate infrastructure
• Best used on 1-minute charts where the speed simulation is calibrated
• Always combine with proper risk management
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 RECOMMENDED SETTINGS
Crypto (High Volatility): Sim 15s, Length 5, Factor 1.0, Channel 20
Crypto (Low Volatility): Sim 30s, Length 7, Factor 1.5, Channel 25
Forex Majors: Sim 30s, Length 5, Factor 1.5, Channel 20
Stock Indices: Sim 30s, Length 5, Factor 1.0, Channel 15
News Events: Sim 10s, Length 3, Factor 0.5, Channel 10 Indicator

Ultimate Major Contextual Dashboard (Multi-Asset)Overview : The Ultimate Major Dashboard is a performance-optimized market overview tool designed to provide a consolidated snapshot of the 7 major Forex pairs and Gold. It aggregates correlation, trend, momentum, and volatility data into a single, clean table, allowing users to view broader market context without switching charts.
Technical Logic & Components : This indicator utilizes a modular function to analyze EURUSD, GBPUSD, USDJPY, USDCHF, AUDUSD, USDCAD, NZDUSD, and XAUUSD across four key dimensions:
Intermarket Correlation (Pearson Coefficient): Uses ta.correlation() to compare each asset against the symbol currently on your main chart.
Logic: Values above 0.7 (Dark Green) suggest a strong positive relationship, while values below -0.7 (Dark Red) suggest inverse behavior. This is calculated over a rolling 50-period window to balance stability with current market sensitivity.
Trend Bias (EMA-200): Evaluates the long-term trend by checking price position relative to the 200-period Exponential Moving Average.
Visuals: An upward arrow (⬆) indicates price is above the EMA; a downward arrow (⬇) indicates it is below.
Momentum (RSI-14): Calculates the Relative Strength Index. The dashboard automatically highlights readings above 70 (OB) or below 30 (OS) to help identify potential momentum extremes.
Volatility (ATR-14): Displays the Average True Range as a reference for the current active range of each market, helping users compare volatility levels across the majors.
How to Interpret the Dashboard
Asset Alignment: Correlation values help identify when pairs are moving in "unison" versus when a specific currency is diverging from the group.
Directional Context: Combining the Trend (EMA) and Momentum (RSI) columns provides a quick view of whether a market is trending strongly or reaching an exhaustion point.
Volatility Benchmarking: The ATR values offer perspective on which pairs are currently the most active, assisting in market comparison based on volatility preference.
Data Handling & Customization
Multi-Symbol Sync: Data is fetched using request.security(). The calculations are synchronized with the chart's current bar state for real-time accuracy.
Dynamic TF: Users can select the analysis timeframe (60, 240, D, W) via the settings menu.
Flexibility: The dashboard position can be toggled between all four corners of the chart to avoid overlapping with price action.
Disclaimer
This tool is provided for analytical and educational purposes only. It does not generate trading signals and should not be considered financial advice. Indicator

Index Construction Tool🙏🏻 The most natural mathematical way to construct an index || portfolio, based on contraharmonic mean || contraharmonic weighting. If you currently traded assets do not satisfy you, why not make your own ones?
Contraharmonic mean is literally a weighted mean where each value is weighted by itself.
...
Now let me explain to you why contraharmonic weighting is really so fundamental in two ways: observation how the industry (prolly unknowably) converged to this method, and the real mathematical explanation why things are this way.
How it works in the industry.
In indexes like TVC:SPX or TVC:DJI the individual components (stocks) are weighted by market capitalization. This market cap is made of two components: number of shares outstanding and the actual price of the stock. While the number of shares holds the same over really long periods of time and changes rarely by corporate actions , the prices change all the time, so market cap is in fact almost purely based on prices itself. So when they weight index legs by market cap, it really means they weight it by stock prices. That’s the observation: even tho I never dem saying they do contraharmonic weighting, that’s what happens in reality.
Natural explanation
Now the main part: how the universe works. If you build a logical sequence of how information ‘gradually’ combines, you have this:
Suppose you have the one last datapoint of each of 4 different assets;
The next logical step is to combine these datapoints somehow in pairs. Pairs are created only as ratios , this reveals relationships between components, this is the only step where these fundamental operations are meaningful, they lose meaning with 3+ components. This way we will have 16 pairs: 4 of them would be 1s, 6 real ratios, and 6 more inverted ratios of these;
Then the next logical step is to combine all the pairs (not the initial single assets) all together. Naturally this is done via matrices, by constructing a 4x4 design matrix where each cell will be one of these 16 pairs. That matrix will have ones in the main diagonal (because these would be smth like ES/ES, NQ/NQ etc). Other cells will be actual ratios, like ES/NQ, RTY/YM etc;
Then the native way to compress and summarize all this structure is to do eigendecomposition . The only eigenvector that would be meaningful in this case is the principal eigenvector, and its loadings would be what we were hunting for. We can multiply each asset datapoint by corresponding loading, sum them up and have one single index value, what we were aiming for;
Now the main catch: turns out using these principal eigenvector loadings mathematically is Exactly the same as simply calculating contraharmonic weights of those 4 initial assets. We’re done here.
For the sceptics, no other way of constructing the design matrix other than with ratios would result in another type of a defined mean. Filling that design matrix with ratios Is the only way to obtain a meaningful defined mean, that would also work with negative numbers. I’m skipping a couple of details there tbh, but they don’t really matter (we don’t need log-space, and anyways the idea holds even then). But the core idea is this: only contraharmonic mean emerges there, no other mean ever does.
Finally, how to use the thing:
Good news we don't use contraharmonic mean itself because we need an internals of it: actual weights of components that make this contraharmonic mean, (so we can follow it with our position sizes). This actually allows us to also use these weights but not for addition, but for subtraction. So, the script has 2 modes (examples would follow):
Addition: the main one, allows you to make indexes, portfolios, baskets, groups, whatever you call it. The script will simply sum the weighted legs;
Subtraction: allows you to make spreads, residual spreads etc. Important: the script will subtract all the symbols From the first one. So if the first we have 3 symbols: YM, ES, RTY, the script will do YM - ES - RTY, weights would be applied to each.
At the top tight corner of the script you will see a lil table with symbols and corresponding weights you wanna trade: these are ‘already’ adjusted for point value of each leg, you don’t need to do anything, only scale them all together to meet your risk profile.
Symbols have to be added the way the default ones are added, one line : one symbol.
Pls explore the script’s Style setting:
You can pick a visualization method you like ! including overlays on the main chart pane !
Script also outputs inferred volume delta, inferred volume and inferred tick count calculated with the same method. You can use them in further calculations.
...
Examples of how you can use it
^^ Purple dotted line: overlay from ICT script, turned on in Style settings, the contraharmonic mean itself calculated from the same assets that are on the chart: CME_MINI:RTY1! , CME_MINI:ES1! , CME_MINI:NQ1! , CBOT_MINI:YM1!
^^ precious metals residual spread ( COMEX:GC1! COMEX:SI1! NYMEX:PL1! )
^^ CBOT:ZC1! vs CBOT:ZW1! grain spread
^^ BDI (Bid Dope Index), constructed from: NYSE:MO , NYSE:TPB , NYSE:DGX , NASDAQ:JAZZ , NYSE:IIPR , NASDAQ:CRON , OTC:CURLF , OTC:TCNNF
^^ NYMEX:CL1! & ICEEUR:BRN1! basket
^^ resulting index price, inferred volume delta, inferred volume and inferred tick count of CME_MINI:NQ1! vs CME_MINI:ES1! spread
...
Synthetic assets is the whole new Universe you can jump into and never look back, if this is your way
...
∞ Indicator

Indicator

Portfolio Monitor - DolphinTradeBot1️⃣ Overview
▪️This indicator unifies the value of all your investments—whether stocks, currencies, or cryptocurrencies—in your chosen currency. This tool not only provides a clear snapshot of your overall portfolio performance but also highlights the individual growth of each asset with intuitive visualizations and an easy-to-understand performance report.
2️⃣ What sets this indicator apart
▪️is its ability to convert values from various currency pairs into any currency you choose. This means you can monitor your portfolio's performance against any currency pair you prefer, offering a flexible and comprehensive view of your investments.
3️⃣ How Is It Work ?
🔍The indicator can be analyzed under two main categories: visual representations and tables.
1- Visual representations ;
The indicator includes three different types of lines:
1. 1 - Reference Line → This represents the cost of all assets we hold, based on the selected date.
1. 2 - Total Assets Line → Displays the real-time value of all assets in our possession, including cash value, in the selected trading pair.
The area between the reference line is filled with green and red. The section above the reference line is represented in green, while the section below is shown in red.
1. 3 - Performance Lines → These visualize the performance of the assets, starting from the reference line and taking into account their weights in the portfolio. (Note: The lines are scaled for visualization purposes, so their absolute values should not be considered.)
"The names of the lines are shown in the image below."⤵️
2- Tables
The indicator includes three different types of tables:
2. 1 - Analysis Table : It provides a superficial overview of wallet statistics and values.
▪️TOTAL ASSETS → The current equivalent of all assets in the target currency
▪️CASH VALUE → The current value of the amount "Cash Value", in the target currency.
▪️PORTFOLIO VALUE → The total value of assets excluding Cash, in the target currency.
▪️POSTFOLIO COST → The cost of assets excluding Cash, in the target currency.
▪️PORTFOLIO ABSOLUTE RETURN → It shows the profit or loss relative to the cost of assets
▪️PORTFOLIO RETURN % →It shows the profit or loss relative to the cost of assets on a percentage basis
2. 2 - Performance Table : It displays the names of assets excluding Cash and their profit amounts, sorted from highest to lowest profit. If "Show as Percentage" is selected in the settings, it shows the percentage profit or loss relative to the cost. Profits are represented in green, while losses are represented in red.
"You can see the visual showing the tables below"⤵️
4️⃣How to Use ?
1- Choose the date on which the visualization will begin (📌The start date only affects the exchange rate used for calculating the reference line in the target currency.)
2- If you have cash holdings, enter the amount and specify the currency.
3- Select the currency in which your portfolio value will be displayed.(Default value is USD)
4- To set up your portfolio;
SYMBOLS - QUANTITY - PURCHASE PRICE
Enter the symbols of your assets - the number of units you hold - and their cost levels.
5- If you have cash, be sure to include your cash balance. If you also hold other currencies, enter them as separate assets with their corresponding quantities and purchase prices.
6- If you want to see the percentage returns of the assets in the performance table relative to their cost, select the "Show as Percent" option.
7- If you want to see the performance visuals of the assets, click on the "Show Asset Performance" option.
You can find an image of the settings section where the numbers above are used as references below.⤵️
📌 NOTE → By default, a few assets and their values have been pre-added in the initial settings. This is to ensure that you don’t see an empty screen when adding the indicator to the chart. Please remember to enter your own assets and values. The default settings are only provided as an example. Indicator

Asset Allocation CalculatorOverview
This script is a tool that automatically calculates asset allocation for your investment portfolio. Users can set the weight of multiple assets and monitor the portfolio value in real time based on price fluctuations.
Key Features
Supports input of asset allocation percentages
Dynamic allocation calculation based on real-time price data
Automatically calculates allocated amounts for each asset based on the total investment amount
User-friendly interface with intuitive visual feedback
Settings
Total Capital : Enter the total capital, including the value of assets.
Quantity rounding : Using the rounding function may cause the target allocation to exceed 100%.
Tickers, Weight, Holdings :
To retrieve accurate asset prices, specify both the exchange and the ticker.
If you want to include cash in your portfolio, use $.
Ensure that the total allocation sums to 100%.
Refer to the pre-filled example for the correct format.
Table Settings : You can adjust the table's position, height, font size, and background color.
How to Use
By buying or selling the quantity shown in the Buy column, you can continuously maintain your target allocation.
Hold - Current holdings
Buy - Quantity to buy or sell to reach the target allocation
Target - Quantity aimed for after buying or selling
Caution
It can only calculate for a single currency, so do not mix multiple currency markets.
자산 배분 계산기
소개
이 스크립트는 투자 포트폴리오의 자산 배분을 자동으로 계산해주는 도구입니다. 사용자는 여러 자산의 비중을 설정할 수 있으며, 가격 변동에 따라 포트폴리오 가치를 실시간으로 모니터링할 수 있습니다.
주요 기능
자산 배분 비율 입력 지원
실시간 가격 데이터를 기반으로 한 동적 배분 계산
총 투자 금액을 기준으로 각 자산에 할당된 금액 자동 계산
직관적인 시각적 피드백을 제공하는 사용자 친화적인 인터페이스
설정
Total Capital : 자산 가치를 포함한 총 자본금을 입력하세요.
Quantity rounding : 반올림 기능을 사용하면 목표 비중이 100%를 초과할 수 있습니다.
Tickers, Weight, Holdings :
정확한 자산 가격을 불러오기 위해 거래소와 티커를 함께 입력하세요.
포트폴리오에 현금을 포함하려면 '$'를 사용하세요.
비중 합계가 반드시 100%가 되도록 설정하세요.
예제 형식을 참고하여 올바르게 입력하세요.
한국(원화) 시장을 위한 입력 예시입니다.
KRX:360750, 17.5, 100
KRX:310960, 17.5, 120
KRX:148070, 25, 20
KRX:305080, 25, 10
KRX:139320, 10, 150
UPBIT:BTCKRW, 5, 0.002
$,0,5000000
Table Settings : 테이블의 위치, 높이, 글자 크기 및 배경색을 조정할 수 있습니다.
사용 방법
Buy 열에 표시된 수량만큼 매수 또는 매도하면 목표 비중을 지속적으로 유지할 수 있습니다.
Hold - 현재 보유 수량
Buy - 목표 비중을 맞추기 위해 매수 또는 매도해야 하는 수량
Target - 매수, 매도 후 목표로 하는 수량
주의
한 가지 통화로만 계산할 수 있으니 여러 통화 시장을 혼용하지 마세요.
Indicator

Indicator

Multi Asset & TF Stochastic
Multi Asset & TF Stochastic
This indicator allows you to compare the stochastic oscillator values of two different assets across multiple timeframes in a single pane. It’s designed for traders who want to analyse the momentum of one asset (by default, the chart’s asset) alongside a second asset of your choice (e.g., comparing EURUSD to the USD Index).
How It Works:
Main Asset:
The indicator automatically uses the chart’s asset for the primary stochastic calculation. You have the option to adjust the timeframe for this asset using a dropdown that includes PulseWire’s standard timeframes, a "Chart" option (which automatically uses your chart’s timeframe), or a "Custom" option where you can type in any timeframe.
Second Asset:
You can enable the display of a second asset by toggling the “Display Second Asset” option. Choose the asset symbol (default is “DXY”) and select its timeframe from an identical dropdown. When enabled, the script calculates the stochastic oscillator for the second asset, allowing you to compare its momentum (%K and %D lines) with that of the main asset.
Stochastic Oscillator Settings:
Customize the %K length, the smoothing period for %K, and the smoothing period for %D. Both assets’ stochastic values are calculated using these parameters.
Visual Display:
The indicator plots the %K and %D lines for the main asset in prominent colours. If the second asset is enabled, its %K and %D lines are also plotted in different colours. Additionally, overbought (80) and oversold (20) levels are marked, with a midline at 50, making it easier to gauge market conditions at a glance.
%D line can be toggled off for a cleaner view if required:
Asset Information Table:
A table at the top-centre of the pane displays the active asset symbols—ensuring you always know which assets are being analysed.
How to Use:
Apply the Indicator:
Add the script to your chart. By default, it will use the chart’s current asset and timeframe for the primary stochastic oscillator.
Adjust the Main Asset Settings:
Use the “Main Asset Timeframe” dropdown to select a specific timeframe for the main asset or stick with the “Chart” option for automatic syncing with your current chart.
Enable and Configure the Second Asset (Optional):
Toggle on “Display Second Asset” if you wish to compare another asset. Select the desired symbol and adjust its timeframe using the provided dropdown. Choose “Custom” if you need a timeframe not listed by default.
Review the Plots and Table:
Observe the stochastic %K and %D lines for each asset. The overbought/oversold levels help indicate potential market turning points. Check the table at the top-centre to confirm the asset symbols being displayed.
This versatile tool is ideal for traders who rely on momentum analysis and need to quickly compare the stochastic signals of different markets or instruments. Enjoy seamless multi-asset analysis with complete control over your timeframe settings! Indicator

Indicator

Random Synthetic Asset GenerationThis script generates pseudo-random asset data . Due to the nature of the random generator, it is impossible to use this indicator as input for other indicators because the instance of the script that the indicator is applied to will automatically be different from the instance that is plotted on the chart. Therefore, the idea is to use this script in other scripts (to make it possible to backtest on random data, for example).
The script has four main input parameters.
Random Number Generator Method: It supports two methods for generating the pseudo-random numbers (one by Ricardo Santos and one by Wichmann-Hill).
Seed: You can specify the seed to use. Each unique seed will generate a unique set of pseudo-random data.
Intrabar Volatility: This basically sets how volatile the generated wicks will be (0 = no wicks).
Price Multiplier: This is just a multiplier for the generated price data, so that you can scale up or down the generated price data.
You can also change the colors of the bars.
In addition to this, the indicator also generates random volume. In order to make it possible to show both volume and price, you need to have two identical instances of the indicator. One on the chart, and one in its own panel. Then, go into the Style tab in the indicator settings on the instance in the panel. Untick Up-Candles and Down-Candles boxes, and tick the Volume box.
In a similar manner, you can also plot the true range data and the candle change data as well, by ticking one of those boxes instead.
Indicator

Indicator
