GMA Smart Trend Channel [Top Volatility Track]This script is for learning and communication purposes only. Please do not use it as an investment basis. The market is risky, so proceed with caution. I have made a formal statement: I am not responsible for any losses caused by improper operations.
المؤشرات والاستراتيجيات
QuantLabs Multi Asset Similarity Matrix [V3 Final]The Market is a graph. See the flows:
The QuantLabs MASM is not a standard correlation table. It is an Alpha-Grade Scanner architected to reveal the hidden "hydraulic" relationships between global macro assets in real-time.
Rebuilt from the ground up for Version 3, this engine pushes the absolute limits of the Pine Script™ runtime. It utilizes a proprietary Logarithmic Math Engine, Symmetric Compute Optimization, and a futuristic "Ghost Mode" interface to deliver a 15x15 real-time correlation matrix with zero lag.
Under the Hood: The Quant Architecture
We stripped away standard libraries to build a lean, high-performance engine designed for institutional-grade accuracy.
1. Alpha Math Engine (Logarithmic Returns) Most tools calculate correlation based on Price, which generates spurious signals (e.g., "Everything is correlated in a bull run").
The Solution: Our engine computes Logarithmic Returns (log(close /close )) by default. This measures the correlation of change (Velocity & Vector), not price levels.
The Result: A mathematically rigorous view of statistical relationships that filters out the noise of general market drift.
Dual-Core: Toggle seamlessly between "Alpha Mode" (Log Returns) for verified stats and "Visual Mode" (Price) for trend alignment.
Calculation Modes: Pearson (Standard), Euclidean (Distance), Cosine (Vector), Manhattan (Grid).
2. Symmetric Compute Optimization Calculating a 15x15 matrix requires evaluating 225 unique relationships per bar, which often crashes memory limits.
The Fix: The V3 Engine utilizes Symmetric Logic, recognizing that Correlation(A, B) == Correlation(B, A).
The Gain: By computing only the lower triangle of the matrix and mirroring pointers to the upper triangle, we reduced computational load by 50%, ensuring a lightning-fast data feed even on lower timeframes.
3. Context-Aware "Ghost Mode" The UI is designed for professional traders who need focus, not clutter.
Smart Detection: The matrix automatically detects your current chart's Ticker ID. If you are trading QQQ, the matrix will visually highlight the Nas100 row and column, making them opaque and bright while dimming the rest.
Dynamic Transparency: Irrelevant data ("Noise" < 0.3 correlation) fades into the background. Only significant "Alpha Signals" (> 0.7) glow with full Neon Saturation.
Key Features
Dominant Flow Scanner: The matrix scans all 105 unique pairs every tick and prints the #1 Strongest Correlation at the bottom of the pane (e.g., DOMINANT FLOW: Bitcoin ↔ Nas100 ).
Streak Counter: A "Stubbornness" metric that tracks how many consecutive days a strong correlation has persisted. Instantly identify if a move is a "flash event" or a "structural trend."
Neon Palette: Proprietary color mapping using Electric Blue (+1.0) for lockstep correlation and Deep Red (-1.0) for inverse hedging.
Usage Guide
Placement: Best viewed in a bottom pane (Footer).
Assets: Pre-loaded with the Essential 15 Macro Drivers (Indices, BTC, Gold, Oil, Rates, FX, Key Sectors). Fully editable via settings (Ticker|Name).
Reading the Grid:
🔵 Bright Blue: Assets moving in lockstep (Risk-On).
🔴 Bright Red: Assets moving perfectly opposite (Hedge/Risk-Off).
⚫ Faded/Black: No statistical relationship (Decoupled).
Key Improvements Made:
Formatting: Added clear bullet points and bolding to make it scannable.
Clarity: Clarified the "Logarithmic Returns" section to explain why it matters (Velocity vs. Price Levels).
Tone: Maintained the "high-tech/quant" vibe but removed slightly clunky phrases like "spurious signals" (unless you prefer that academic tone, in which case I left it in as it fits the persona).
Structure: Grouped the "Modes" under the Math Engine for better logic.
Created and designed with love by David James @QuantLabs : )
NTA Directional Price Pressure (DPP)NTA Directional Pressure Bar
by NexTrade Academy
NTA Directional Pressure Bar is a contextual market analysis tool developed by NexTrade Academy, designed to quantify real-time directional price pressure by measuring the efficiency and dominance of bullish versus bearish price movement.
This script is not a trading system and does not generate buy or sell signals. Its purpose is to act as a bias confirmation and market context engine, helping traders understand who is controlling the market right now.
🔍 What does NTA Directional Pressure Bar do?
This indicator analyzes pure price action to:
Measure bullish vs bearish pressure using candle body efficiency
Quantify directional dominance in real time
Identify when one side (buyers or sellers) is in control
Filter low-quality conditions and non-operable market phases
The result is a clean, visual pressure bar that reflects institutional-style market control, without unnecessary noise.
📊 How to read it
Green dominance → Bullish pressure is in control
Red dominance → Bearish pressure is in control
Balanced / flat zones → No clear dominance (range or compression)
This tool does not trigger trades.
It enables or disables directional bias.
🧠 Institutional Use Case
NTA Directional Pressure Bar is designed to be used as:
A bias confirmation layer
A context filter before execution
A confluence tool alongside structure, liquidity, or Wyckoff-based analysis
It integrates naturally with frameworks such as:
Wyckoff NTA – Institutional Context Engine
NTC (NexTrade Concept) execution models
⚠️ Important Notice
This script does not guarantee results, is not automated, and is not financial advice.
It must be used strictly as a contextual analysis tool, always combined with a structured trading plan and proper risk management.
✅ Recommended Use
Use NTA Directional Pressure Bar to:
Confirm directional bias
Avoid trading against dominant pressure
Stay aligned with market control
Improve trade selectivity and discipline
Developed by NexTrade Academy
Institutional Trading · Market Structure · Context First
Monthly High/Low - [JTCAPITAL]Monthly High/Low Probability Table - is a modified way to use historical monthly high and low tracking combined with probabilistic analysis for bullish and bearish months to detect potential patterns in monthly price behavior.
The indicator works by calculating in the following steps:
Variable Declaration
Persistent variables ( var ) are used to store monthly highs, lows, open and close prices, and the days on which highs and lows occurred. Separate arrays track bullish and bearish month statistics for highs and lows ( highBull, lowBull, highBear, lowBear ). Counters ( bullCount, bearCount ) store the number of bullish and bearish months recorded.
New Month Detection
The script detects the start of a new month by comparing the current bar’s month to the previous bar’s month. If a new month is detected, the script proceeds to update statistics for the previous month.
Monthly High/Low Recording and Classification
At the start of each new month, the previous month’s high, low, open, and close are evaluated:
If monthClose > monthOpen , the month is classified as bullish.
If monthClose < monthOpen , the month is classified as bearish.
The arrays ( highBull, lowBull, highBear, lowBear ) are updated at the respective high and low days of the month by incrementing counts, which allows the script to keep track of the frequency of monthly highs and lows occurring on specific days.
Monthly High/Low Tracking
During the month, the script continuously updates monthHigh and monthLow if the current bar’s high exceeds monthHigh or the low is below monthLow . The days on which these highs and lows occur are recorded ( highDay and lowDay ). The monthClose variable is continuously updated to the latest closing price.
Probability Calculation
Once monthly data is accumulated, the script calculates probabilities for each day of the month:
bullHighProb and bullLowProb represent the probability (in percentage) that a bullish month’s high or low occurred on a given day.
bearHighProb and bearLowProb represent the probability for bearish months.
These probabilities are calculated by dividing the count of high or low occurrences on each day by the total number of bullish or bearish months, then multiplying by 100. This probabilistic approach allows traders to see recurring patterns for highs and lows across multiple months.
Gradient Coloring Function
The helper function gradientRelative computes a color gradient between lowColor and highColor based on the relative probability value. Higher probabilities are colored closer to highColor , and lower probabilities closer to lowColor . This visual representation allows for quick identification of the most probable days for highs and lows in bullish or bearish months.
Dynamic Updates
As new bars are processed, the table is updated in real-time with new probabilities reflecting the most recent month’s data. This dynamic behavior ensures that the table remains accurate and responsive to the latest market information.
Buy and Sell Conditions:
This indicator does not provide direct buy or sell signals. Instead, it provides probabilistic information about historical patterns for bullish and bearish months. Traders can use the table to:
Identify days in the month where highs or lows are statistically more likely to occur.
Combine with other trend-following or reversal strategies to optimize entry and exit points.
For example, if a trader notices that bullish month highs frequently occur around day 15, they may plan trades around that period when other indicators align.
Features and Parameters:
Dynamic Probability Table : Updates in real-time as new monthly data becomes available.
Historical Pattern Tracking : Maintains arrays for highs and lows in bullish and bearish months.
Gradient Visualization : Uses color interpolation to quickly highlight higher probability days.
Specifications:
Monthly High/Low Tracking
Tracks the highest and lowest prices within each month. This is the foundation of the probability calculations. It allows traders to understand when significant price events historically occur.
Bullish/Bearish Month Classification
Each month is classified based on the relationship between monthClose and monthOpen . This provides context for the high/low occurrences: whether they happened in bullish or bearish months.
High/Low Occurrence Arrays
Four arrays ( highBull, lowBull, highBear, lowBear ) store the count of high and low occurrences for each day of the month. These arrays are the core of the statistical analysis.
Probability Calculation
Divides the count of occurrences for each day by the total number of months in that category (bullish/bearish). Multiplying by 100 converts this to a percentage probability, giving traders a numerical sense of recurrence.
Real-Time Updates
The table and probabilities are recalculated and refreshed with each new bar. This ensures that traders have the most current information available without manual recalculation.
User-Centric Visualization
By showing probabilities for both bullish and bearish months separately, traders gain a deeper understanding of market tendencies and recurring monthly patterns, which can be leveraged for improved timing and strategy alignment.
Important:
There is a misalign in percentages due to not all months having the same amount of days.
BK AK-Zenith💥 Introducing BK AK-ZENITH — Adaptive Rhythm RSI for Peak/Valley Warfare 💥
This is not another generic RSI. This is ZENITH: it measures where momentum is on the scale, then tells you when it’s hitting extremes, when it’s turning, and when price is lying through its teeth with divergence.
At its core, ZENITH does one thing ruthlessly well:
it matches the oscillator’s period to the market’s current rhythm—adaptive when the market is fast, adaptive when the market is slow—so your signals stop being “late because the settings were wrong.”
🎖 Full Credit — Respect the Origin (AlgoAlpha)
The core RSI architecture in this form belongs to AlgoAlpha—one of the best introducers and coders on TradingView. They originated this adaptive/Rhythm-RSI framework and the way it’s presented and engineered.
BK AK-ZENITH is my enhancement layer on top of AlgoAlpha’s foundation.
I kept the spine intact, and I added tactical systems: clearer Peak/Valley warfare logic, pivot governance (anti-spam), divergence strike markers, momentum flip confirmation, and a war-room readout—so it trades like a weapon, not a toy.
Respect where it started: AlgoAlpha built the engine. I tuned it for battlefield use.
🧠 What Exactly is BK AK-ZENITH?
BK AK-ZENITH is an Adaptive Period RSI (or fixed if you choose), designed to read momentum like a range of intent rather than a single overbought/oversold gimmick.
Core Systems Inside ZENITH
✅ Adaptive Period RSI (Rhythm Engine)
Automatically adjusts its internal RSI length to match current market cadence.
(Optional fixed length mode if you want static.)
✅ Optional HMA Smoothing
Cleaner shape without turning it into a laggy moving average.
✅ Peak / Valley Zones (default 80/20)
Hard boundaries that define “true extremes” so you stop treating every wiggle like a signal.
✅ Pivot-Based BUY/SELL Triangles + Cooldown
Signals are governed by pivots and a cooldown so it doesn’t machine-gun trash.
✅ Momentum Flip Diamonds (◇)
Shows when the oscillator’s slope flips—clean confirmation for “engine change.”
✅ Divergence Lightning (⚡)
Exposes when price is performing confidence while momentum is quietly breaking.
✅ War-Room Table / Meter
Bias, zone, reading, and adaptive period printed so you don’t “interpret”—you execute.
✅ Alerts Suite
Pivots, divergences, zone entries—so the chart calls you, not your emotions.
🎯 How to use it (execution rules)
1) Zones = permission
Valley (≤ Valley level): demand territory. Stalk reversal structure; stop chasing breakdown candles.
Peak (≥ Peak level): supply territory. Harvest, tighten, stop adding risk at the top.
2) Pivot triangles = the shot clock
Your ▲/▼ signals are pivot-confirmed with a cooldown. That’s intentional.
This is designed to force patience and prevent overtrading.
3) Divergence = truth serum
When price makes the “confident” high/high or low/low but ZENITH disagrees, you’re seeing internal change before the crowd does.
Treat divergence as warning + timing context, not a gambling button.
4) Meter/Table = discipline
If you can’t summarize the state in one glance, you’ll overtrade. ZENITH prints the state so your brain stops inventing stories.
🔧 Settings that actually matter
Adaptive Period ON (default): the whole point of ZENITH
Peak/Valley levels: how strict extremes must be
Pivot strength + Cooldown: your anti-spam governor
Divergence pivot length: controls how “major” divergence must be
The “AK” in the name is an acknowledgment of my mentor A.K. His standards—patience, precision, clarity, emotional control—are why this tool is built with governors instead of hype.
And above all: all praise to Gd—the true source of wisdom, restraint, and right timing.
👑 King Solomon Lens — ZENITH Discernment
Solomon asked Gd for something most people never ask for: not wealth, not victory—discernment. The ability to separate what looks true from what is true.
That is exactly what momentum work is supposed to do.
1) Honest weights, honest measures.
In Solomon’s world, crooked scales were an abomination because they disguised reality. In trading, the crooked scale is your own excitement: you see one green candle and call it strength. ZENITH forces an honest measure—0 to 100—so you deal in degree, not drama. A Peak is not “bullish.” A Peak is “momentum priced in.” A Valley is not “bearish.” A Valley is “selling pressure reaching exhaustion.”
2) Wisdom adapts to seasons.
Solomon’s order wasn’t chaos—there was a time to build, a time to harvest, a time to wait. Markets have seasons too: trend seasons, chop seasons, compression seasons, expansion seasons. Fixed-length RSI pretends every season is the same. ZENITH does not. It listens for rhythm and adjusts its internal timing so your read stays relevant to today’s market tempo—not last month’s.
3) The sword test: revealing what’s hidden.
Solomon’s most famous judgment wasn’t about theatrics—it was about revealing the truth beneath appearances. Divergence is that same test in markets: price can perform strength while the engine quietly weakens, or perform weakness while momentum secretly repairs. The ⚡ is not a prophecy. It’s a revelation: “what you see on price is not the full story.”
That’s ZENITH discipline: measure → discern → execute.
And may Gd bless your judgment to act only when the measure is clean.
⚔️ Final
BK AK-ZENITH is a momentum fire-control system: adaptive rhythm + extreme zones + pivot timing + divergence truth.
Use it to stop feeling trades and start weighing them. Praise to Gd always. 🙏
STUDENT WYCKOFF Volume ClimaxSTUDENT WYCKOFF Volume Climax highlights potential buying and selling climaxes by combining abnormally high volume with wide spread bars.
It is a simple Wyckoff-style tool that helps you see where effort (volume) and result (spread) reached extreme levels and may signal exhaustion or stopping action.
━━━━━━━━━━
1. Concept
━━━━━━━━━━
The script looks for bars where:
• Volume is many times higher than its recent average.
• The spread (high–low range) is much wider than usual.
• The candle has a real body (not a tiny doji).
• The bar is fully confirmed (closed).
Such bars are marked as:
• **BC (Buying Climax)** – wide up bar on very high volume.
• **SC (Selling Climax)** – wide down bar on very high volume.
The idea is not to call exact tops or bottoms, but to mark places on the chart where effort and result spike together, so you can then judge context, background and next bars in the Wyckoff sense.
━━━━━━━━━━
2. How the indicator works
━━━━━━━━━━
Inputs:
• Volume lookback – number of bars used for the average volume.
• Spread lookback – number of bars used for the average spread (high–low).
• Volume multiplier – how many times above the average volume a bar must reach to be considered “climactic”.
• Spread multiplier – how many times above the average spread the bar’s range must be.
• Min body / spread – minimum body size as a fraction of spread (0–1) to filter out near-doji candles.
Internally the script calculates:
• Range = high − low.
• Average volume = SMA(volume, volume lookback).
• Average spread = SMA(range, spread lookback).
• Body fraction = |close − open| / range.
A bar is a **climax bar** only if:
1) Volume > averageVolume × volumeMultiplier,
2) Spread > averageSpread × spreadMultiplier,
3) BodyFraction ≥ Min body / spread,
4) Bar is closed (barstate.isconfirmed).
Classification:
• If close > open → **Buying Climax (BC)**.
• If close < open → **Selling Climax (SC)**.
━━━━━━━━━━
3. Visuals
━━━━━━━━━━
The indicator works in a separate pane (overlay = false) and shows:
1) **Histogram in the subwindow**
• Value = Volume / AverageVolume (ratio).
• 1.0 line marks average volume.
• Bars are colored:
– Green for BC,
– Red for SC,
– Neutral grey for all other bars.
2) **Labels on price with force overlay**
• On BC bars a small “BC” label is plotted above the bar high.
• On SC bars a small “SC” label is plotted below the bar low.
• Labels are drawn with `force_overlay=true`, so they appear directly on the price chart even though the indicator itself is in the lower pane.
All signals are generated **only on bar close** to reduce repainting behaviour. The last, still forming bar is not treated as a confirmed climax.
━━━━━━━━━━
4. How to use it
━━━━━━━━━━
Typical applications:
• Wyckoff-style reading of climactic action
– Look for BC near potential buying climaxes in up moves, especially after long rallies or in the last part of a trend.
– Look for SC near potential selling climaxes after panics or shake-outs.
• Effort vs Result analysis
– Ask whether the market gets a lot of “effort” (volume + wide spread) but then fails to continue in the same direction.
– Pay attention to the next 1–3 bars after a BC/SC: is there follow-through or immediate failure?
• Scanning for zones of interest
– On higher timeframes BC/SC can highlight areas worth marking as potential stopping, climactic or reversal zones.
– On intraday timeframes they can show where very aggressive activity hit the tape (news, open/close auctions, liquidations).
The labels and histogram are **not** trading signals by themselves. They are context markers that tell you: “Here was a big push with big spread; now check structure, background and test behaviour.”
━━━━━━━━━━
5. Notes and disclaimer
━━━━━━━━━━
• Works on any symbol and timeframe available on TradingView.
• Uses only standard built-in volume and price data; no exotic calculations.
• Signals are calculated on confirmed bars with `barstate.isconfirmed`, so they do not repaint after the bar closes.
This script is published for educational and analytical purposes only.
It does not constitute financial or investment advice and does not guarantee any performance. Always test your ideas, understand the logic behind your tools and use proper risk management.
BK AK-IED💥 Introducing BK AK-IED — Volatility Ignition / Expansion / Detonation 💥
A pressure-to-release weapon system for traders who want timing, not noise.
Markets don’t move clean because they “feel like it.” They load, they ignite, and then they detonate into expansion. BK AK-IED is built to expose that sequence in real time—so you stop trading randomness and start trading regime shifts.
⚔️ What BK AK-IED is
BK AK-IED is a 3-speed VWMA energy oscillator that blends price movement + volume into a single pressure readout:
Fast (5) = ignition energy (range-driven)
Medium (21) = core pressure engine
Slow (55) = structural volatility backdrop
It’s not a “direction oracle.” It’s an energy meter that tells you when the market is coiling, when it’s waking up, and when it’s breaking out with force.
🧠 Core Weapon Systems
✅ Dynamic Scaling
Keeps the oscillator readable across symbols (no ridiculous y-axis blowouts).
✅ Volatility State Bar (Bottom Strip) — Your War Room
🟨 CONTRACTION = VWMA convergence / coil / pressure loading
🟩 EXPANSION = energy spike begins
🟥 BREAKOUT = expansion without contraction (release phase)
⬜ NEUTRAL = dead zone, don’t force it
✅ Breakout Peak Icons (Crown markers)
Crowns print only when there’s true breakout energy and the move hits major peak territory versus recent extremes. Translation:
tighten risk, scale-out, stop getting greedy. These are exhaustion warnings—not automatic reversals.
Timeframe-adaptive peak filtering is built in:
< 1H: stricter peak requirement
≥ 1H: more realistic swing threshold
🧭 How to use it (execution, not opinions)
1) 🟨 Contraction = don’t bleed.
This is the chop factory. You wait. You map levels. You stalk.
2) 🟩 Expansion = prepare.
Start aligning with structure: trend framework, VWAP, key levels, HTF bias.
3) 🟥 Breakout = engage.
This is where moves pay. Trade the direction your structure supports and manage risk like a professional.
4) 👑 Peak during breakout = harvest / protect.
Scale. Tighten stops. Don’t turn winners into donations.
🧱 Inputs that matter (what you’re actually tuning)
Amplitude Multiplier = how aggressive the energy read is
VWMA Spread Contraction Threshold = how tight “coil” must be to count
Scale Lookback = how far back the dynamic scaling references
Peak Thresholds = how selective peaks are (auto-switches based on timeframe)
The “AK” in the name is an acknowledgment of my mentor A.K. His standards (patience, precision, clarity, and emotional control) are a major reason I build tools with structure instead of hype.
And above all: all praise to Gd — the true source of wisdom, restraint, and right timing.
👑 King Solomon Lens — ZENITH Discipline
Solomon didn’t build greatness by impulse. He built it by measure, order, and restraint.
When the Temple was built, the stones were prepared away from the site—so the structure went up with precision, not chaos. That is the market lesson: the decisive moment is loud, but the preparation is silent. If you only show up for the noise, you will always arrive late.
BK AK-IED is that Solomon blueprint on a chart:
🟨 Contraction is the quarry.
The market is cutting the stones in silence. This is where the undisciplined burn money “doing something.” The wise do the opposite: they reduce noise, define levels, and wait.
🟩 Expansion is the line being set.
Pressure starts to move. This is where you bring structure online—bias, levels, risk plan. Not excitement.
🟥 Breakout is the placement.
The stone drops into position. This is the only phase where aggression is righteous—because it’s backed by a real shift, not hope.
👑 Peak icons are ZENITH—crown-of-the-move logic.
Zenith is where force and momentum reach their highest point before decay begins. The crown is not “celebrate and add.” The crown is govern yourself: harvest, tighten, protect. Solomon’s edge wasn’t prediction—it was rule over the self. That’s what separates profit from punishment.
This is what wisdom looks like in trading: not guessing the future—governing your exposure when the present is telling you the truth. And may Gd bless your restraint as much as your entries, because restraint is where survival becomes power.
✅ Final
BK AK-IED is your volatility weapon for market warfare:
Load → Ignite → Detonate.
Use it with structure. Use it with discipline. And give praise to Gd for every protected loss, every clean entry, and every moment you didn’t force a trade. 🙏
First presented FVG (w/stats) w/statistical hourly ranges & biasOverview
This indicator identifies the first Fair Value Gap (FVG) that forms during each hourly session and provides comprehensive statistical analysis based on 12 years of historical NASDAQ (NQ) data. It combines price action analysis with probability-based statistics to help traders make informed decisions.
⚠️ IMPORTANT - Compatibility
Market: This indicator is designed exclusively for NASDAQ futures (NQ/MNQ)
Timeframe: Statistical data is based on FVGs formed on the 5-minute timeframe
FVG Detection: Works on any timeframe, but use 5-minute for accuracy matching the statistical analysis
All hardcoded statistics are derived from 12 years of NQ historical data
What It Does
1. FVG Detection & Visualization
Automatically detects the first FVG (bullish or bearish) that forms each hour
Draws colored boxes around FVGs:
Blue boxes = Bullish FVG (gap up)
Red boxes = Bearish FVG (gap down)
FVG boxes extend to the end of the hour
Optional midpoint lines show the center of each FVG
Uses volume imbalance logic (outside prints) to refine FVG boundaries
2. Hourly Reference Lines
Vertical Delimiter: Marks the start of each hour
Hourly Open Line: Shows where the current hour opened
Expected Range Lines: Projects the anticipated high/low based on historical data
Choose between Mean (average) or Median (middle value) statistics
Upper range line (teal/green)
Lower range line (red)
All lines span exactly one hour from the moment it opens
Optional labels show price values at line ends
3. Real-Time Statistics Table
The table displays live data for the current hour only:
Hour: Current hour in 12-hour format (AM/PM)
FVG Status: Shows if a Bull FVG, Bear FVG, or no FVG has formed yet
Green background = Bullish FVG detected
Red background = Bearish FVG detected
1st 15min: Direction of the first 15 minutes (Bullish/Bearish/Neutral/Pending)
Continuation %: Historical probability that the hour continues in the first 15-minute direction
Color-coded: Green for bullish, red for bearish
Avg Range %: Expected percentage range for the current hour (based on 12-year mean)
FVG Effect %: Historical probability that FVG direction predicts hourly close direction
Shows BISI→Bull % for bullish FVGs
Shows SIBI→Bear % for bearish FVGs
Blank if no FVG has formed yet
Time Left: Countdown timer showing MM:SS remaining in the hour (updates in real-time)
Hourly Bias: Historical directional tendency (bullish % or bearish %)
H Open: Current hour's opening price
Exp Range: Projected price range (Low - High) based on historical average
Customization Options
Detection Settings:
Lower Timeframe Selection (15S, 1min, 5min) - controls FVG detection granularity
Display Settings:
FVG box colors (bullish/bearish)
Midpoint lines (show/hide, color, style)
Table Settings:
Position (9 locations: corners, edges, center)
Text size (Tiny, Small, Normal, Large)
Hourly Lines:
Toggle each line type on/off
Hour delimiter (color, width)
Open line (color, width, style)
Range lines (color, width, style)
Choose Mean or Median statistics for range calculation
Show/hide labels with customizable text size
How to Use
Apply to NQ futures chart (NQ1! or MNQ1!)
Set chart to 5-minute timeframe for optimal FVG detection matching the statistical data
Watch for the first FVG to form each hour
Reference the table for probability-based decision support:
High continuation % = strong directional bias
FVG Effect % shows reliability of the FVG signal
Time Left helps manage entries/exits within the hour
Use range lines as potential targets or reversal zones
Statistical Foundation
All statistics are derived from:
12 years of NASDAQ (NQ) historical data
Hourly analysis of FVG formation patterns
First 15-minute directional analysis
Mean and Median calculations for range expectations
Data encompasses 2,400+ samples per hour
Best Practices
✅ Use on NQ/MNQ futures only
✅ Best on 5-minute charts (matches statistical data)
✅ Combine FVG signals with continuation probabilities
✅ Use range lines as potential profit targets
✅ Watch the countdown timer for hour-end setups
❌ Do not use on other markets (statistics won't apply)
❌ Avoid using during low-liquidity hours (5PM ET has minimal data)
Technical Notes
Timezone: America/New_York (EST/EDT)
Weekend filtering: Automatically hides data during market closure
Updates in real-time on live bars
Maximum 500 boxes/lines for performance
FVG detection includes volume imbalance (body gap) refinement
Credits
Statistical analysis based on 12 years of NASDAQ historical data. FVG detection methodology follows ICT concepts with volume imbalance refinement.
Disclaimer: This indicator provides statistical analysis based on historical data. Past performance does not guarantee future results. Always use proper risk management.
Would you like me to adjust any section or add/remove anything?6-9 Session & Levels - Customizable Range Analysis Indicator
Description:
This indicator provides comprehensive session-based range analysis designed for intraday traders. It calculates and displays key levels based on a customizable session period (default 6:00-9:00 AM ET).
Core Features:
Sespastedthis is a summary for another indicator- i was hoping for something more like this in terms of content etc22:23Architected comprehensive indicator summary matching professional documentation style.The user wants me to rewrite the summary for their FVG indicator in a similar style to the example provided. The example is more structured, detailed, and professional. Let me create a comprehensive summary that follows that format:
Clear title
Description/Overview
Core Features (broken down into sections)
Input Settings Explained (detailed breakdown of all customization options)
How It Works section
Use Case
Note/Disclaimer
Let me make it thorough and match the style while being accurate to their indicator's functionality.Here's a detailed summary in that format:
Every Hour 1st FVG with Statistical Analysis - NASDAQ Hourly Trading Intelligence
Description:
This indicator identifies the first Fair Value Gap (FVG) that forms during each hourly session and provides comprehensive probability-based statistical analysis derived from 12 years of NASDAQ (NQ) historical data. It combines real-time FVG detection with hardcoded statistical probabilities to help intraday traders make informed decisions based on historical patterns and hourly price action dynamics.
IMPORTANT: This indicator is specifically calibrated for NASDAQ futures (NQ/MNQ) only. All statistical data is derived from 12 years of NQ historical analysis with FVGs detected on the 5-minute timeframe. Using this indicator on other markets will produce invalid statistical results.
Core Features:
FVG Detection & Visualization
Automatically detects and displays the first Fair Value Gap (bullish or bearish) that forms within each hourly session
Color-coded boxes mark FVG zones: Blue for bullish FVGs (gap up), Red for bearish FVGs (gap down)
FVG boxes extend precisely to the end of the hour boundary
Optional midpoint lines show the center point of each FVG
Uses volume imbalance logic (outside prints) to refine FVG boundaries beyond simple wick-to-wick gaps
Supports both chart timeframe detection and lower timeframe detection via request.security_lower_tf
Hourly Reference Lines
Vertical Hour Delimiter: Marks the exact start of each new hour with an extendable vertical line
Hourly Open Line: Displays the opening price of the current hour
Expected Range Lines: Projects anticipated high and low levels based on 12 years of statistical data
Choose between Mean (average) or Median (middle value) calculations
Upper range line shows expected high
Lower range line shows expected low
All lines span exactly one hour from open to close
Optional labels display exact price values at the end of each line
Real-Time Statistics Table
Displays comprehensive live data for the current hour only:
Hour: Current hour in 12-hour format (e.g., "9AM", "2PM")
FVG Status: Shows detection state with color coding
"None Yet" (white background) - No FVG detected
"Bull FVG" (green background) - Bullish FVG identified
"Bear FVG" (red background) - Bearish FVG identified
1st 15min: Direction of first 15 minutes (Bullish/Bearish/Neutral/Pending)
Continuation %: Historical probability that the hour closes in the direction of the first 15 minutes
Green background with up arrow (↑) for bullish continuation probability
Red background with down arrow (↓) for bearish continuation probability
Avg Range %: Expected percentage range for the current hour based on 12-year mean
FVG Effect %: Historical effectiveness of FVG directional prediction
Shows "BISI→Bull %" for bullish FVGs (gap up predicting bullish hourly close)
Shows "SIBI→Bear %" for bearish FVGs (gap down predicting bearish hourly close)
Displays blank if no FVG has formed yet
Time Left: Real-time countdown timer showing minutes and seconds remaining in the hour (MM:SS format)
Hourly Bias: Historical directional tendency showing bullish or bearish percentage bias
H Open: Current hour's opening price
Exp Range: Projected price range showing "Low - High" based on selected statistic (mean or median)
Input Settings Explained:
Detection Settings
Lower Timeframe: Select the base timeframe for FVG detection
Options: 15S (15 seconds), 1 (1 minute), 5 (5 minutes)
Recommendation: Use 5-minute to match the statistical data sample
The indicator uses this timeframe to scan for FVG patterns even when viewing higher timeframes
Display Settings
Bullish FVG Color: Set the color and transparency for bullish (upward) FVG boxes
Bearish FVG Color: Set the color and transparency for bearish (downward) FVG boxes
Show Midpoint Lines: Toggle horizontal lines at the center of each FVG box
Midpoint Line Color: Customize the midpoint line color
Midpoint Line Style: Choose between Solid, Dotted, or Dashed line styles
Table Settings
Table Position: Choose from 9 locations:
Top: Left, Center, Right
Middle: Left, Center, Right
Bottom: Left, Center, Right
Table Text Size: Select from Tiny, Small, Normal, or Large for readability on different screen sizes
Hourly Lines Settings
Show Hourly Lines: Master toggle for all hourly reference lines
Show Hour Delimiter: Toggle the vertical line marking each hour's start
Delimiter Color: Customize color and transparency
Delimiter Width: Set line thickness (1-5)
Show Hourly Open: Toggle the horizontal line at the hour's opening price
Open Line Color: Customize color
Open Line Width: Set thickness (1-5)
Open Line Style: Choose Solid, Dashed, or Dotted
Show Range Lines: Toggle the expected high/low projection lines
Range Statistic: Choose "Mean" (12-year average) or "Median" (12-year middle value)
Range High Color: Customize upper range line color and transparency
Range Low Color: Customize lower range line color and transparency
Range Line Width: Set thickness (1-5)
Range Line Style: Choose Solid, Dashed, or Dotted
Show Line Labels: Toggle price labels at the end of all horizontal lines
Label Text Size: Choose Tiny, Small, or Normal
How It Works:
FVG Detection Logic:
The indicator scans price action on the selected lower timeframe (default: 1-minute) looking for Fair Value Gaps using a 3-candle pattern:
Bullish FVG: Formed when candle 's high is below candle 's low, creating an upward gap
Bearish FVG: Formed when candle 's low is above candle 's high, creating a downward gap
The detection is refined using volume imbalance logic by checking for body gaps (outside prints) on both sides of the middle candle. This narrows the FVG zone to areas where bodies don't touch, indicating stronger imbalances.
Only the first FVG that forms during each hour is displayed. If a bullish FVG forms first, it takes priority. The FVG box is drawn from the formation time through to the end of the hour.
Statistical Analysis:
All probability statistics are hardcoded from 12 years (2,400+ samples per hour) of NASDAQ futures analysis:
First 15-Minute Direction: At 15 minutes into each hour, the indicator determines if price closed above, below, or equal to the hour's opening price
Continuation Probability: Historical analysis shows the likelihood that the hour closes in the same direction as the first 15 minutes
Example: If 9AM's first 15 minutes are bullish, there's a 60.1% chance the entire 9AM hour closes bullish (lowest continuation hour)
4PM shows the highest continuation at 86.1% for bullish first 15 minutes
FVG Effectiveness: Tracks how often the first FVG's direction correctly predicts the hourly close direction
BISI (Bullish Imbalance/Sell-side Inefficiency) → Bullish close probability
SIBI (Bearish Imbalance/Buy-side Inefficiency) → Bearish close probability
Range Expectations: Mean and median values represent typical price movement percentage for each hour
9AM and 10AM show the largest ranges (~0.6%)
5PM shows minimal range (~0.06%) due to low liquidity
Hourly Reference Lines:
When each new hour begins:
Vertical delimiter marks the hour's start
Hourly open line plots at the first bar's opening price
Range projection lines calculate expected high/low:
Upper Range = Hourly Open + (Range% / 100 × Hourly Open)
Lower Range = Hourly Open - (Range% / 100 × Hourly Open)
Lines extend exactly to the hour's end time
Labels appear at line endpoints showing exact prices
Real-Time Updates:
FVG Status: Updates immediately when the first FVG forms
First 15min Direction: Locked in at the 15-minute mark
Countdown Timer: Uses timenow to update every second
Table Statistics: Refresh on every bar close
Timezone Handling:
All times are in America/New_York (Eastern Time)
Automatically filters weekend periods (Saturday and Sunday before 6PM)
Hour detection accounts for daylight saving time changes
Use Cases:
Intraday Trading Strategy Development:
FVG Entry Signals: Use the first hourly FVG as a directional bias
Bullish FVG + High continuation % = Strong long setup
Bearish FVG + High continuation % = Strong short setup
First 15-Minute Breakout: Combine first 15-min direction with continuation probabilities
Wait for first 15 minutes to complete
If continuation % is above 70%, trade in that direction
Example: 4PM bullish first 15 min = 86.1% chance hour closes bullish
Range Targeting: Use expected high/low lines as profit targets or reversal zones
Price approaching mean high = potential resistance
Price approaching mean low = potential support
Compare mean vs median for different risk tolerance (median is more conservative)
Hour Selection: Focus trading on hours with:
High FVG effectiveness (11AM: 81.5% BISI→Bull)
High continuation rates (4PM: 86.1% bull continuation)
Avoid low-continuation hours like 9AM (60.1%)
Time Management: Use the countdown timer to:
Enter early in the hour when FVG forms
Exit before hour-end if no follow-through
Avoid late-hour entries with <15 minutes remaining
Statistical Edge Identification:
Compare current hour's FVG against historical effectiveness
Identify when first 15-min direction contradicts FVG direction (conflict = caution)
Use hourly bias to confirm or contradict FVG signals
Monitor if price stays within expected range or breaks out (outlier moves)
Risk Management:
Expected range lines provide logical stop-loss placement
FVG Effect % helps size positions (higher % = larger position)
Time Left countdown aids in time-based stop management
Avoid trading hours with neutral bias or low continuation rates
Statistical Foundation:
All embedded statistics are derived from:
12 years of NASDAQ futures (NQ) continuous contract data
5-minute timeframe FVG detection methodology
24 hours per day analysis (excluding weekends)
2,400+ samples per hour for robust statistical validity
America/New_York timezone for session alignment
Data includes:
Hourly range analysis (mean, median, standard deviation)
First 15-minute directional analysis
FVG formation frequency and effectiveness
Continuation probability matrices
Bullish/bearish bias percentages
Best Practices:
✅ Do:
Use exclusively on NASDAQ futures (NQ1! or MNQ1!)
Apply on 5-minute charts for optimal FVG detection matching statistical samples
Wait for first 15 minutes to complete before acting on continuation probabilities
Combine FVG signals with continuation % and FVG Effect % for confluence
Use expected range lines as initial profit targets
Monitor the countdown timer for time-based trade management
Focus on hours with high statistical edges (4PM, 11AM, 10AM)
❌ Don't:
Use on other markets (ES, RTY, YM, stocks, forex, crypto) - statistics will be invalid
Rely solely on FVG without confirming with continuation probabilities
Trade during low-liquidity hours (5PM shows only 0.06% average range)
Ignore the first 15-minute direction when it conflicts with FVG direction
Apply to timeframes significantly different from 5-minute for FVG detection
Use median range expectations aggressively (they're conservative)
Technical Implementation Notes:
Timezone: Fixed to America/New_York with automatic DST adjustment
Weekend Filtering: Automatically hides data Saturday and Sunday before 6PM ET
Performance: Maximum 500 boxes and 500 lines for optimal chart rendering
Update Frequency: Table updates on every bar close; timer updates every second using timenow
FVG Priority: Bullish FVGs take precedence when both form simultaneously
Lower Timeframe Detection: Uses request.security_lower_tf for accurate sub-chart-timeframe FVG detection
Precision: All price labels use format.mintick for appropriate decimal precision
Big thanks to @Trades-Dont-Lie for the FPFVG code in his excellent indicator that I've used here
History Trading SessionsThis indicator helps visually structure the trading day by highlighting custom time zones on the chart.
It is designed for historical analysis, trading discipline, and clear separation between analysis time, active trading, and no-trade periods.
Recommended to use on 4h and below time frames.
TSIM Volatility Weather ModelThe Volatility Weather Model is an indicator that delivers a unified "weather report" on market volatility by averaging 10 specialized estimators into actionable insights. It helps traders gauge price swing intensity, anticipate regime shifts, and align strategies with current market conditions—turning volatile environments into opportunities rather than hazards.
How Traders Can Use This Indicator
Focus on volatility as a leading signal for risk and opportunity:
- Spotting Expansions and Compressions: High readings (>70% or Z>1) indicate expanding volatility—ideal for breakouts or trend-following in active regimes, but scale back positions to avoid whipsaws in ranging ones. Low readings (<30% or Z<-1) signal compression; accumulate positions gradually, as these often precede explosive moves (e.g., enter calls/puts pre-earnings when the dashboard predicts "major breakout setup").
- Risk Management: Rely on the risk filter and behavioral alerts to adjust sizing—cut leverage in "high risk" phases (e.g., implement trailing stops at 1-2% risk per trade) and increase it in "low risk" for higher conviction setups. The cycle behavior helps time cycles: "Late expansion" warns of reversals, prompting profit-taking.
- Regime-Based Strategies: In trending regimes (fast EMA > slow), use high volatility for momentum trades (e.g., buy dips on pullbacks with tight stops). In cash regimes, exploit mean reversion—short extremes when the expected behavior flags "volatility mean reversion likely imminent."
- Multi-Timeframe Application: Day traders: Short lookbacks (20-40 bars) for intraday swings, watching bar colors for quick entries/exits. Swing traders: Longer periods (50-200) to filter noise, combining with support/resistance. For portfolios, scan multiple assets; if averages cluster high, hedge overall exposure.
- Scenario Examples:
- Bull Market Rally: If structure behavior shows "Trending with expanding volatility," add to winners but watch for "extreme" statuses signaling pullback risks.
- Sideways Consolidation: Low volatility + ranging regime = patience mode; use "deep compression" alerts to position for volatility spikes.
- News/Event Trading: Pre-event, low readings build setups; post-event, monitor averages—if Z>1.5, fade overreactions per the predictive insights.
Key Features for Practical Use
- Dual Display Modes (Normalized or Z-Score): Switch between percentile rankings (0-100%) for quick intensity checks or standard deviation scores for spotting statistical extremes. Use Normalized for broad overviews (e.g., 80% signals "hot" markets) and Z-Score for precise deviation alerts (e.g., +2σ warns of overextension).
- Average Line and Regime Filters: The core trend line shows consensus volatility; overlay fast/slow EMAs to identify "ACTIVE" (trending, above slow EMA) vs. "CASH" (ranging, below). Risk flags color bars/backgrounds (purple for high risk, aqua for low) to signal when to dial up or down exposure.
- Dashboard Table: A customizable table (position/size adjustable) lists individual estimators with statuses (e.g., "Extreme," "Low") and five behavioral summaries: Volatility Phase, Structure, Risk, Cycle, and Expected Behavior. These narratives provide instant guidance, like "High risk phase—reduce exposure" or "Breakout setup developing."
- Visual Alerts: Gradient fills, reference lines (e.g., 50% midline, ±1σ), and optional plots highlight thresholds. Toggle smoothing and line widths for cleaner charts in real-time trading.
Trading Volatility Clock⏰ TRADING VOLATILITY CLOCK - Know When the Action Happens (Anywhere in the World)
A real-time session tracker with multi-timezone support for active traders who need to know when US market volatility strikes - no matter where they are in the world. Perfect for day traders, scalpers, and anyone trading liquid US markets.
══════════════════════════════════════════════════════
📊 WHAT IT DOES
This indicator displays a live clock showing:
- Current time in YOUR selected timezone (10 major timezones supported)
- Active US market session with color-coded volatility levels
- Countdown timer showing time remaining in current session
- Preview of the next upcoming session
- Optional alerts when entering high-volatility periods
══════════════════════════════════════════════════════
🌍 MULTI-TIMEZONE SUPPORT
SESSIONS ALWAYS TRACK US MARKET HOURS (Eastern Time):
No matter which timezone you select, the sessions always trigger at the correct US market times. Perfect for international traders who want to:
• See their local time while tracking US market sessions
• Know exactly when US volatility hits in their timezone
• Plan their trading day around US market hours
SUPPORTED TIMEZONES:
• America/New_York (ET) - Eastern Time
• America/Chicago (CT) - Central Time
• America/Los_Angeles (PT) - Pacific Time
• Europe/London (GMT) - Greenwich Mean Time
• Europe/Berlin (CET) - Central European Time
• Asia/Tokyo (JST) - Japan Standard Time
• Asia/Shanghai (CST) - China Standard Time
• Asia/Hong_Kong (HKT) - Hong Kong Time
• Australia/Sydney (AEDT) - Australian Eastern Time
• UTC - Coordinated Universal Time
EXAMPLE: A trader in Tokyo selects "Asia/Tokyo"
• Clock shows: 11:30 PM JST
• Session shows: "Opening Drive" 🔥 HIGH
• They know: US market just opened (9:30 AM ET in New York)
══════════════════════════════════════════════════════
🎯 WHY IT'S USEFUL
Whether you trade futures, high-volume stocks, or ETFs, volatility isn't constant throughout the day. Knowing WHEN to expect movement is critical:
🔥 HIGH VOLATILITY (Red):
• Opening Drive (9:30-10:30 AM ET) - Highest volume of the day
• Power Hour (3:00-4:00 PM ET) - Second-highest volume, final push
⚡ MEDIUM VOLATILITY (Yellow):
• Pre-Market (8:00-9:30 AM ET) - Building momentum
• Lunch Return (1:00-2:00 PM ET) - Traders returning
• Afternoon Session (2:00-3:00 PM ET) - Trend continuation
• After Hours (4:00-5:00 PM ET) - News reactions
💤 LOW VOLATILITY (Gray):
• Overnight Grind (12:00-8:00 AM ET) - Thin volume
• Mid-Morning Chop (10:30-11:30 AM ET) - Ranges form
• Lunch Hour (11:30 AM-1:00 PM ET) - Dead zone
• Evening Fade (5:00-8:00 PM ET) - Volume dropping
══════════════════════════════════════════════════════
⚙️ CUSTOMIZATION OPTIONS
TIMEZONE SETTINGS:
• Select from 10 major timezones worldwide
• Clock automatically displays in your local time
• Sessions remain locked to US market hours
SESSION TIME CUSTOMIZATION:
• Every session boundary is adjustable (in minutes from midnight ET)
• Perfect for traders who define sessions differently
• Advanced users can create custom volatility schedules
DISPLAY OPTIONS:
• Toggle next session preview on/off
• Enable/disable high volatility alerts
• Clean, unobtrusive table display in top-right corner
══════════════════════════════════════════════════════
💡 HOW TO USE
1. Add indicator to any chart (works on all timeframes)
2. Select your timezone in Settings → Timezone Settings
3. Set your chart to 1-minute timeframe for real-time updates
4. Customize session times if needed (Settings → Session Time Customization)
5. Watch the top-right corner for live session tracking
TRADING APPLICATIONS:
• Avoid trading during dead zones (lunch hour, mid-morning chop)
• Increase position size during high volatility windows
• Set alerts for Opening Drive and Power Hour
• Plan your trading day around US market volatility schedule
• International traders can track US sessions in their local time
══════════════════════════════════════════════════════
🎓 EDUCATIONAL VALUE
This indicator teaches traders:
• Market microstructure and volume patterns
• Why certain times produce better opportunities
• How institutional flows create intraday patterns
• The importance of timing in active trading
• How to adapt US market trading to any timezone
══════════════════════════════════════════════════════
⚠️ IMPORTANT NOTES
- Works best on 1-minute charts for frequent updates
- Sessions are ALWAYS based on US Eastern Time (ET)
- Timezone selection only changes the clock display
- Clock updates when new bar closes (not tick-by-tick)
- Alerts trigger once per bar when enabled
- Perfect for international traders tracking US markets
══════════════════════════════════════════════════════
📈 BEST USED WITH
- High-volume US stocks: TSLA, NVDA, AAPL, AMD, META
- Major US ETFs: SPY, QQQ, IWM, DIA
- US Futures: ES, NQ, RTY, YM, MES, MNQ
- Any liquid US instrument with clear intraday volume patterns
══════════════════════════════════════════════════════
🌏 FOR INTERNATIONAL TRADERS
This tool is specifically designed for traders outside the US who need to:
• Track US market sessions in their local timezone
• Know when to be at their desk for US volatility
• Avoid waking up for low-volatility periods
• Maximize trading efficiency around US market hours
No more timezone confusion. No more missing the opening bell. Just set your timezone and trade with confidence.
══════════════════════════════════════════════════════
This is an open-source educational tool. Feel free to modify and adapt to your trading style!
Happy Trading! 🚀
Kinetic Elasticity Reversion System - Adaptive Genesis Engine🧬 KERS-AGE - EVOLVED KINETIC ELASTICITY REVERSION SYSTEM
EDUCATIONAL GUIDE & THEORETICAL FOUNDATION
⚠️ IMPORTANT DISCLAIMER
This indicator and guide are provided for educational and informational purposes only. This is NOT financial advice, investment advice, or a recommendation to buy or sell any security.
Trading involves substantial risk of loss. Past performance does not guarantee future results. The performance metrics, win rates, and examples shown are from historical backtesting and do not represent actual trading results. Always conduct your own research, paper trade extensively, and never risk capital you cannot afford to lose.
The developers assume no responsibility for any trading losses incurred through use of this indicator.
INTRODUCTION
KERS-AGE (Kinetic Elasticity Reversion System - Adaptive Genetic Evolution) represents an educational exploration of adaptive trading systems. Unlike traditional indicators with fixed parameters, KERS-AGE demonstrates a dynamic, evolving approach that adjusts to market conditions through genetic algorithms and machine learning techniques.
This guide explains the theoretical concepts, technical implementation, and educational examples of how the system operates.
CONCEPTUAL FRAMEWORK
Traditional Indicators vs. Adaptive Systems:
Traditional Indicators:
Fixed parameters
Single strategy approach
Static behavior
Designed for specific conditions
Require manual optimization
Adaptive System Approach (KERS-AGE):
Dynamic parameters (adjust based on conditions)
Multiple strategies tested simultaneously
Pattern recognition (cluster analysis)
Regime-aware (speciation)
Automated optimization (genetic algorithms)
Transparent operation (detailed dashboard)
CORE CONCEPTS EXPLAINED
1. THE ELASTICITY ANALOGY 🎯
The indicator models price behavior as if connected to a moving average by an elastic band:
Price extends away → Elastic tension builds → Potential reversion point identified
Key Measurements:
STRETCH: Distance from price to equilibrium (MA)
TENSION: Normalized force calculation
THRESHOLD: Point where multiple factors align
Theoretical Foundation:
Markets have historically shown mean-reverting tendencies around fair value. This concept quantifies the deviation and identifies potential reversal zones based on multiple confluence factors.
Mathematical Approach:
text
Tension Score = (Price Distance from MA) / (Band Width) × Volatility Scaling
Signal Threshold = Multiple of ATR × Dynamic Volatility Ratio
Confluence = Tension Score + Additional Factors
2. THE 6 SIGNAL TYPES 📊
The system recognizes 6 distinct pattern categories:
A. ELASTIC SIGNALS
Pattern: Price reaches statistical band extremes
Theory: Maximum deviation from mean suggests potential reversion
Detection: Price touches outer zones (typically 2-3× ATR from MA)
Component: Mathematical band extension measurement
Historical Context: Often observed in markets with clear swing patterns
B. WICK SIGNALS
Pattern: Extended rejection wicks on candles
Theory: Failed breakout attempts may indicate directional exhaustion
Detection: Upper/lower wick exceeding 2× body size
Component: Real-time price rejection measurement
Historical Context: Common in volatile conditions with rapid reversals
C. EXHAUSTION SIGNALS
Pattern: Decelerating momentum despite price extension
Theory: Velocity and acceleration divergence may precede reversals
Detection: Decreasing velocity with negative acceleration
Component: Momentum derivative analysis
Historical Context: Often seen at trend maturity points
D. CLIMAX SIGNALS
Pattern: Volume spike at price extreme
Theory: Unusual volume at extremes historically correlates with turning points
Detection: Volume 1.5-2.5× average at band extreme
Component: Volume-price relationship analysis
Historical Context: Associated with institutional activity or capitulation
E. STRUCTURE SIGNALS
Pattern: Fractal pivot formations (swing highs/lows)
Theory: Market structure points have historically acted as support/resistance
Detection: 2-4 bar pivot patterns
Component: Classical technical analysis
Historical Context: Universal across timeframes and markets
F. DIVERGENCE SIGNALS
Pattern: RSI divergence versus price
Theory: Momentum divergence has historically preceded price reversals
Detection: Price makes new extreme but RSI does not
Component: Oscillator divergence detection
Historical Context: Considered a leading indicator in technical analysis
Pattern Confluence:
Historical testing suggests stronger signals when multiple types align:
Elastic + Wick + Volume = Higher confluence score
Elastic + Exhaustion + Divergence = Multiple confirmation factors
Any 3+ types = Increased pattern strength
Note: Past pattern performance does not guarantee future occurrence.
3. REGIME DETECTION 🌍
The system attempts to classify market conditions into three behavioral regimes:
📈 TREND REGIME
Detection Methodology:
text
Efficiency Ratio = Net Movement / Total Movement
Classification: Efficiency > 0.5 AND Volatility < 1.3 → TREND
Characteristics Observed:
Directional price movement
Relatively lower volatility
Defined higher highs/lower lows
Persistent directional momentum
System Response:
Reduces signal frequency
Prioritizes trend-specialist strategies
Applies additional filtering to counter-trend signals
Increases confluence requirements
Educational Note:
In trending conditions, counter-trend mean reversion signals historically have shown reduced reliability. Users may consider additional confirmation when trend regime is detected.
↔️ RANGE REGIME
Detection Methodology:
text
Classification: Efficiency < 0.5 AND Volatility 0.9-1.4 → RANGE
Characteristics Observed:
Oscillating price action
Defined support/resistance zones
Mean-reverting behavior patterns
Relatively balanced directional flow
System Response:
Increases signal frequency
Activates range-specialist strategies
Adjusts bands relative to volatility
Reduces confluence threshold
Educational Note:
Historical backtesting suggests mean reversion systems have performed better in ranging conditions. This does not guarantee future performance.
🌊 VOLATILE REGIME
Detection Methodology:
text
Classification: DVS (Dynamic Volatility Scaling) > 1.5 → VOLATILE
Characteristics Observed:
Erratic price swings
Expanded ranges
Elevated ATR readings
Often news or event-driven
System Response:
Activates volatility-specialist strategies
Widens bands automatically
Prioritizes wick rejection signals
Emphasizes volume confirmation
Educational Note:
Volatile conditions historically present both opportunity and increased risk. Wider stops may be appropriate for risk management.
4. GENETIC EVOLUTION EXPLAINED 🧬
The system employs genetic algorithms to optimize parameters - an approach used in computational finance research.
The Evolution Process:
STEP 1: INITIALIZATION
text
Initial State: System creates 4 starter strategies
- Strategy 0: Range-optimized parameters
- Strategy 1: Trend-optimized parameters
- Strategy 2: Volatility-optimized parameters
- Strategy 3: Balanced parameters
Each contains 14 adjustable parameters (genes):
- Band sensitivity
- Extension multiplier
- Wick threshold
- Momentum threshold
- Volume multiplier
- Component weights (elastic, wick, momentum, volume, fractal)
- Target percentage
STEP 2: COMPETITION (Shadow Trading)
text
Early Bars: All strategies generate signals in parallel
- Each tracks hypothetical performance independently
- Simulated P&L, win rate, Sharpe ratio calculated
- No actual trades executed (educational simulation)
- Performance metrics recorded for analysis
STEP 3: FITNESS EVALUATION
text
Fitness Calculation =
0.25 × Win Rate +
0.25 × PnL Score +
0.15 × Drawdown Score +
0.30 × Sharpe Ratio Score +
0.05 × Trade Count Score
With Walk-Forward enabled:
Fitness = 0.60 × Test Score + 0.40 × Train Score
With Speciation enabled:
Fitness adjusted by Diversity Penalty
STEP 4: SELECTION (Tournament)
text
Periodically (default every 50 bars):
- Randomly select 4 active strategies
- Compare fitness scores
- Top 2 selected as "parents"
STEP 5: CROSSOVER (Breeding)
text
Parent 1 Fitness: 0.65
Parent 2 Fitness: 0.55
Weight calculation: 0.65/(0.65+0.55) = 54%
For each parameter:
Child Parameter = (0.54 × Parent1) + (0.46 × Parent2)
Example:
Band Sensitivity: (0.54 × 1.5) + (0.46 × 2.0) = 1.73
STEP 6: MUTATION
text
For each parameter:
if random(0-1) < Mutation Rate (default 0.15):
Add random variation: -12% to +12%
Purpose: Prevents premature convergence
Enables: Discovery of novel parameter combinations
ADAPTIVE MUTATION:
If population fitness converges → Mutation rate × 1.5
(Encourages exploration when diversity decreases)
STEP 7: INSERTION
text
New strategy added to population:
- Assigned unique ID number
- Generation counter incremented
- Begins shadow trading
- Competes with existing strategies
STEP 8: CULLING (Selection Pressure)
text
Periodically (default every 100 bars):
- Identify lowest fitness strategy
- Verify not elite (protected top performers)
- Verify not last of species
- Remove from population
Result: Maintains selection pressure
Effect: Prevents weak strategies from diluting signals
STEP 9: SIGNAL GENERATION LOGIC
text
When determining signals to display:
If Ensemble enabled:
- All strategies cast weighted votes
- Weights based on fitness scores
- Specialists receive boost in matching regime
- Signal generated if consensus threshold reached
If Ensemble disabled:
- Single highest-fitness strategy used
STEP 10: ADAPTATION OBSERVATION
text
Over time: Population characteristics may shift
- Lower-performing strategies removed
- Higher-performing strategies replicated
- Parameters adjust toward observed optima
- Fitness scores generally trend upward
Long-term: Population reaches maturity
- Strategies become specialized
- Parameters optimized for recent conditions
- Performance stabilizes
Educational Context:
Genetic algorithms are a recognized computational method for optimization problems. This implementation applies those concepts to trading parameter optimization. Past optimization results do not guarantee future performance.
5. SPECIATION (Niche Specialization) 🐟🦎🦅
Inspired by biological speciation theory applied to algorithmic trading.
The Three Species:
RANGE SPECIALISTS 📊
text
Optimized for: Sideways market conditions
Parameter tendencies:
- Tighter bands (1.0-1.5× ATR)
- Higher sensitivity to elastic stretch
- Emphasis on fractal structure
- More frequent signal generation
Typically emerge when:
- Range regime detected
- Clear support/resistance present
- Mean reversion showing historical success
Historical backtesting observations:
- Win rates often in 55-65% range
- Smaller reward/risk ratios (0.5-1.5R)
- Higher trade frequency
TREND SPECIALISTS 📈
text
Optimized for: Directional market conditions
Parameter tendencies:
- Wider bands (2.0-2.5× ATR)
- Focus on momentum exhaustion
- Emphasis on divergence patterns
- More selective signal generation
Typically emerge when:
- Trend regime detected
- Strong directional movement observed
- Counter-trend exhaustion signals sought
Historical backtesting observations:
- Win rates often in 40-55% range
- Larger reward/risk ratios (1.5-3.0R)
- Lower trade frequency
VOLATILITY SPECIALISTS 🌊
text
Optimized for: High-volatility conditions
Parameter tendencies:
- Expanded bands (1.5-2.0× ATR)
- Priority on wick rejection patterns
- Strong volume confirmation requirement
- Very selective signals
Typically emerge when:
- Volatile regime detected
- High DVS ratio (>1.5)
- News-driven or event-driven conditions
Historical backtesting observations:
- Win rates often in 50-60% range
- Variable reward/risk ratios (1.0-2.5R)
- Opportunistic trade timing
Species Protection Mechanism:
text
Minimum Per Species: Configurable (default 2)
If Range specialists = 1:
→ Preferential spawning of Range type
→ Protection from culling process
Purpose: Ensures coverage across regime types
Theory: Markets cycle between behavioral states
Goal: Prevent extinction of specialized approaches
Fitness Sharing:
text
If Species has 4 members:
Individual Fitness × 1 / (4 ^ 0.3)
Individual Fitness × 0.72
Purpose: Creates pressure toward species diversity
Effect: Prevents single approach from dominating population
Educational Note: Speciation is a theoretical framework for maintaining strategy diversity. Past specialization performance does not guarantee future regime classification accuracy or signal quality.
6. WALK-FORWARD VALIDATION 📈
An out-of-sample testing methodology used in quantitative research to reduce overfitting risk.
The Overfitting Problem:
text
Hypothetical Example:
In-Sample Backtest: 85% win rate
Out-of-Sample Results: 35% win rate
Explanation: Strategy may have optimized to historical noise
rather than repeatable patterns
Walk-Forward Methodology:
Timeline Structure:
text
┌──────────────────────────────────────────────────────┐
│ Train Window │ Test Window │ Train │ Test │
│ (200 bars) │ (50 bars) │ (200) │ (50) │
└──────────────────────────────────────────────────────┘
In-Sample Out-of-Sample IS OOS
(Optimize) (Validate) Cycle 2...
TRAIN PHASE (In-Sample):
text
Example Bars 1-200: Strategies optimize parameters
- Performance tracked
- Not yet used for primary fitness
- Learning period
TEST PHASE (Out-of-Sample):
text
Example Bars 201-250: Strategies use optimized parameters
- Performance tracked separately
- Validation period
- Out-of-sample evaluation
FITNESS CALCULATION EXAMPLE:
text
Train Win Rate: 65%
Test Win Rate: 58%
Composite Fitness:
= (0.40 × 0.65) + (0.60 × 0.58)
= 0.26 + 0.35
= 0.61
Note: Test results weighted 60%, Train 40%
Theory: Out-of-sample may better indicate forward performance
OVERFIT DETECTION MECHANISM:
text
Gap = Train WR - Test WR = 65% - 58% = 7%
If Gap > Overfit Threshold (default 25%):
Fitness Penalty = Gap × 2
Example with 30% gap:
Strategy shows: Train 70%, Test 40%
Gap: 30% → Potential overfit flagged
Penalty: 30% × 2 = 60% fitness reduction
Result: Strategy likely to be culled
WINDOW ROLLING:
text
Example Bar 250: Test window complete
→ Reset both windows
→ Start new cycle
→ Previous results retained for analysis
Cycle Count increments
Historical performance tracked across multiple cycles
Educational Context:
Walk-forward analysis is a recognized approach in quantitative finance research for evaluating strategy robustness. However, past out-of-sample performance does not guarantee future results. Market conditions can change in ways not represented in historical data.
7. CLUSTER ANALYSIS 🔬
An unsupervised machine learning approach for pattern recognition.
The Concept:
text
Scenario: System identifies a price pivot that wasn't signaled
→ Extract pattern characteristics
→ Store features for analysis
→ Adjust detection for similar future patterns
Implementation:
STEP 1: FEATURE EXTRACTION
text
When significant move occurs without signal:
Extract 5-dimensional feature vector:
Feature Vector =
Example:
Observed Pattern:
STEP 2: CLUSTER ASSIGNMENT
text
Compare to existing cluster centroids using distance metric:
Cluster 0:
Cluster 1: ← Minimum distance
Cluster 2:
...
Assign to nearest cluster
STEP 3: CENTROID UPDATE
text
Old Centroid 1:
New Pattern:
Decay Rate: 0.95
Updated Centroid:
= 0.95 × Old + 0.05 × New
= Exponential moving average update
=
STEP 4: PROFIT TRACKING
text
Cluster Average Profit (hypothetical):
Old Average: 2.5R
New Observation: 3.2R
Updated: 0.95 × 2.5 + 0.05 × 3.2 = 2.535R
STEP 5: LEARNING ADJUSTMENT
text
If Cluster Average Profit > Threshold (e.g., 2.0R):
Cluster Learning Boost += increment (e.g., 0.1)
(Maximum cap: 2.0)
Effect: Future signals resembling this cluster receive adjustment
STEP 6: SCORE MODIFICATION
text
For signals matching cluster characteristics:
Base Score × Cluster Learning Boost
Example:
Base Score: 5.2
Cluster Boost: 1.3
Adjusted Score: 5.2 × 1.3 = 6.76
Result: Pattern more likely to generate signal
Cluster Interpretation Example:
text
CLUSTER 0: "High elastic, low volume"
Centroid:
Avg Profit: 3.5R (historical backtest)
Interpretation: Pure elastic signals in ranges historically favorable
CLUSTER 1: "Wick rejection, volatile"
Centroid:
Avg Profit: 2.8R (historical backtest)
Interpretation: Wick signals in volatility showed positive results
CLUSTER 2: "Exhaustion divergence"
Centroid:
Avg Profit: 4.2R (historical backtest)
Interpretation: Momentum exhaustion in trends performed well
Learning Progress Metrics:
text
Missed Total: 47
Clusters Updated: 142
Patterns Learned: 28
Interpretation:
- System identified 47 significant moves without signals
- Clusters updated 142 times (incremental refinement)
- Made 28 parameter adjustments
- Theoretically improving pattern recognition
Educational Note: Cluster analysis is a recognized machine learning technique. This implementation applies it to trading pattern recognition. Past cluster performance does not guarantee future pattern profitability or accurate classification.
8. ENSEMBLE VOTING 🗳️
A collective decision-making approach common in machine learning.
The Wisdom of Crowds Concept:
text
Single Model:
- May have blind spots
- Subject to individual bias
- Limited perspective
Ensemble of Models:
- Blind spots may offset
- Biases may average out
- Multiple perspectives considered
Implementation:
STEP 1: INDIVIDUAL VOTES
text
Example Bar 247:
Strategy 0 (Range): LONG (fitness: 0.65)
Strategy 1 (Trend): FLAT (fitness: 0.58)
Strategy 2 (Volatile): LONG (fitness: 0.52)
Strategy 3 (Balanced): SHORT (fitness: 0.48)
Strategy 4 (Range): LONG (fitness: 0.71)
Strategy 5 (Trend): FLAT (fitness: 0.55)
STEP 2: WEIGHT CALCULATION
text
Base Weight = Fitness Score
If strategy's species matches current regime:
Weight × Specialist Boost (configurable, default 1.5)
If strategy has recent positive performance:
Weight × Recent Performance Factor
Example for Strategy 0:
Base: 0.65
Range specialist in Range regime: 0.65 × 1.5 = 0.975
Recent performance adjustment: 0.975 × 1.13 = 1.10
STEP 3: WEIGHTED TALLYING
text
LONG votes:
S0: 1.10 + S2: 0.52 + S4: 0.71 = 2.33
SHORT votes:
S3: 0.48 = 0.48
FLAT votes:
S1: 0.58 + S5: 0.55 = 1.13
Total Weight: 2.33 + 0.48 + 1.13 = 3.94
STEP 4: CONSENSUS CALCULATION
text
LONG %: 2.33 / 3.94 = 59.1%
SHORT %: 0.48 / 3.94 = 12.2%
FLAT %: 1.13 / 3.94 = 28.7%
Minimum Consensus Setting: 60%
Result: NO SIGNAL (59.1% < 60%)
STEP 5: SIGNAL DETERMINATION
text
If LONG % >= Min Consensus:
→ Display LONG signal
→ Show consensus percentage in dashboard
If SHORT % >= Min Consensus:
→ Display SHORT signal
If neither threshold reached:
→ No signal displayed
Practical Examples:
text
Strong Consensus (85%):
5 strategies LONG, 0 SHORT, 1 FLAT
→ High agreement among models
Moderate Consensus (62%):
3 LONG, 2 SHORT, 1 FLAT
→ Borderline agreement
No Consensus (48%):
3 LONG, 2 SHORT, 1 FLAT
→ Insufficient agreement, no signal shown
Educational Note: Ensemble methods are widely used in machine learning to improve model robustness. This implementation applies ensemble concepts to trading signals. Past ensemble performance does not guarantee future signal quality or profitability.
9. THOMPSON SAMPLING 🎲
A Bayesian reinforcement learning technique for balancing exploration and exploitation.
The Exploration-Exploitation Dilemma:
text
EXPLOITATION: Use what appears to work
Benefit: Leverages observed success patterns
Risk: May miss better alternatives
EXPLORATION: Try less-tested approaches
Benefit: May discover superior methods
Risk: May waste resources on inferior options
Thompson Sampling Solution:
STEP 1: BETA DISTRIBUTIONS
text
For each signal type, maintain:
Alpha = Successes + 1
Beta = Failures + 1
Example for Elastic signals:
15 wins, 10 losses
Alpha = 16, Beta = 11
STEP 2: PROBABILITY SAMPLING
text
Rather than using simple Win Rate = 15/25 = 60%
Sample from Beta(16, 11) distribution:
Possible samples: 0.55, 0.62, 0.58, 0.64, 0.59...
Rationale: Incorporates uncertainty
- Type with 5 trades: High uncertainty, wide sample variation
- Type with 50 trades: Lower uncertainty, narrow sample range
STEP 3: TYPE PRIORITIZATION
text
Example Bar 248:
Elastic sampled: 0.62
Wick sampled: 0.58
Exhaustion sampled: 0.71 ← Highest this sample
Climax sampled: 0.52
Structure sampled: 0.63
Divergence sampled: 0.45
Exhaustion type receives temporary boost
STEP 4: SIGNAL ADJUSTMENT
text
If current signal is Exhaustion type:
Score × (0.7 + 0.71 × 0.6)
Score × 1.126
If current signal is other type with lower sample:
Score × (0.7 + sample × 0.6)
(smaller adjustment)
STEP 5: OUTCOME FEEDBACK
text
When trade completes:
If WIN:
Alpha += 1
(Beta unchanged)
If LOSS:
Beta += 1
(Alpha unchanged)
Effect: Shifts probability distribution for future samples
Educational Context:
Thompson Sampling is a recognized Bayesian approach to the multi-armed bandit problem. This implementation applies it to signal type selection. The mathematical optimality assumes stationary distributions, which may not hold in financial markets. Past sampling performance does not guarantee future type selection accuracy.
10. DYNAMIC VOLATILITY SCALING (DVS) 📉
An adaptive approach where parameters adjust based on current vs. baseline volatility.
The Adaptation Problem:
text
Fixed bands (e.g., always 1.5 ATR):
In low volatility environment (vol = 0.5):
Bands may be too wide → fewer signals
In high volatility environment (vol = 2.0):
Bands may be too tight → excessive signals
The DVS Approach:
STEP 1: BASELINE ESTABLISHMENT
text
Calculate volatility over baseline period (default 100 bars):
Method options: ATR / Close, Parkinson, or Garman-Klass
Example average volatility = 1.2%
This represents "normal" for recent conditions
STEP 2: CURRENT VOLATILITY
text
Current bar volatility = 1.8%
STEP 3: DVS RATIO
text
DVS Ratio = Current / Baseline
= 1.8 / 1.2
= 1.5
Interpretation: Volatility currently 50% above baseline
STEP 4: BAND ADJUSTMENT
text
Base Band Width: 1.5 ATR
Adjusted Band Width:
Upper: 1.5 × DVS = 1.5 × 1.5 = 2.25 ATR
Lower: Same
Result: Bands expand 50% to accommodate higher volatility
STEP 5: THRESHOLD ADJUSTMENT
text
Base Thresholds:
Wick: 0.15
Momentum: 0.6
Adjusted:
Wick: 0.15 / DVS = 0.10 (easier to trigger in high vol)
Momentum: 0.6 × DVS = 0.90 (harder to trigger in high vol)
DVS Calculation Methods:
text
ATR RATIO (Simplest):
DVS = (ATR / Close) / SMA(ATR / Close, 100)
PARKINSON (Range-based):
σ = √(∑(ln(H/L))² / (4×n×ln(2)))
DVS = Current σ / Baseline σ
GARMAN-KLASS (Comprehensive):
σ = √(0.5×(ln(H/L))² - (2×ln(2)-1)×(ln(C/O))²)
DVS = Current σ / Baseline σ
ENSEMBLE (Robust):
DVS = Median(ATR_Ratio, Parkinson, Garman_Klass)
Educational Note: Dynamic volatility scaling is an approach to normalize indicators across varying market conditions. The effectiveness depends on the assumption that recent volatility patterns continue, which is not guaranteed. Past volatility adjustment performance does not guarantee future normalization accuracy.
11. PRESSURE KERNEL 💪
A composite measurement attempting to quantify directional force beyond simple price movement.
Components:
1. CLOSE LOCATION VALUE (CLV)
text
CLV = ((Close - Low) - (High - Close)) / Range
Examples:
Close at top of range: CLV = +1.0 (bullish position)
Close at midpoint: CLV = 0.0 (neutral)
Close at bottom: CLV = -1.0 (bearish position)
2. WICK ASYMMETRY
text
Wick Pressure = (Lower Wick - Upper Wick) / Range
Additional factors:
If Lower Wick > Body × 2: +0.3 (rejection boost)
If Upper Wick > Body × 2: -0.3 (rejection penalty)
3. BODY MOMENTUM
text
Body Ratio = Body Size / Range
Body Momentum = Close > Open ? +Body Ratio : -Body Ratio
Strong bullish candle: +0.9
Weak bullish candle: +0.2
Doji: 0.0
4. PATH ESTIMATE
text
Close Position = (Close - Low) / Range
Open Position = (Open - Low) / Range
Path = Close Position - Open Position
Additional adjustments:
If closed high with lower wick: +0.2
If closed low with upper wick: -0.2
5. MOMENTUM CONFIRMATION
text
Price Change / ATR
Examples:
+1.5 ATR move: +1.0 (capped)
+0.5 ATR move: +0.5
-0.8 ATR move: -0.8
COMPOSITE CALCULATION:
text
Pressure =
CLV × 0.25 +
Wick Pressure × 0.25 +
Body Momentum × 0.20 +
Path Estimate × 0.15 +
Momentum Confirm × 0.15
Volume context applied:
If Volume > 1.5× avg: × 1.3
If Volume < 0.5× avg: × 0.7
Final smoothing: 3-period EMA
Pressure Interpretation:
text
Pressure > 0.3: Suggests buying pressure
→ May support LONG signals
→ May reduce SHORT signal strength
Pressure < -0.3: Suggests selling pressure
→ May support SHORT signals
→ May reduce LONG signal strength
-0.3 to +0.3: Neutral range
→ Minimal directional bias
Educational Note: The Pressure Kernel is a custom composite indicator combining multiple price action metrics. These weightings are theoretical constructs. Past pressure readings do not guarantee future directional movement or signal quality.
USAGE GUIDE - EDUCATIONAL EXAMPLES
Getting Started:
STEP 1: Add Indicator
Open TradingView
Add KERS-AGE to chart
Allow minimum 100 bars for initialization
Verify dashboard displays Gen: 1+
STEP 2: Initial Observation Period
text
First 200 bars:
- System is in learning phase
- Signal frequency typically low
- Population evolution occurring
- Fitness scores generally increasing
Recommendation: Observe without trading during initialization
STEP 3: Signal Evaluation Criteria
text
Consider evaluating signals based on:
- Confidence percentage
- Grade assignment (A+, A, B+, B, C)
- Position within bands
- Historical win rate shown in dashboard
- Train vs. Test performance gap
Example Signal Evaluation Checklist:
Educational Criteria to Consider:
Signal appeared (⚡ arrow displayed)
Confidence level meets personal threshold
Grade meets personal quality standard
Ensemble consensus (if enabled) meets threshold
Historical win rate acceptable
Test performance reasonable vs. Train
Price location at band extreme
Regime classification appropriate for strategy
If trending: Signal direction aligns with personal analysis
Stop loss distance acceptable for risk tolerance
Position size appropriate (example: 1-2% account risk)
Note: This is an educational checklist, not trading advice. Users should develop their own criteria based on personal risk tolerance and strategy.
Risk Management Educational Examples:
POSITION SIZING EXAMPLE:
text
Hypothetical scenario:
Account: $10,000
Risk tolerance: 1.5% per trade = $150
Indicated stop distance: 1.5 ATR = $300 per contract
Calculation: $150 / $300 = 0.5 contracts
This is an educational example only, not a recommendation.
STOP LOSS EXAMPLES:
text
System provides stop level (red line)
Typically calculated as 1.5 ATR from entry
Alternative approaches users might consider:
LONG: Below recent swing low
SHORT: Above recent swing high
Users should determine stops based on personal risk management.
TAKE PROFIT EXAMPLES:
text
System provides target level (green line)
Typically calculated as price stretch × 60%
Alternative approaches users might consider:
Scale out: Partial exit at 1R, remainder at 2R
Trailing stop: Adjust stop after profit threshold
Users should determine targets based on personal strategy.
Educational Note: These are theoretical examples for educational purposes. Actual position sizing and risk management should be determined by each user based on their individual risk tolerance, account size, and trading plan.
OPTIMIZATION BY MARKET TYPE - EDUCATIONAL SUGGESTIONS
RANGE-BOUND MARKETS
Suggested Settings for Testing:
Population Size: 6-8
Min Confluence: 5.0-6.0
Min Consensus: 70%
Enable Speciation: Consider enabling
Min Per Species: 2
Theoretical Rationale:
More strategies may provide better coverage
Moderate confluence may generate more signals
Higher consensus may filter quality
Speciation may encourage range specialist emergence
Historical Backtest Observations:
Win rates in testing: Varied, often 50-65% range
Reward/risk ratios observed: 0.5-1.5R
Signal frequency: Relatively frequent
Disclaimer: Past backtesting results do not guarantee future performance.
TRENDING MARKETS
Suggested Settings for Testing:
Population Size: 4-5
Min Confluence: 6.0-7.0
Consider enabling MTF filter
MTF Timeframe: 3-5× current timeframe
Specialist Boost: 1.8-2.0
Theoretical Rationale:
Fewer strategies may adapt faster
Higher confluence may filter counter-trend noise
MTF may reduce counter-trend signals
Specialist boost may prioritize trend specialists
Historical Backtest Observations:
Win rates in testing: Varied, often 40-55% range
Reward/risk ratios observed: 1.5-3.0R
Signal frequency: Less frequent
Disclaimer: Past backtesting results do not guarantee future performance.
VOLATILE MARKETS (e.g., Cryptocurrency)
Suggested Settings for Testing:
Base Length: 25-30
Band Multiplier: 1.8-2.0
DVS: Consider enabling (Ensemble method)
Consider enabling Volume Filter
Volume Multiplier: 1.5-2.0
Theoretical Rationale:
Longer base may smooth noise
Wider bands may accommodate larger swings
DVS may be critical for adaptation
Volume filter may confirm genuine moves
Historical Backtest Observations:
Win rates in testing: Varied, often 45-60% range
Reward/risk ratios observed: 1.0-2.5R
Signal frequency: Moderate
Disclaimer: Cryptocurrency markets are highly volatile and risky. Past backtesting results do not guarantee future performance.
SCALPING (1-5min timeframes)
Suggested Settings for Testing:
Base Length: 15-20
Train Window: 150
Test Window: 30
Spawn Interval: 30
Min Confluence: 5.5-6.5
Consider enabling Ensemble
Min Consensus: 75%
Theoretical Rationale:
Shorter base may increase responsiveness
Shorter windows may speed evolution cycles
Quick spawning may enable rapid adaptation
Higher confluence may filter noise
Ensemble may reduce false signals
Historical Backtest Observations:
Win rates in testing: Varied, often 50-65% range
Reward/risk ratios observed: 0.5-1.0R
Signal frequency: Frequent but filtered
Disclaimer: Scalping involves high frequency trading with increased transaction costs and slippage risk. Past backtesting results do not guarantee future performance.
SWING TRADING (4H-Daily timeframes)
Suggested Settings for Testing:
Base Length: 25-35
Train Window: 300
Test Window: 100
Population Size: 7-8
Consider enabling Walk-Forward
Cooldown: 8-10 bars
Theoretical Rationale:
Longer timeframe may benefit from longer lookbacks
Larger windows may improve robustness testing
More population may increase stability
Walk-forward may be valuable for multi-day holds
Longer cooldown may reduce overtrading
Historical Backtest Observations:
Win rates in testing: Varied, often 45-60% range
Reward/risk ratios observed: 2.0-4.0R
Signal frequency: Infrequent but potentially higher quality
Disclaimer: Swing trading involves overnight and weekend risk. Past backtesting results do not guarantee future performance.
DASHBOARD GUIDE - INTERPRETATION EXAMPLES
Reading Each Section:
HEADER:
text
🧬 KERS-AGE EVOLVED 📈 TREND
Regime indication:
Color coding suggests current classification
(Green = Range, Orange = Trend, Purple = Volatile)
POPULATION:
text
Pop: 6/6
Gen: 42
Interpretation:
- Population at target size
- System at generation 42
- May indicate mature evolution
SPECIES (if enabled):
text
R:2 T:3 V:1
Interpretation:
- 2 Range specialists
- 3 Trend specialists
- 1 Volatility specialist
In TREND regime this distribution may be expected
WALK-FORWARD (if enabled):
text
Phase: 🧪 TEST
Cycles: 5
Train: 65%
Test: 58%
Considerations:
- Currently in test phase
- Completed 5 full cycles
- 7% performance gap between train and test
- Gap under default 25% overfit threshold
ENSEMBLE (if enabled):
text
Vote: 🟢 LONG
Consensus: 72%
Interpretation:
- Weighted majority voting LONG
- 72% agreement level
- Exceeds default 60% consensus threshold
SELECTED STRATEGY:
text
ID:23
Trades: 47
Win%: 58%
P&L: +8.3R
Fitness: 0.62
Information displayed:
- Strategy ID 23, Trend specialist
- 47 historical simulated trades
- 58% historical win rate
- +8.3R historical cumulative reward/risk
- 0.62 fitness score
Note: These are historical simulation metrics
SIGNAL QUALITY:
text
Conf: 78%
Grade: B+
Elastic: ████████░░
Wick: ██████░░░░
Momentum: ███████░░░
Pressure: ███████░░░
Information displayed:
- 78% confluence score
- B+ grade assignment
- Elastic component strongest
- Visual representation of component strengths
LEARNING (if enabled):
text
Missed: 47
Learned: 28
Interpretation:
- System identified 47 moves without signals
- 28 pattern adjustments made
- Suggests ongoing learning process
POSITION:
text
POS: 🟢 LONG
Score: 7.2
Current state:
- Simulated long position active
- 7.2 confluence score
- Monitor for potential exit signal
Educational Note: Dashboard displays are for informational and educational purposes. All performance metrics are historical simulations and do not represent actual trading results or future expectations.
FREQUENTLY ASKED QUESTIONS - EDUCATIONAL RESPONSES
Q: Why aren't signals showing?
A: Several factors may affect signal generation:
System may still be initializing (check Gen: counter)
Confluence score may be below threshold
Ensemble consensus (if enabled) may be below requirement
Current regime may naturally produce fewer signals
Filters may be active (volume, noise reduction)
Consider adjusting settings or allowing more time for evolution.
Q: The win rate seems low compared to backtesting?
A: Consider these factors:
First 200 bars typically represent learning period
Focus on TEST % rather than TRAIN % for realistic expectations
Trend regime historically shows 40-55% win rates in backtesting
Different market conditions may affect performance
System emphasizes reward/risk ratio alongside win rate
Past performance does not guarantee future results
Q: Should I take all signals?
A: This is a personal decision. Some users may consider:
Taking higher grades (A+, A) in any regime
Being more selective in trend regimes
Requiring higher ensemble consensus
Only trading during specific regimes
Paper trading extensively before live trading
Each user should develop their own signal selection criteria.
Q: Signals appear then disappear?
A: This may be expected behavior:
Default requires 2-bar persistence
Designed to filter brief spikes
Confirmation delay intended to reduce false signals
Wait for persistence requirement to be met
This is an intentional feature, not a malfunction.
Q: Test % much lower than Train %?
A: This may indicate:
Overfit detection system functioning
Gap exceeding threshold triggers penalty
Strategy may be optimizing to in-sample noise
System designed to cull such strategies
Walk-forward protection working as intended
This is a safety feature to reduce overfitting risk.
Q: The population keeps culling strategies?
A: This is part of normal evolution:
Lower-performing strategies removed periodically
Higher-performing strategies replicate
Population quality theoretically improves over time
Total culled count shows selection pressure
This is expected evolutionary behavior.
Q: Which timeframe works best?
A: Backtesting suggests 15min to 4H may be suitable ranges:
Lower timeframes may be noisier, may need more filtering
Higher timeframes may produce fewer signals
Extensive historical testing recommended for chosen asset
Each asset may behave differently
Consider paper trading across multiple timeframes
Personal testing is recommended for your specific use case.
Q: Does it work on all asset types?
A: Historical testing suggests:
Cryptocurrency: Consider longer Base Length (25-30) due to volatility
Forex: Standard settings may be appropriate starting point
Stocks: Standard settings, possibly smaller population (4-5)
Indices: Trend-focused settings may be worth testing
Each asset class has unique characteristics. Extensive testing recommended.
Q: Can settings be changed after initialization?
A: Yes, but considerations:
Population will reset
Strategies restart evolution
Learning progress resets
Consider testing new settings on separate chart first
May want to compare performance before committing
Settings changes restart the evolutionary process.
Q: Walk-Forward enabled or disabled?
A: Educational perspective:
Walk-Forward adds out-of-sample validation
May reduce overfitting risk
Results may be more conservative
Considered best practice in quantitative research
Requires more bars for meaningful data
Recommended for those concerned about robustness
Individual users should assess based on their needs.
Q: Ensemble mode or single strategy?
A: Trade-offs to consider:
Ensemble approach:
Requires consensus threshold
May have higher consistency
Typically fewer signals
Multiple perspectives considered
Single strategy approach:
More signals (varying quality)
Faster response to conditions
Higher variability
More active signal generation
Personal preference and risk tolerance should guide this choice.
ADVANCED CONSIDERATIONS
Evolution Time: Consider allowing 200+ bars for population maturity
Regime Awareness: Historical performance varies by regime classification
Confluence Range: Testing suggests 70-85% may be informative range
Ensemble Levels: 80%+ consensus historically associated with stronger agreement
Out-of-Sample Focus: Test performance may be more indicative than train performance
Learning Metrics: "Learned" count shows pattern adjustment over time
Pressure Levels: >0.4 pressure historically added confirmation
DVS Monitoring: >1.5 DVS typically widens bands and affects frequency
Species Balance: Healthy distribution might be 2-2-2 or 3-2-1, avoid 6-0-0
Timeframe Testing: Match to personal trading style, test thoroughly
Volume Importance: May be more critical for stocks/crypto than forex
MTF Utility: Historically more impactful in trending conditions
Grade Significance: A+ in trend regime historically rare and potentially significant
Risk Parameters: Standard risk management suggests 1-2% per trade maximum
Stop Levels: System stops are pre-calculated, widening may affect reward/risk
THEORETICAL FOUNDATIONS
Genetic Algorithms in Finance:
Traditional Optimization Approaches:
Grid search: Exhaustive but computationally expensive
Gradient descent: Efficient but prone to local optima
Random search: Simple but inefficient
Genetic Algorithm Characteristics:
Explores parameter space through evolutionary process
Balances exploration (mutation) and exploitation (selection)
Mitigates local optima through population diversity
Parallel evaluation via population approach
Inspired by biological evolution principles
Academic Context: Genetic algorithms are studied in computational finance literature for parameter optimization. Effectiveness varies based on problem characteristics and implementation.
Ensemble Methods in Machine Learning:
Single Model Limitations:
May overfit to specific patterns
Can have blind spots in certain conditions
May be brittle to distribution shifts
Ensemble Theoretical Benefits:
Variance reduction through averaging
Robustness through diversity
Improved generalization potential
Widely used (Random Forests, Gradient Boosting, etc.)
Academic Context: Ensemble methods are well-studied in machine learning literature. Performance benefits depend on base model diversity and correlation structure.
Walk-Forward Analysis:
Alternative Approaches:
Simple backtest: Risk of overfitting to full dataset
Single train/test split: Limited validation
Cross-validation: May violate time-series properties
Walk-Forward Characteristics:
Continuous out-of-sample validation
Respects temporal ordering
Attempts to detect strategy degradation
Used in quantitative trading research
Academic Context: Walk-forward analysis is discussed in quantitative finance literature as a robustness check. However, it assumes future regimes will resemble recent test periods, which is not guaranteed.
FINAL EDUCATIONAL SUMMARY
KERS-AGE demonstrates an adaptive systems approach to technical analysis. Rather than fixed rules, it implements:
✓ Evolutionary Optimization: Parameter adaptation through genetic algorithms
✓ Regime Classification: Attempted market condition categorization
✓ Out-of-Sample Testing: Walk-forward validation methodology
✓ Pattern Recognition: Cluster analysis and learning systems
✓ Ensemble Methodology: Collective decision-making framework
✓ Full Transparency: Comprehensive dashboard and metrics
This indicator is an educational tool demonstrating advanced algorithmic concepts.
Critical Reminders:
The system:
✓ Attempts to identify potential reversal patterns
✓ Adapts parameters to changing conditions
✓ Provides multiple filtering mechanisms
✓ Offers detailed performance metrics
Users must understand:
✓ No system guarantees profitable results
✓ Past performance does not predict future results
✓ Extensive testing and validation recommended
✓ Risk management is user's responsibility
✓ Market conditions can change unpredictably
✓ This is educational software, not financial advice
Success in trading requires: Proper education, risk management, discipline, realistic expectations, and personal responsibility for all trading decisions.
For Educational Use
🧬 KERS-AGE Development Team
⚠️ FINAL DISCLAIMER
This indicator and documentation are provided strictly for educational and informational purposes.
NOT FINANCIAL ADVICE: Nothing in this guide constitutes financial advice, investment advice, trading advice, or any recommendation to buy, sell, or hold any security or to engage in any trading strategy.
NO GUARANTEES: No representation is made that any account will or is likely to achieve profits or losses similar to those shown in backtests, examples, or historical data. Past performance is not indicative of future results.
SUBSTANTIAL RISK: Trading stocks, forex, futures, options, and cryptocurrencies involves substantial risk of loss and is not suitable for every investor. The high degree of leverage can work against you as well as for you.
YOUR RESPONSIBILITY: You are solely responsible for your own investment and trading decisions. You should conduct your own research, perform your own analysis, and consult with qualified financial advisors before making any trading decisions.
NO LIABILITY: The developers, contributors, and distributors of this indicator disclaim all liability for any losses or damages, direct or indirect, that may result from use of this indicator or reliance on any information provided.
PAPER TRADE FIRST: Users are strongly encouraged to thoroughly test this indicator in a paper trading environment before risking any real capital.
By using this indicator, you acknowledge that you have read this disclaimer, understand the risks involved in trading, and agree that you are solely responsible for your own trading decisions and their outcomes.
Educational Software Only | Trade at Your Own Risk | Not Financial Advice
Taking you to school. — Dskyz , Trade with insight. Trade with anticipation.
RunRox - Pairs Screener📊 Pairs Screener is part of our premium suite for pair trading.
This indicator is designed to scan and rank the most profitable and optimal pairs for the Pairs Strategy. The screener can backtest multiple metrics on deep historical data and display results for many pairs against one base asset at the same time.
This allows you to quickly detect market inefficiencies and select the most promising pairs for live trading.
HOW DOES THIS STRATEGY WORK⁉️
The core idea of the strategy is described in detail in our main indicator Pairs Strategy from the same product line.
There you can find a full explanation of the concept, the math behind pair trading, and the internal logic of the engine.
The Pairs Screener is built on top of the same core technology as the main indicator and uses the same internal logic and calculations.
It is designed as a key companion tool to the main strategy: it helps you find tradeable pairs, evaluate current deviations, sort and filter lists of candidates, and much more. All of these features will be described in this post.
✅ KEY FEATURES
More than 400+ assets available for scanning
Forex assets
Crypto assets
Lower Timeframe Backtester Strategy support
Invert signals mode
Hedge Coefficient (position size balancing between both legs)
6 hedge modes
Stop Loss support
Take Profit support
Whitelist with your own custom asset list
Blacklist to exclude unwanted assets
Custom filters
12 tracking metrics for pair evaluation
Customizable alerts
And many other tools for fine-tuning your search
The screener runs backtests simultaneously across a large number of assets and calculates metrics automatically.
This helps you very quickly find pairs with strong structural relationships or current inefficiencies that can be used as the basis for your pair trading strategies.
⚙️ MAIN SETTINGS
The first section controls the core parameters of the screener: Score, correlation, asset groups for scanning, and other base settings. All major crypto and forex symbols are embedded directly into the screener.
Since there are more than 400 assets, it is technically impossible to analyze everything at once, so we grouped them into batches of 40 assets per group.
The workflow is simple:
Open the chart of the asset you want to use as the base ticker.
In the screener settings choose the market (Crypto or Forex).
Select a Group (for example, Group 1) and the indicator will scan all assets inside that group against your base ticker.
Then you switch to Group 2, Group 3, etc., and repeat the scan.
Embedded universe:
400+ assets total
350+ Crypto – split into 10 groups
70+ Forex – split into 3 groups
Below is a description of each setting.
🔸 Exclude Dates
Allows you to specify a period that should be excluded from analysis.
Useful for removing abnormal spikes, news events, or any non-typical segments that distort the statistics for your pairs.
🔸 Market
Defines which universe will be used to build pairs with the current main asset:
Crypto – 350+ crypto symbols
Forex – 70+ FX symbols
Whitelist – your own custom list of assets
🔸 Group
Selects the asset group to scan.
As mentioned above, assets are split into groups of about 40 instruments:
350+ Crypto → 10 groups
70+ Forex → 3 groups
The screener will calculate all metrics only for the group you select.
🔸 Lower Timeframe
This option enables deep history analysis.
Each TradingView plan has a limit on the number of visible bars (for example, 5,000 bars on the basic plan). In standard mode you would only get statistics for the last 5,000 bars of your current timeframe.
If you want a deeper backtest on a lower timeframe, you can do the following:
Suppose your target timeframe for analysis is 5 minutes.
Switch your chart to a 30-minute timeframe.
Enable Lower Timeframe in the indicator.
Select 5 minutes as the lower timeframe inside the screener.
In this mode the screener can reconstruct and analyze up to 99,000 bars of data for your assets. This allows you to evaluate pairs on a much deeper history and see whether the results are stable over a larger sample.
🔸 Method
Here you choose the deviation model:
preferred Z-Score or S-Score for your analysis,
plus you can enable Invert to search for negatively correlated pairs and calculate their profit correctly.
🔸 Period
This is the lookback period for Z/S Score.
It defines how many bars are used to calculate the deviation metric for each pair.
🔸 Correlation Period
This is the number of bars used to calculate correlation between the base asset and each candidate in the group.
The resulting correlation value is also displayed in the results table.
🔀 HEDGE COEFFICIENT
The next block of settings is related to the hedge coefficient.
This defines how much margin is allocated to each leg of the pair.
The classic approach in pair trading is to split the position equally between both assets.
For example, if you allocate 100 USD to a trade , the standard model would open 50 USD long on one asset and 50 USD short on the other.
This works well for pairs with similar volatility , such as BTCUSDT / ETHUSDT
However, if you use a pair like BTCUSDT / DOGEUSDT , the volatility of these assets is very different.
They can still be correlated, but their amplitude is not the same. While Bitcoin might move 2% , Dogecoin can move 10% over the same period.
Because of that, for pairs with strongly different volatility, we can use a hedge coefficient and, for example, enter with 30 USD on one leg and 70 USD on the other, taking the volatility difference into account.
This is the main idea behind the Hedge Coefficient section and its primary use.
The indicator includes 6 methods of calculating the coefficient:
Cumulative RMA
Beta OLS
Beta TLS
Beta EMA
RMA Range
RMA Delta
Each method uses a different formula to compute the hedge coefficient and to size the position based on different metrics of the assets.
We leave it to the trader to decide which algorithm works best for their specific pair and style.
Below are the settings inside this section:
🔹 Method
When Auto Hedge is enabled, you can select which method to use from the list above.
The chosen method will automatically calculate the hedge coefficient between the two legs.
🔹 Hedge Coefficient
This is the manual hedge ratio per trade when Auto Hedge is disabled.
By default it is set to 1, which means the position is opened 50/50 between the two assets.
🔹 Min Allowed Hedge Coef.
This is the minimum allowed hedge coefficient.
By default it is 0.2, which means the model will not go below a 20% / 80% split between the legs.
🔹 MA Length
For methods that use moving averages (for example Beta EMA), this parameter sets the period used to calculate the hedge coefficient.
💰 STRATEGY SETTINGS
This section defines the base backtesting settings for all assets in the screener.
Here you configure entries, exits, Stop Loss, and other parameters used to find the most optimal pairs for your strategy. 🔸 Commission %
In this field you set your broker’s fee percentage per trade.
The indicator automatically calculates the correct commission for each leg of every trade. You only need to input the real commission rate that your broker charges for volume. No additional manual calculations are required.
🔸 Qty $
The margin amount used for backtesting across all assets in the screener.
This margin is split between both legs of the pair either equally or according to the selected hedge coefficient.
🔸 Entry
The Z/S Score deviation level at which the backtest opens a trade for each pair.
🔸 Exit
The Z/S Score level at which the backtest closes trades for the tested assets.
🔸 Stop Loss
PnL threshold at which a trade is force-closed during the historical test.
🔸 Cooldown
Number of bars the strategy will wait after a Stop Loss before opening the next trade.
This block gives you flexible control over how your strategy is tested on 400+ assets, helping you standardize the rules and compare pairs under the exact same conditions.
🗒️ WHITELIST
In this section you can define your own custom list of assets for monitoring and backtesting.
This is useful if you want to work with symbols that are not included in the built-in lists, such as exotic crypto from smaller exchanges, specific stocks, or any custom universe 🔹 Exchange Prefix
Enter the exchange prefix used for your tickers.
Example: BINANCE, OANDA, etc.
🔹 Ticker Postfix
Enable this option if the tickers require a postfix.
Example 1: .P for Binance Futures perpetual contracts.
Example 2: USDT if you only provide the base asset in the ticker list.
🔹 Ticker List
Enter a comma-separated list of tickers to analyze.
Example 1: BTCUSDT, ETHUSDT, BNBUSDT (when the exchange prefix is set).
Example 2: BTC, ETH, BNB (when using postfix USDT).
Example 3: BINANCE:BTCUSDT.P, OANDA:EURUSD (when different exchanges are used and the prefix option is disabled).
This gives you full flexibility to build a screener universe that matches exactly the assets you trade.
⛔ BLACKLIST
In this section you can enable a blacklist of unwanted assets that should be skipped during analysis. Enter a comma-separated list of tickers to exclude from the screener:
Example 1: BTCUSDT, ETHUSDT
Example 2: BTC, ETH (all tickers that contain these symbols will be excluded)
This helps you quickly remove illiquid, noisy, or unwanted instruments from the results without changing your main groups or whitelist.
📈 DASHBOARD
This section controls the results dashboard: table position, style, and sorting logic.
Here is what you can configure:
Result Table – position of the results table on the chart.
Background / Text – colors and opacity for the table background and text.
Table Size – overall size of the results table (from 0 to 30).
Show Results – how many rows (pairs) to display in the table.
Sort by (stat) – which metric to use for sorting the results.
Available options: Profit Factor, Profit, Winrate, Correlation, Score.
This lets you quickly focus on the most interesting pairs according to the exact metric that matters most for your strategy.
📎 FILTER SETTINGS
This section lets you filter the results table by metric values.
For example, you can show only pairs with a minimum correlation of 0.8 to focus on more stable relationships. 🔸 Min Correlation
Minimum allowed correlation between the two assets over the selected lookback period.
🔸 Min Score
Minimum absolute Score (Z-Score or S-Score) required to include a pair in the results.
For example, 2.0 means only pairs with Score >= 2.0 or <= -2.0 will be displayed.
🔸 Min Winrate
Minimum win rate percentage for a pair to be included in the table.
🔸 Min Profit Factor
Minimum profit factor required for a pair to stay in the results. These filters help you quickly narrow the list down to pairs that meet your quality criteria and match your risk profile.
📌 COLUMN SELECTION
This section lets you fully customize which metrics are displayed in the results table.
You can enable or hide any column to focus only on the data you need to identify the best pairs for trading. The screener allows you to show up to 12 metrics at the same time, which gives a detailed view of pair quality. Available columns:
🔹 Exchange Prefix
Show the exchange prefix in the ticker.
🔹 Correlation
Correlation between the two assets’ prices over the lookback period.
🔹 Score
Current Score value (Z-Score or S-Score).
On lower timeframe research, Score is not displayed.
🔹 Spread
Shows spread as % change since entry.
Positive value = profit on the main position.
🔹 Unrealized PnL
Shows unrealized PnL as a $ value based on current prices.
🔹 Profit
Total profit from all trades: Gross Profit − Gross Loss.
🔹 Winrate
Percentage of profitable trades out of all executed trades.
🔹 Profit Factor
Gross Profit / Gross Loss.
🔹 Trades
Total number of trades.
🔹 Max Drawdown
Maximum observed loss from peak to trough before a new peak is made.
🔹 Max Loss
Largest loss recorded on a single trade.
🔹 Long/Short Profit
Separate profit/loss for long trades and short trades.
🔹 Avg. Trade Time
Average duration of trades.
All these metrics are designed to help you quickly identify the strongest pairs for your strategy.
You can change colors, opacity, and hide any columns that are not relevant to your workflow.
🔔 ALERT
The alert system in this screener works in a specific way.
Alerts are tied directly to the filters you set in the Filter Settings section:
Minimum Correlation
Minimum Score
Minimum Winrate
Minimum Profit Factor
You can configure alerts to trigger when a new pair appears that matches all your filter conditions. 💡 Example
You set:
Minimum Score = 3
Then you create an alert based on the screener.
When any pair reaches a Score greater than +3 or less than −3, you will receive a notification.
This is how alerts work in this screener.
The idea is to deliver the most relevant information about the current market situation without forcing you to watch the screener all the time.
Supported placeholders for alert messages: {{ticker_1}} – main ticker (the one on the chart).
{{ticker_2}} – the paired ticker listed in the table.
{{corr}} – correlation value.
{{score}} – Score value (Z-Score or S-Score).
{{time}} – bar open time (UTC).
{{timenow}} – alert trigger time (UTC). You can use these placeholders to build alert text or JSON payloads in any format required by your tools.
The screener is designed to significantly enhance your pair trading workflow: it helps you quickly identify working pairs and current market inefficiencies, and with the alert system you can react to opportunities without constantly sitting in front of the screen.
Always remember that past performance does not guarantee future results.
Use the screener data within a risk-controlled trading system and adjust position sizing according to your own risk management rules.
RunRox - Pairs Strategy🧬 Pairs Strategy is a new indicator by RunRox included in our premium subscription.
It is a specialized tool for trading pairs, built around working with two correlated instruments at the same time.
The indicator is designed specifically for pair trading logic: it helps track the relationship between two assets, identify statistical deviations, and generate signals for opening and managing long/short combinations on both legs of the pair.
Below in this description I will go through the core functions of the indicator and the main concepts behind the strategy so you can clearly understand how to apply it in your trading.
📌 CONCEPT
The core idea of pair trading is to find and trade correlated instruments that usually move in a similar way.
When these two assets temporarily diverge from each other, a trading opportunity appears.
In such moments, the relatively overvalued asset is sold (short leg), and the relatively undervalued asset is bought (long leg).
When the spread between them narrows and both instruments revert back toward their typical relationship (mean), the position is closed and the trader captures the profit from this convergence.
In practice, one leg of the pair can end up in a loss while the other generates a larger profit.
Due to the difference in performance between the two assets, the combined result of the pair trade can still be positive.
✅ KEY FEATURES:
2 deviation types (Z-Score and S-Score)
Invert signals mode
Hedge Coefficient (position size balancing between both legs)
6 hedge modes
Entries based on Score or RSI
Extra entries based on Score or Spread
Stop Loss
Take Profit
RSI Filter
RSI Pivot Mode
Built-in Backtester Strategy
Lower Timeframe Backtester Strategy
Live trade panel for current position
Equity curve chart
21 performance metrics in the backtester
2 alert types
*And many more fine-tuning options for pair trading
🔗 SCORE
Score is the core deviation metric between the two assets in the pair.
For example, if you are trading ETHUSDT/BTCUSDT, the indicator analyzes the relationship ETH/BTC, and when one leg temporarily diverges from the other, this difference is reflected in the Score value.
In other words, Score shows how much the current spread between the two instruments deviates from its typical state and is used as the main signal source for pair entries and exits.
In the screenshot above you can see how Score looks in our indicator.
Depending on how large the difference is between the two assets, the Score value can move in a range from −N to +N
When Score is in the −N zone, this is a 🟢 long zone for the first asset and a short zone for the second.
Using the ETH/BTC example: when Score is deeply negative, you open a long on ETH and a short on BTC at the same time, then close both legs when Score returns back to the 0 zone (balance between the two assets).
When Score is in the +N zone, this is a 🔴 short zone for the first asset and a long zone for the second.
In the same ETH/BTC example: when Score is strongly positive, you short ETH and long BTC, and again close both positions when Score comes back to the neutral 0 zone.
☯️ Z/S SCORE
Inside the indicator we added two different formulas for calculating the spread between the two legs of the pair: Z-Score and S-Score.
These approaches measure deviation in different ways and can produce slightly different signals depending on the chosen pair and its behavior.
This allows you to switch between Z-Score and S-Score and choose the method that gives more stable and cleaner signals for your specific instruments.
As you can see in the screenshot above, we used the same pair but applied different Score types to measure the spread and deviation from the norm.
🟣 Z-Score – generated 9 entry signals .
It reacts to price fluctuations more smoothly and usually stays within a range of approximately −8 to +8 .
🟠 S-Score – generated 5 entry signals .
It reacts to price changes more aggressively and produces wider deviations, often reaching −15 to +15 .
This gives traders the choice between a more sensitive but smoother model (Z-Score) and a more selective, stronger-deviation model (S-Score)
⁉️ HOW DOES THE STRATEGY WORK
Here is a basic example of how you can trade this pair trading strategy using our indicator and its signals.
In the classic approach the trade consists of one initial entry and several scale-ins (averaging) if the spread continues to move against the position.
The first entry is opened when Score reaches a standard deviation of −2 or +2.
If price does not revert to the mean and moves further against the position so that Score expands to −3 or +3, the strategy performs the first scale-in.
If Score extends to −4 or +4, a second scale-in is added.
If the spread grows even more and Score reaches −5 or +5, a third scale-in is executed.
In our indicator the number of averaging steps can be up to 4 scale-ins .
After that the position waits until Score returns back to the 0 level , where the whole pair position is closed.
This is the standard model of classical pair trading.
However there are many variations:
using Stop Loss and Take Profit,
exiting earlier or later than the 0 zone,
scaling in not by Score but by Spread, since Score is not linear while Spread is linear,
entering when RSI on both tickers shows opposite extremes, for example RSI 20 on one asset and RSI 80 on the other, and so on.
The number of possible trading styles for this strategy is very large.
We designed the indicator to cover as many of these variations as possible and added flexible tools so you can build your own pair trading logic on top of it.
Below is an example of a classic pair trade with two entries: one main entry and one extra entry (scale-in) .
The pair SUIUSDT / PENGUUSDT shows a high correlation, and on one of the trades the sequence looked like this:
A −2 Score deviation occurred into the long zone and triggered the Main Entry .
🔹 Main Entry
Long SUIUSDT – Margin: 5,000 USD, Entry price: 1.5708
Short PENGUUSDT – Margin: 5,000 USD, Entry price: 0.011793
Price then moved further against the position, Score went deeper into deviation, and the strategy added one extra entry.
🔸 Extra Entry
Long SUIUSDT – Margin: 5,000 USD, Entry price: 1.5938
Short PENGUUSDT – Margin: 5,000 USD, Entry price: 0.012173
The trade was closed when Score reverted back toward the 0 zone (mean reversion of the spread):
❎ Exit
SUIUSDT P&L: −403.34 USD, Exit price: 1.5184
PENGUUSDT P&L: +743.73 USD, Exit price: 0.011089
✅ Total P&L: +340.39 USD
With a total margin of 10,000 USD used per side (20,000 USD combined), this trade yielded around +1.7% on the deployed margin.
On different assets the size and speed of the spread movement will vary, but the principle remains the same.
This is just one example to illustrate how the strategy works in practice using simplified theoretical balances.
⚙️ MAIN SETTINGS
After explaining how the strategy works, we can move to the indicator settings and their logic.
The first block is Main Settings, which controls how the pair is built, how the spread is calculated, and how the backtest is performed.
The core idea of the indicator is to backtest historical data, generate entry signals, show open-position parameters, and provide all necessary metrics for both discretionary and algorithmic trading.
This is a complete framework for analyzing a pair of assets and building a trading system around them. Below I will go through the main parameters one by one.
🔹 Exclude Dates
Allows you to exclude abnormal periods in the pair’s history to remove outlier trades from the backtest.
This is useful when the market experienced extreme news events, listing spikes, or other non-typical situations that distort statistics.
🔹 Pair
Here you select the second asset for your pair.
For example, if your main chart is BTCUSDT, in this field you choose a correlated asset such as ETHUSDT, and the working pair becomes BTCUSDT / ETHUSDT.
The indicator then calculates spread, Score, and all related metrics based on this asset combination.
🔹 Lower Timeframe
This is a special mode for backtesting on a lower timeframe while using a higher timeframe chart to extend the history limit.
For example, if your TradingView plan provides only 5,000 bars of history on the current timeframe, you can switch your chart to a higher timeframe and select a lower timeframe in this setting.
The indicator will then reconstruct the pair logic using up to 99,000 bars of lower timeframe data for backtesting.
This allows you to test the pair on a much longer historical period and find more stable combinations of assets.
🔹 Method
Here you choose which deviation model you want to use: Z-Score or S-Score.
Both methods calculate spread deviation but use different formulas, which can give different signal behavior depending on the pair.
Examples of these two methods are shown earlier in this description.
🔹 Period
This parameter defines how many bars are used to calculate the average deviation for the pair.
If you set Period = 300, the indicator looks back 300 bars and calculates the typical spread deviation over that window.
For example, if the average deviation over 300 bars is around 1%, then a move to 2% or more will push Z/S Score closer to its boundary levels, since such a deviation is considered abnormal for that lookback period.
A larger Period means that only bigger deviations will be treated as anomalies.
A smaller Period makes the model more sensitive and treats smaller deviations as anomalies.
This allows you to tune how aggressive or conservative your pair trading signals should be.
🔹 Invert
This setting is used for negatively correlated pairs.
Some instruments have a positive correlation in the range from +0.8 to +1.0 (strong positive correlation), while others show a negative correlation from −0.8 to −1.0, meaning they usually move in opposite directions.
A classic example is the pair EURUSD and DXY.
As shown in the screenshot above, these instruments often have strong negative correlation due to macro factors and typically move in opposite directions: when EURUSD is rising, DXY is falling, and vice versa.
Such pairs can also be traded with our indicator.
To do this, we use the Invert option, which effectively flips one of the assets (as shown in the screenshot below). After inversion, both instruments are brought to a “same-direction” behavior from the model’s point of view.
From there, you trade the pair in the same way as a positively correlated one:
you open both legs in the same direction (both long or both short) depending on the spread and Score, and then wait for the spread between the inverted pair to converge back toward its mean.
🔀 HEDGE COEFFICIENT
The next block of settings is related to the hedge coefficient.
This defines how much margin is allocated to each leg of the pair.
The classic approach in pair trading is to split the position equally between both assets.
For example, if you allocate 100 USD to a trade , the standard model would open 50 USD long on one asset and 50 USD short on the other.
This works well for pairs with similar volatility , such as BTCUSDT / ETHUSDT
However, if you use a pair like BTCUSDT / DOGEUSDT , the volatility of these assets is very different.
They can still be correlated, but their amplitude is not the same. While Bitcoin might move 2% , Dogecoin can move 10% over the same period.
Because of that, for pairs with strongly different volatility, we can use a hedge coefficient and, for example, enter with 30 USD on one leg and 70 USD on the other, taking the volatility difference into account.
This is the main idea behind the Hedge Coefficient section and its primary use.
The indicator includes 6 methods of calculating the coefficient:
Cumulative RMA
Beta OLS
Beta TLS
Beta EMA
RMA Range
RMA Delta
Each method uses a different formula to compute the hedge coefficient and to size the position based on different metrics of the assets.
We leave it to the trader to decide which algorithm works best for their specific pair and style.
Below are the settings inside this section:
🔹 Method
When Auto Hedge is enabled, you can select which method to use from the list above.
The chosen method will automatically calculate the hedge coefficient between the two legs.
🔹 Hedge Coefficient
This is the manual hedge ratio per trade when Auto Hedge is disabled.
By default it is set to 1, which means the position is opened 50/50 between the two assets.
🔹 Min Allowed Hedge Coef.
This is the minimum allowed hedge coefficient.
By default it is 0.2, which means the model will not go below a 20% / 80% split between the legs.
🔹 MA Length
For methods that use moving averages (for example Beta EMA), this parameter sets the period used to calculate the hedge coefficient.
🛠️ STRATEGY SETTINGS
The next important block is Strategy Settings .
Here you define the core parameters used for backtesting: trading commission, position size, entry / exit logic, Stop Loss, Take Profit, and other rules that describe how you want the strategy to operate.
Below are all parameters with a detailed explanation.
🔸 Commission %
In this field you set your broker’s fee percentage per trade .
The indicator automatically calculates the correct commission for each leg of every trade. You only need to input the real commission rate that your broker charges for volume. No additional manual calculations are required.
🔸 Main Entry Mode
There are two options for the main entry:
Score - This is the primary entry method based on Z/S Score.
When Score reaches the deviation level defined in the settings below, the strategy opens the first position.
For example, if you set “Entry at 2 deviations”, the trade will be opened when Score hits ±2.
RSI Only - Alternative entry method based on RSI divergence between the two assets.
The exact RSI levels are defined in the RSI settings section below.
For example, if you set the entry threshold at 30, then when one asset has RSI below 30 and the second one has RSI above 70, the first entry will be triggered.
🔸 Extra Entries Mode
This defines how scale-ins (averaging) are executed. There are two modes:
Score - Works the same way as the main entry, but for additional entries.
For example, the main entry can be at 2 deviations, the first scale-in at 3, the second at 4, etc.
Spread - This mode uses the Spread (difference between the two assets) starting from the main entry moment.
As the spread continues to widen, the strategy can add extra entries based on spread growth rather than Score.
Since Score is a non-linear metric and Spread is linear, in some configurations averaging by Spread can produce better results than averaging by Score. This is pair- and strategy-dependent. 🔸 Entry parameters
Deviation / Spread threshold
Entry size
Main Entry – first field (deviation / spread), second field (position size)
Entry 2 – first field (deviation / spread), second field (position size)
Entry 3 – first field (deviation / spread), second field (position size)
Entry 4 – first field (deviation / spread), second field (position size)
This allows you to define up to four scaling steps with different triggers and different sizing.
🔸 Exit Level
This parameter defines at what Score level you want to exit the trade.
By default it is 0, which means the backtester closes the position when Score returns to the neutral (0) zone.
You can also use positive or negative values. Example:
Assume your main entry is configured at a 3 deviation.
You can exit at the 0 level, or you can set Exit Level = 2.
If your initial entry was at −3, the position will be closed when Score reaches +2.
If your initial entry was at +3, the position will be closed when Score reaches −2.
This approach can increase the profit per trade due to a larger captured spread, but it may also increase the holding time of the position.
🔸 Stop Loss
Here you define the maximum loss per trade in PnL units.
If a trade reaches the negative PnL value specified in this field and the Stop Loss option is enabled, the indicator will close the trade at a loss.
The Cooldown parameter sets a pause after a losing trade:
the strategy will wait a specified number of bars before opening the next trade.
🔸 Take Profit
Works similar to Stop Loss but for profit targets.
You set the desired PnL value you want to reach.
The trade will be closed when either the Take Profit target is hit or when Score reaches the exit level defined in the settings, whichever occurs first (depending on your configuration).
🔸 Show Qty in currency
When enabled, trade size is displayed in currency (USD) instead of token quantity.
This is useful for quickly understanding position size in monetary terms.
You will see this in the Current Trade panel, which is described later.
🔸 Size Rounding
Controls how many decimal places are used when rounding position size (from 0 to 10 digits after the decimal).
This is also used for the Current Trade panel so you can adjust how detailed or compact the size display should be.
📊 RSI FILTERS
This section is used for additional trade filtering.
RSI can be used in two ways:
as a primary entry signal,
or as an extra filter for entries based on Z/S Score.
If in the Strategy Settings the Main Entry Mode is set to RSI, then RSI becomes the main trigger for opening a position.
In this case a trade is opened when the RSI of the two assets reaches opposite zones.
Example:
If the threshold is set to 30, then:
when one asset has RSI below 30, and
the second asset has RSI above 70 (100 − 30),
the strategy opens the first entry.
All extra entries after that will be executed either by Spread or by Z/S Score, depending on your Extra Entries Mode.
Below are the parameters in this block:
RSI Length – standard RSI period setting.
RSI Pivot Mode – when enabled, RSI is used as an additional filter together with Z/S Score. The indicator looks for a reversal pattern on RSI (pivot behavior). If RSI forms a reversal structure, the trade is allowed to open. If not, the signal is skipped until a proper RSI pivot is formed.
Entry RSI Filter – here you define the RSI thresholds used for RSI-based entries. These are the same boundary levels described in the example above.
Overall, this section helps filter out lower-quality trades using additional RSI conditions or lets you build RSI-only entry logic based on extreme levels.
🎨 MAIN CHART STYLING
This section controls the visual appearance of trades on the main chart.
You can customize how the second asset line is drawn, as well as the icons for entries, scale-ins, and exits, including their size and style.
▫️ Price Line
This is the line that shows the price of the second asset and the relative difference between the two instruments.
You can adjust the line thickness and color to make it more readable on your chart.
▫️ Adjust Price Line by Hedge Coefficient
When this option is enabled, the second asset’s line is normalized by the hedge coefficient.
If you turn it off, the hedge coefficient will not be applied to the second asset’s line, and it will be displayed in raw form.
▫️ Entry Label
Here you can customize how the entry markers look:
choose the color, icon style, and size of the label that marks each trade entry and scale-in on the chart.
▫️ Exit Label
Similarly, you can define the color, icon style, and size of the label used for exits.
This helps visually separate entries and exits and makes it easier to read the trade history directly from the chart.
🎯 INDICATOR PANEL
This section controls the settings of the indicator panel, which works like an oscillator and allows you to visualize multiple metrics in one place.
You can flexibly enable, style, and scale each parameter.
🔹 Score
Displays the main deviation metric between the two assets.
You can customize the color and line thickness of the Score plot.
🔹 Spread
Shows the spread between the two assets.
It starts calculating from the moment the trade is opened.
You can adjust its color and thickness for better visibility.
🔹 Total Profit
Displays the cumulative profit for this pair and strategy as a line that grows (or falls) over time.
Color, opacity, and line thickness can be customized.
🔹 Unrealized PNL
Once a trade is opened, this line shows the current PnL of the active position.
It also lets you see historical drawdowns on the pair.
Color and thickness can be adjusted.
🔹 Released PNL
Shows the realized PnL of each closed trade as bars.
Useful for quickly evaluating the result of every individual trade in the backtest.
🔹 Correlation
Plots the correlation coefficient between the two assets as a graph, so you can visually track how stable or unstable the relationship between them is over time.
🔹 Hedge Coefficient
Shows the hedge coefficient as a line, which helps understand how the model is rebalancing exposure between the two legs depending on their behavior.
For each metric there is also a 📎 Stretch option.
Stretch allows you to compress or expand the scale of a specific line to visually align metrics with different ranges on the same panel and make the chart easier to read.
📈 PROFIT CHART
Since TradingView does not natively support proper backtesting for pair trading, this indicator includes its own profit curve for the pair.
You can visually see how the strategy performed over historical data: whether there were deep drawdowns, abnormal profit spikes, or stable equity growth over time. This makes it much easier to evaluate the quality of the pair and the strategy on history.
In the settings of this section you can flexibly customize how the profit chart is displayed:
labels, position of the panel, padding, and other visual details.
Everything depends on your personal preferences, so we give full control over styling:
you can adjust the look of the profit chart to match your layout or completely hide it from the chart if you do not need it.
📌 CURRENT TRADE
This section controls the current trade table.
When there is an active trade on the chart, the panel displays all key information for the open position:
direction for each ticker (long or short),
required position size for each leg,
entry price for both assets,
and real-time PnL for each leg separately,
so you always have a clear view of the current situation.
The main thing you can do with this table is customize its appearance:
you can change the size, position on the chart, background and text colors, as well as separate coloring for positive / negative PnL and different colors for long and short positions.
📅 BACKTEST RESULTS
The next key block is Backtest Results.
This results table with detailed metrics gives you an extended view of how the pair and strategy perform: win rate, profit factor, long/short breakdown, and more than 20 additional stats that help you evaluate the potential of your setup.
⚠️ First of all, it is important to note ⚠️
past performance does not guarantee future results.
Every trader must keep this in mind and factor these risks into their strategy.
The table shows metrics in three cuts:
All Entries
Main Entries
Extra Entries (scale-ins)
Core metrics:
Profit – total profit for each entry type.
Winrate – win rate for this pair.
Profit Factor – ratio of gross profit to gross loss for the strategy.
Trades – number of trades in the backtest.
Wins – number of winning trades.
Losses – number of losing trades.
Long Profit – profit generated by long positions.
Short Profit – profit generated by short positions.
Longs – total number of long trades.
Shorts – total number of short trades.
Avg. Time – average time spent in a trade.
Additional metrics for a deeper evaluation of the pair:
Correlation – current correlation between the two assets in the pair.
Bars Processed – number of bars used in the analysis.
Max Drawdown – maximum historical drawdown of the strategy.
Biggest Loss – the largest single losing trade in the backtest.
Recommended Hedge – recommended hedge coefficient based on historical behavior.
Max Spread – maximum positive spread observed in history.
Min Spread – maximum negative spread observed in history.
Avg. Max Spread – average of positive extreme spread values (above 0).
Avg. Min Spread – average of negative extreme spread values (below 0).
Avg Positive Spread – average positive spread across all trades (only values above 0).
Avg Negative Spread – average negative spread across all trades (only values below 0).
Current Spread – current spread between the assets when a trade is open.
These metrics together allow you to quickly assess how stable the pair is, how the risk/return profile looks, and whether the strategy parameters are suitable for live trading. You can fully customize this results table to fit your workflow:
hide metrics you don’t need, change colors, opacity, and other visual styles, and reorder the focus of the stats according to your trading style.
This way the backtest block can show only the metrics that matter to you most and remain clean and readable during analysis.
📣 ALERTS
The next section is dedicated to alerts.
Here you can configure all signals you need, both for manual trading and for full automation of this pair trading strategy. This block is designed to cover most practical use cases. The indicator supports two alert modes:
Single Alert – one universal custom alert for all events.
Two Alerts – separate alerts for each ticker so you can receive different messages per asset.
Available alert events:
Main Entry – when the main entry is triggered.
Entry 2 – when the first scale-in is executed.
Entry 3 – when the second scale-in is executed.
Entry 4 – when the third scale-in is executed.
Exit Alert – when the position is closed.
StopLoss Alert – when Stop Loss is hit.
TakeProfit Alert – when Take Profit is hit.
All alerts are fully customizable and support a set of placeholders for building structured messages or JSON payloads.
🔹1 Alert Type
List of supported placeholders: {{event}} – trigger name ('Entry 1', 'Exit').
{{dir_1}} – 'Long' or 'Short' for the main ticker.
{{dir_2}} – 'Long' or 'Short' for the other ticker.
{{action_1}} – 'Buy', 'Sell' or 'Close' for the main ticker.
{{action_2}} – 'Buy', 'Sell' or 'Close' for the other ticker.
{{price_1}} – price for the main ticker.
{{price_2}} – price for the other ticker.
{{qty_1}} – order size for the main ticker.
{{qty_2}} – order size for the other ticker.
{{ticker_1}} – main ticker (e.g. 'BTCUSD').
{{ticker_2}} – other ticker (e.g. 'ETHUSD').
{{time}} – candle open time in UTC.
{{timenow}} – signal time in UTC.
🔹2 Alert Type
List of supported placeholders: {{event}} – trigger name ('Entry 1', 'Exit', 'SL', 'TP').
{{action}} – 'Buy', 'Sell' or 'Close'.
{{price}} – order price.
{{qty}} – order size.
{{ticker}} – ticker (e.g. 'BTCUSD').
{{time}} – candle open time in UTC.
{{timenow}} – signal time in UTC. You can use these placeholders to build any JSON structure or custom alert text required by your trading bot, exchange API, or automation service.
In this post I’ve explained how the indicator works, the core concept behind this pair trading strategy, and shown practical examples of trades together with a detailed breakdown of each unique feature inside the tool.
We have invested a lot of work into building this indicator and we truly hope it will help you trade pair strategies more efficiently and more profitably by giving you structured, strategy-specific information that is difficult to obtain in any other way.
⚠️ Please also remember that past performance does not guarantee future results.
Always evaluate the risks, the robustness of your setup, and your own risk tolerance before entering any position, and make independent, well-considered decisions when using this or any other strategy.
MACD + Divergence Indicator [Dynamic Filter]Title: MACD + Divergence
Description: This is an enhanced momentum analysis suite based on the classic Moving Average Convergence Divergence (MACD). It addresses the common weakness of the standard MACD—false signals during low-volatility consolidation—by integrating a Dynamic Volatility Filter and a Multi-Timeframe (MTF) Dashboard.
The Problem It Solves: Standard MACD indicators often generate "whipsaw" crossovers when the market is ranging (moving sideways). Traders often struggle to identify these consolidation zones until it is too late. This script solves this by calculating a dynamic "Consolidation Zone" based on Standard Deviation, visually warning traders when momentum is too weak to be reliable.
Key Features:
1. Dynamic Consolidation Filter (The Grey Zone)
The script calculates Upper and Lower bands around the MACD line using Standard Deviation (Volatility).
Grey Fill: When the MACD line is inside the grey bands, the market is in a "Squeeze" or low-volatility consolidation. Crossovers in this zone are often lower probability.
Breakout: When the MACD line exits the bands, it indicates a volatility expansion and a potentially stronger trend.
2. Automated Divergence Detection
Automatically scans for both Regular (Reversal) and Hidden (Continuation) divergences between Price and Momentum.
Bullish: Marked with Green lines/labels.
Bearish: Marked with Red lines/labels.
Customization: You can choose to calculate divergence based on the MACD Line or the Histogram via settings.
3. Multi-Timeframe (MTF) Dashboard
A customizable information table (optional) displays the MACD state across 4 different timeframes (e.g., 15m, 1H, 4H, Daily).
It checks for Trend Alignment (e.g., are all timeframes Bullish?) to help you trade in the direction of the higher timeframes.
4. Enhanced Visuals
4-Color Histogram: Visualizes momentum growing (bright) vs. momentum fading (pale) for both bullish and bearish phases.
Line Highlights: The MACD and Signal lines are clearly distinct, with configurable smoothing options (EMA/SMA).
Settings Guide:
Consolidation Filter: Increase the Dynamic Filter Multiplier (Default: 0.5) to widen the grey zone if you want to filter out more noise.
Oscillator Source: Switch between "MACD Line" or "Histogram" for divergence detection depending on your strategy.
Table: You can toggle the dashboard on/off or change its position to fit your chart layout.
Credits: Base MACD logic derived from standard technical analysis concepts. Dynamic filtering logic adapted from volatility band theories.
EURUSD Pre-London Open Range MarkerEURUSD Pre-London Open Range Marker
This script marks the high and low formed in the pre-London open period on EURUSD, and extends those levels forward once London opens.
It is intended as a neutral reference tool for traders who pay attention to time-based structure around the London session.
What it does
Automatically tracks London time, including daylight-saving changes
Identifies the pre-London open range
Plots the high and low of that range
Extends those levels forward from the London open
Displays the range size (pips)
What it does not do
No trade signals
No alerts
No entries, stops, or targets
No performance claims
This script provides structure only. Interpretation and execution are left to the user.
Intended use
This tool is for traders who:
Trade EURUSD
Care about London session behaviour
Prefer simple, time-based reference levels over indicators
Scope and design
Hard-coded for EURUSD
Pre-London open window is fixed and not user-configurable
Built to prioritise consistency and repeatability over flexibility
Additional context
I use this pre-London range as part of a fully documented, rules-based EURUSD trading system focused on risk management and repeatable execution which I have traded for two years.
The strategy itself is not included here.
Disclaimer
This script is provided for educational and reference purposes only.
All trading involves risk. You are responsible for your own decisions.
One-line link
For those interested in how this range is used within a complete, rules-based EURUSD trading system, further documentation is available here:
BTC ETF Average Inflow Cost BasisConcept
Since the historic launch of Bitcoin Spot ETFs on January 11, 2024, institutional flows have become a major driver of price action. This indicator aims to visualize the aggregate Cost Basis (average entry price) of the major Bitcoin ETFs relative to the underlying asset.
It serves as an on-chain proxy for institutional positioning, helping traders identify critical support levels where ETF inflows have historically concentrated.
How it Works
The script aggregates daily volume data from the top Bitcoin ETFs (IBIT, FBTC, ARKB, GBTC, BITB) and compares it against the Bitcoin price (BTCUSDT).
ETF Cost Basis (Pink Line):
This is calculated as a Cumulative Volume-Weighted Average Price (VWAP), anchored specifically to the ETF launch date (Jan 11, 2024).
Formula: It accumulates (BTC Price * Total ETF Volume) and divides it by the Cumulative Total ETF Volume.
This creates a dynamic level representing the "breakeven" price for the aggregate volume traded through these funds.
True Market Mean (Gray Line):
This represents the simple cumulative average of the Bitcoin price since the ETF launch date. It acts as a neutral baseline for the post-ETF market era.
How to Use
Institutional Support: The Cost Basis line often acts as a strong dynamic support level during corrections. When price revisits this level, it suggests the market is returning to the average institutional entry price.
Trend Filter:
Price > Cost Basis: The market is in a net profit state relative to ETF flows (Bullish/Trend continuation).
Price < Cost Basis: The market is in a net loss state (Bearish/Capitulation risk).
Confluence: The intersection of the Cost Basis and the True Market Mean can signal pivotal moments of trend reset.
Features
Data Aggregation: Pulls data from 5 major ETFs via request.security without repainting (using closed bars).
Dashboard: Includes a table in the top-right corner displaying real-time values for Price, Cost Basis, and Market Mean.
Customization: You can toggle individual ETF Moving Averages in the settings (disabled by default due to price scale differences between BTC and ETF shares).
Disclaimer
This tool is for educational purposes only and attempts to estimate institutional cost basis using volume proxies. It does not represent financial advice.
Nifty Hierarchical Macro GuardOverview
The Nifty Hierarchical Macro Guard is a "Market Compass" indicator specifically designed for Indian equity traders. It locks its logic to the Nifty 50 Index (NSE:NIFTY) and applies a strict hierarchy of trend analysis. The goal is simple: prioritize the long-term trend (Monthly/Weekly) to decide if you should even be in the market, then use the short-term trend (Daily) for precise exit timing.
This script ensures you never ignore a macro "crash" signal while trying to trade minor daily fluctuations.
The Color Hierarchy (Priority Logic)
The indicator uses a "Top-Down" filter. Higher timeframe signals override lower timeframe signals:
Level 1: Monthly (Ultra-Macro) — Deep Maroon
Condition: Nifty 10 EMA is below the 20 EMA on the Monthly chart.
Action: This is the highest priority. The background will turn Deep Maroon, overriding all other colors. This is your "Forget Trading" signal. The long-term structural trend is broken.
Level 2: Weekly (Macro Warning) — Dark Red
Condition: Monthly is Bullish, but Nifty 10 EMA is below the 20 EMA on the Weekly chart.
Action: The background turns Dark Red. This indicates a significant macro correction. You should stay out of fresh positions and protect capital.
Level 3: Daily (Tactical) — Light Red / Light Green
Condition: Both Monthly and Weekly are Bullish (Green).
Action: The background will now react to the Daily 10/20 EMA cross.
Light Green: Nifty is healthy; safe for fresh positions.
Light Red: Tactical exit signal. Nifty is seeing short-term weakness; exit positions quickly.
Key Features
Symbol Locked: No matter what stock you are viewing (Reliance, HDFC, Midcaps), the background only reacts to NSE:NIFTY.
Clean Interface: No messy lines or labels on the price chart. The information is conveyed purely through background color shifts.
Customizable: Change the MA types (EMA/SMA) and lengths (e.g., 10/20 or 20/50) in the settings.
Macro Dashboard: A small, transparent table in the top-right corner displays exactly which timeframe is currently controlling the background color.
How to Use for Nifty Strategy
Stay Out: If the chart is Deep Maroon or Dark Red, do not look for "buying the dip." Wait for the macro health to return.
Take Exits: If the background is Light Green and suddenly turns Light Red, it means the Daily Daily 10/20 cross has happened. Exit your Nifty-sensitive positions immediately.
ZAR Sentiment IndexOverview
The ZAR Sentiment Index (ZSI) is a composite macro-financial indicator designed to measure the prevailing risk and carry regime for the South African Rand (ZAR).
The South African Rand is a high-beta emerging market currency that is heavily influenced by:
Global risk sentiment
US dollar strength
Commodity dynamics
Interest-rate differentials
Sovereign risk perceptions
Rather than focusing on price momentum or technical patterns, the ZSI aggregates key macro drivers into a single normalised index, allowing traders and analysts to identify whether the environment is supportive, neutral, or hostile for ZAR exposure.
The indicator is intended as a regime filter, not a trade-entry signal.
Methodology
The ZSI combines six macro- and market-based components that have historically explained a large share of USDZAR and ZAR carry performance.
Each component is standardised using a rolling z-score, allowing variables with different units and frequencies to be combined consistently.
All macroeconomic series are sourced on a daily timeframe and forward-filled, ensuring the indicator functions correctly on daily, weekly, and monthly charts.
Components
1. US Dollar Strength (DXY)
A stronger US dollar is typically negative for emerging market currencies, including ZAR.
Contribution: Negative
Implementation: Negative z-score of DXY
2. Global Risk Sentiment (VIX)
The VIX index is used as a proxy for global risk aversion.
Rising volatility signals risk-off conditions and carry trade vulnerability
Contribution: Negative
Implementation: Negative z-score of VIX
3. Commodity Support (Gold)
South Africa retains a meaningful commodity linkage, particularly to gold.
Stronger gold prices tend to support ZAR through terms-of-trade effects
Contribution: Positive
Implementation: Positive z-score of XAUUSD
Implementation: Positive z-score of XAUUSD
4. Interest Rate Differential (SA 10Y – US 10Y)
The yield spread between South African and US government bonds proxies the compensation investors demand to hold South African assets.
Wider spreads are generally supportive for ZAR
Contribution: Positive
Implementation: Z-score of the SA 10-year minus US 10-year yield spread
5. Sovereign Risk Proxy (Government Debt-to-GDP)
Where sovereign CDS data is unavailable, South Africa Government Debt-to-GDP is used as a structural proxy for sovereign risk.
Rising debt ratios reflect deteriorating fiscal sustainability
Contribution: Negative
Implementation: Negative z-score of Debt-to-GDP
6. Monetary Policy Differential (SARB – Fed)
The carry attractiveness of ZAR is influenced by the policy rate differential between South Africa and the United States.
The South African interbank rate is used as a proxy for the SARB policy stance
The US policy rate is used as the Federal Reserve proxy
Contribution: Positive
Implementation: Z-score of the SARB–Fed rate gap
Index Construction
Each standardized component is weighted (equal weights by default) and aggregated into a single composite score:
Positive values indicate a supportive macro environment for ZAR
Negative values indicate deteriorating conditions
An optional exponential moving average is applied to reduce noise.
Regime Interpretation
Above 0 - Supportive - Macro tailwinds for ZAR; carry conditions favourable
0 to –0.5 - Neutral / Cautious - Range-bound conditions; reduced conviction
–0.5 to –1.0 - Warning - Rising risk; carry trades vulnerable
Below –1.0 - Stress - Elevated probability of sharp USDZAR upside moves
Background shading is used to visually highlight warning and stress regimes.
Practical Applications
USDZAR Analysis
Supportive regimes tend to align with sustained USDZAR downside trends
Warning and stress regimes often precede volatility spikes and sharp reversals
Carry Trade Risk Management
The index helps identify when ZAR carry trades are structurally supported versus vulnerable
Particularly useful for filtering exposure in ZARJPY and EM FX baskets
Macro Context
The ZSI provides macro confirmation or divergence relative to price action
It is most effective when combined with key technical levels and event risk
Timeframe Considerations
The indicator is designed to function across all chart timeframes
Macroeconomic inputs are sourced daily and forward-filled
Daily and weekly charts are recommended for regime analysis
Important Notes
This indicator is not predictive and does not generate trade signals
It measures prevailing macro conditions rather than forecasting price direction
ZAR can remain resilient in mildly negative regimes and volatile in neutral regimes
The strongest signals occur when extreme ZSI readings align with major macro events or key price levels.
Summary
The ZAR Sentiment Index (ZSI) provides a disciplined, transparent framework for understanding the macro forces driving the South African Rand.
By integrating global risk, US dollar dynamics, commodities, interest rate differentials, and sovereign risk into a single normalized measure, the indicator helps traders distinguish between supportive environments, neutral conditions, and genuine risk-off regimes.
Quasimodo (QML) Pattern [Kodexius]Quasimodo (QML) Pattern is a market structure indicator that automatically detects Bullish and Bearish Quasimodo formations using confirmed swing pivots, then visualizes the full structure directly on the chart. The script focuses on the classic liquidity-grab narrative of the QML: a sweep beyond a prior swing (the Head) followed by a decisive market structure break (MSB), leaving behind a clearly defined reaction zone between the Left Shoulder and the Head.
Detection is built on pivot highs and lows, so patterns are evaluated only after swing points are validated. Once a valid 4 pivot sequence is identified, the indicator draws the pattern legs, highlights the internal triangle area to emphasize the grab, marks the MSB leg, and projects a QML zone that can be used as a potential area of interest for retests.
This tool is designed for traders who work with structure, liquidity concepts, and reversal/continuation triggers, and who want a clean, repeatable QML visualization without manually marking swings.
🔹 Features
🔸 Confirmed Pivot Based Structure Mapping
The script uses classic built-in pivot logic to detect swing highs and swing lows.
🔸 Automatic Bullish and Bearish QML Detection
The indicator evaluates the most recent 4 pivots and checks for a valid alternating sequence (High-Low-High-Low or Low-High-Low-High). When the sequence matches QML requirements, the script classifies the setup as bullish or bearish:
Bullish logic (structure reversal up):
- Left Shoulder is a pivot Low
- Head is a lower Low than the Left Shoulder (liquidity sweep)
- MSB pivot exceeds the Reaction pivot
Bearish logic (structure reversal down):
- Left Shoulder is a pivot High
- Head is a higher High than the Left Shoulder (liquidity sweep)
- MSB pivot breaks below the Reaction pivot
🔸 Full Pattern Visualization (Legs + Highlighted Core)
When a pattern triggers, the script draws:
Three main legs: Left Shoulder to Reaction, Reaction to Head, Head to MSB
A shaded triangular highlight over the internal structure to make the liquidity-grab shape easy to spot at a glance
🔸 QML Zone Projection
A QML Zone box is drawn using the price range defined between the Left Shoulder and the Head, then extended to the right to remain visible as price develops. This zone is intended to act as a practical reference area for potential retests and reaction planning after MSB confirmation.
🔸 MSB Emphasis
A dotted MSB line is drawn between the Reaction point and the MSB point to visually emphasize the confirmation leg that completes the pattern logic.
🔸 Clean Point Tagging and Directional Labeling
Key points are labeled directly on the chart:
- “LS” at the Left Shoulder
- “Head” at the sweep pivot
- “MSB” at the break pivot
A directional label (“Bullish QML” or “Bearish QML”) is also printed to quickly identify the detected bias.
🔸 Configurable Visual Style
All main visual components are user configurable:
- Bullish and bearish colors
- Line width
- Label size
🔸 Efficient Update Logic
Pattern checks are only performed when a new pivot is confirmed, avoiding unnecessary repeated calculations on every bar. The most recent pattern’s projected elements (zone and label positioning) are updated as new bars print to keep the latest setup readable.
🔹 Calculations
This section summarizes the core logic used for detection and plotting.
1. Pivot Detection (Swing Highs and Lows)
The script relies on confirmed pivots using the user inputs:
Left Bars: how many bars must exist to the left of the pivot
Right Bars: how many bars must exist to the right to confirm it
float ph = ta.pivothigh(leftLen, rightLen)
float pl = ta.pivotlow(leftLen, rightLen)
When a pivot is confirmed, its true bar index is the pivot bar, not the current bar, so the script stores:
bar_index
2. Pivot Storage and History Window
Each pivot is stored as a structured object containing:
- price
- index
- isHigh (true for pivot high, false for pivot low)
A rolling history is maintained (up to 50 pivots) to keep processing stable and memory usage controlled.
3. Sequence Validation (Alternation Check)
The pattern evaluation always uses the latest 4 pivots:
p0: Left Shoulder candidate
p1: Reaction candidate
p2: Head candidate
p3: MSB candidate
Before checking bullish/bearish rules, the script enforces alternating pivot types:
bool correctSequence =
(p0.isHigh != p1.isHigh) and
(p1.isHigh != p2.isHigh) and
(p2.isHigh != p3.isHigh)
This prevents invalid structures like consecutive highs or consecutive lows from being interpreted as QML.
4. Bullish QML Conditions
A bullish QML is evaluated when the Left Shoulder is a Low:
Head must be lower than Left Shoulder (sweep)
MSB must be higher than Reaction (break)
if not p0.isHigh
if p2.price < p0.price and p3.price > p1.price
// Bullish QML confirmed
Interpretation:
p2 < p0 represents the liquidity grab below the prior swing low
p3 > p1 represents the market structure break above the reaction high
5. Bearish QML Conditions
A bearish QML is evaluated when the Left Shoulder is a High:
Head must be higher than Left Shoulder (sweep)
MSB must be lower than Reaction (break)
if p0.isHigh
if p2.price > p0.price and p3.price < p1.price
// Bearish QML confirmed
Interpretation:
p2 > p0 represents the liquidity grab above the prior swing high
p3 < p1 represents the market structure break below the reaction low
6. Drawing Logic (Structure, Highlight, Zone, Labels)
When confirmed, the script draws:
Three connecting legs (LS to Reaction, Reaction to Head, Head to MSB)
A shaded triangle using a transparent “ghost” line to enable filling
A dotted MSB emphasis line between Reaction and MSB
A QML Zone box spanning the LS to Head price range and projecting to the right
Point labels: LS, Head, MSB
A direction label: “Bullish QML” or “Bearish QML”
7. Latest Pattern Extension
To keep the newest setup readable, the script updates the most recently detected pattern by extending its projected elements as new bars print:
QML zone right edge is pushed forward
The main label x position is pushed forward
This keeps the last identified QML zone visible as price evolves, without having to redraw historical patterns on every bar.
FVG Heatmap [Hash Capital Research]FVG Map
FVG Map is a visual Fair Value Gap (FVG) mapping tool built to make displacement imbalances easy to see and manage in real time. It detects 3-candle FVG zones, plots them as clean heatmap boxes, tracks partial mitigation (how much of the zone has been filled), and summarizes recent “fill speed” behavior in a small regime dashboard.
This is an indicator (not a strategy). It does not place trades and it does not publish performance claims. It is a market-structure visualization tool intended to support discretionary or systematic workflows.
What this script detects
Bullish FVG (gap below price)
A bullish FVG is detected when the candle from two bars ago has a high below the current candle’s low.
The zone spans from that prior high up to the current low.
Bearish FVG (gap above price)
A bearish FVG is detected when the candle from two bars ago has a low above the current candle’s high.
The zone spans from the current high up to that prior low.
What makes it useful
Heatmap zones (clean, readable FVG boxes)
Bullish zones plot below price. Bearish zones plot above price.
Partial fill tracking (mitigation progress)
As price trades back into a zone, the script visually shows how much of the zone has been filled.
Mitigation modes (your definition of “filled”)
• Full Fill: price fully trades through the zone
• 50% Fill: price reaches the midpoint of the zone
• First Touch: price touches the zone one time
Optional auto-cleanup
Optionally remove zones once they’re mitigated to keep the chart clean.
Fill-Speed Regime Dashboard
When zones get mitigated, the script records how many bars it took to fill and summarizes the recent environment:
• Average fill time
• Median fill time
• % fast fills vs % slow fills
• Regime label: choppy/mean-revert, trending/displacement, or mixed
How to use
Use FVG zones as structure, not guaranteed signals.
• Bullish zones are often watched as potential support on pullbacks.
• Bearish zones are often watched as potential resistance on rallies.
The fill-speed dashboard helps provide context: fast fills tend to appear in more rotational conditions, while slow fills tend to appear in stronger trend/displacement conditions.
Alerts
Bullish FVG Created
Bearish FVG Created
Notes
FVGs are not guaranteed reversal points. Fill-speed/regime is descriptive of recent behavior and should be treated as context, not prediction. On realtime candles, visuals may update as the bar forms.
Arbitrage Detector [LuxAlgo]The Arbitrage Detector unveils hidden spreads in the crypto and forex markets. It compares the same asset on the main crypto exchanges and forex brokers and displays both prices and volumes on a dashboard, as well as the maximum spread detected on a histogram divided by four user-selected percentiles. This allows traders to detect unusual, high, typical, or low spreads.
This highly customizable tool features automatic source selection (crypto or forex) based on the asset in the chart, as well as current and historical spread detection. It also features a dashboard with sortable columns and a historical histogram with percentiles and different smoothing options.
🔶 USAGE
Arbitrage is the practice of taking advantage of price differences for the same asset across different markets. Arbitrage traders look for these discrepancies to profit from buying where it’s cheaper and selling where it’s more expensive to capture the spread.
For begginers this tool is an easy way to understand how prices can vary between markets, helping you avoid trading at a disadvantage.
For advanced traders it is a fast tool to spot arbitrage opportunities or inefficiencies that can be exploited for profit.
Arbitrage opportunities are often short‑lived, but they can be highly profitable. By showing you where spreads exist, this tool helps traders:
Understand market inefficiencies
Avoid trading at unfavorable prices
Identify potential profit opportunities across exchanges
As we can see in the image, the tool consists of two main graphics: a dashboard on the main chart and a histogram in the pane below.
Both are useful for understanding the behavior of the same asset on different crypto exchanges or forex brokers.
The tool's main goal is to detect and categorize spread activity across the major crypto and forex sources. The comparison uses data from up to 19 crypto exchanges and 13 forex brokers.
🔹 Forex or Crypto
The tool selects the appropriate sources (crypto exchanges or forex brokers) based on the asset in the chart. Traders can choose which one to use.
The image shows the prices and volumes for Bitcoin and the euro across the main sources, sorted by descending average price over the last 20 days.
🔹 Dashboard
The dashboard displays a list of all sources with four main columns: last price, average price, volume, and total volume.
All four columns can be sorted in ascending or descending order, or left unsorted. A background gradient color is displayed for the sorted column.
Price and volume delta information between the chart asset and each exchange can be enabled or disabled from the settings panel.
🔹 Histogram
The histogram is excellent for visualizing historical values and comparing them with the asset price.
In this case, we have the Euro/U.S. Dollar daily chart. As we can see, the unusual spread activity detected since 2016, with values at or above 98%, is usually a good indication of increased trader activity, which may result in a key price area where the market could turn around.
By default, the histogram has the gradient and smoothing auto features enabled.
The differences are visible in the chart above. On top is an adaptive moving average with higher values for unusual activity. At the bottom is an exponential moving average with a length of 9.
The differences between the gradient and solid colors are evident. In the first case, the colors are in sync with the data values, becoming more yellow with higher values and more green with lower values. In the second case, the colors are solid and only distinguish data above or below the defined percentiles.
🔶 SETTINGS
Sources: Choose between crypto exchanges, forex brokers, or automatic selection based on the asset in the chart.
Average Length: Select the length for the price and volume averages.
🔹 Percentiles
Percentile Length: Select the length for the percentile calculation, or enable the use of the full dataset. Enabling this option may result in runtime errors due to exceeding the allotted resources.
Unusual % >: Select the unusual percentile.
High % >: Select the high percentile.
Typical % >: Select the typical percentile.
🔹 Dashboard
Dashboard: Enable or disable the dashboard.
Sorting: Select the sorting column and direction.
Position: Select the dashboard location.
Size: Select the dashboard size.
Price Delta: Show the price difference between each exchange and the asset on the chart.
Volume Delta: Show the volume difference between each exchange and the asset on the chart.
🔹 Style
Unusual: Enable the plot of the unusual percentile and select its color.
High: Enable the plot of the high percentile and select its color.
Typical: Enable the plot of the typical percentile and select its color.
Low: Select the color for the low percentile.
Percentiles Auto Color: Enable auto color for all plotted percentiles.
Histogram Gradient: Enable the gradient color for the histogram.
Histogram Smoothing: Select the length of the EMA smoothing for the histogram or enable the Auto feature. The Auto feature uses an adaptive moving average with the data percent rank as the efficiency ratio.
RSI Distribution [Kodexius]RSI Distribution is a statistics driven visualization companion for the classic RSI oscillator. In addition to plotting RSI itself, it continuously builds a rolling sample of recent RSI values and projects their distribution as a forward drawn histogram, so you can see where RSI has spent most of its time over the selected lookback window.
The indicator is designed to add context to oscillator readings. Instead of only treating RSI as a single point estimate that is either “high” or “low”, you can evaluate the current RSI level relative to its own recent history. This makes it easier to recognize when the market is operating inside a familiar regime, and when RSI is pushing into rarer tail conditions that tend to appear during momentum bursts, exhaustion, or volatility expansion.
To complement the histogram, the script can optionally overlay a Gaussian curve fitted to the sample mean and standard deviation. It also runs a Jarque Bera normality check, based on skewness and excess kurtosis, and surfaces the result both visually and in a compact dashboard. On the oscillator panel itself, RSI is presented with a clean gradient line and standard overbought and oversold references, with fills that become more visible when RSI meaningfully extends beyond key thresholds.
🔹 Features
1. Distribution Histogram of Recent RSI Values
The script stores the last N RSI values in an internal sample and uses that rolling window to compute a frequency distribution across a user selected number of bins. The histogram is drawn into the future by a configurable width in bars, which keeps it readable and prevents it from colliding with the active RSI plot. The result is a compact visual summary of where RSI clusters most often, whether it is spending more time near the center, or shifting toward higher or lower regimes.
2. Gaussian Overlay for Shape Intuition
If enabled, a fitted bell curve is drawn on top of the histogram using the sample mean and standard deviation. This overlay is not intended as a direct trading signal. Its purpose is to provide a fast visual comparator between the empirical RSI distribution and a theoretical normal shape. When the histogram diverges strongly from the curve, you can quickly spot skew, heavy tails, or regime changes that often occur when market structure or volatility conditions shift.
3. Jarque Bera Normality Check With Clear PASS/FAIL Feedback
The script computes skewness and excess kurtosis from the RSI sample, then forms the Jarque Bera statistic and compares it to a fixed 95% critical value. When the distribution is closer to normal under this test, the status is marked as PASS, otherwise it is marked as FAIL. This result is displayed in the dashboard and can also influence the histogram styling, giving immediate feedback about whether the recent RSI behavior resembles a bell shaped distribution or a more distorted, regime driven profile.
Jarque Bera is a goodness of fit test that evaluates whether a dataset looks consistent with a normal distribution by checking two shape properties: skewness (asymmetry) and kurtosis (tail heaviness, expressed here as excess kurtosis where a perfect normal has 0). Under the null hypothesis of normality, skewness should be near 0 and excess kurtosis should be near 0. The test combines deviations in both into a single statistic, which is then compared to a chi square threshold. A PASS in this script means the sample does not show strong evidence against normality at the chosen threshold, while a FAIL means the sample is meaningfully skewed, heavy tailed, or both. In practical trading terms, a FAIL often suggests RSI is behaving in a regime where extremes and asymmetry are more common, which is typical during strong trends, volatility expansions, or one sided market pressure. It is still a statistical diagnostic, not a prediction tool, and results can vary with lookback length and market conditions.
4. Integrated Stats Dashboard
A compact table in the top right summarizes key distribution moments and the normality result: Mean, StdDev, Skewness, Kurtosis, and the JB statistic with PASS/FAIL text. Skewness is color coded by sign to quickly distinguish right skew (more time at higher RSI) versus left skew (more time at lower RSI), which can be helpful when diagnosing trend bias and momentum persistence.
5. RSI Visual Quality and Context Zones
RSI is plotted with a gradient color scheme and standard overbought and oversold reference lines. The overbought and oversold areas are filled with a smart gradient so visual emphasis increases when RSI meaningfully extends beyond the 70 and 30 regions, improving readability without overwhelming the panel.
🔹 Calculations
This section summarizes the main calculations and transformations used internally.
1. RSI Series
RSI is computed from the selected source and length using the standard RSI function:
rsi_val = ta.rsi(rsi_src, rsi_len)
2. Rolling Sample Collection
A float array stores recent RSI values. Each bar appends the newest RSI, and if the array exceeds the configured lookback, the oldest value is removed. Conceptually:
rsi_history.push(rsi_val)
if rsi_history.size() > lookback
rsi_history.shift()
This maintains a fixed size window that represents the most recent RSI behavior.
3. Mean, Variance, and Standard Deviation
The script computes the sample mean across the array. Variance is computed as sample variance using (n - 1) in the denominator, and standard deviation is the square root of that variance. These values serve both the dashboard display and the Gaussian overlay parameters.
4. Skewness and Excess Kurtosis
Skewness is calculated from the standardized third central moment with a small sample correction. Kurtosis is computed as excess kurtosis (kurtosis minus 3), so the normal baseline is 0. These two metrics summarize asymmetry and tail heaviness, which are the core ingredients for the Jarque Bera statistic.
5. Jarque Bera Statistic and Decision Rule
Using skewness S and excess kurtosis K, the Jarque Bera statistic is computed as:
JB = (n / 6.0) * (S^2 + 0.25 * K^2)
Normality is flagged using a fixed critical value:
is_normal = JB < 5.991
This produces a simple PASS/FAIL classification suitable for fast chart interpretation.
6. Histogram Binning and Scaling
The RSI domain is treated as 0 to 100 and divided into a configurable number of bins. Bin size is:
bin_size = 100.0 / bins
Each RSI sample maps to a bin index via floor(rsi / bin_size), with clamping to ensure the index stays within valid bounds. The script counts occurrences per bin, tracks the maximum frequency, and normalizes each bar height by freq/max_freq so the histogram remains visually stable and comparable as the window updates.
7. Gaussian Curve Overlay (Optional)
The Gaussian overlay uses the normal probability density function with mu as the sample mean and sigma as the sample standard deviation:
normal_pdf(x) = (1 / (sigma * sqrt(2*pi))) * exp(-0.5 * ((x - mu)/sigma)^2)
For drawing, the script samples x across the histogram width, evaluates the PDF, and normalizes it relative to its peak so the curve fits within the same visual height scale as the histogram.






















