Quantifiable Broadening Formations [STAT TRADING]Broadening Formations v4
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OVERVIEW
Automatically identifies and draws Broadening Formations — expanding price structures that reveal where the market is auctioning both higher and lower to find fair value.
This indicator uses a quantifiable, rule-based approach to detect expansion patterns and dynamically tracks the evolution of price ranges in real-time. No subjective drawing required — the indicator handles everything automatically.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FEATURES
▸ Bar Classification System
Each bar is labeled based on its relationship to the previous bar:
1 = Inside Bar — Range contraction, price stayed within prior bar
2u = Trending Up — Higher high AND higher low
2d = Trending Down — Lower high AND lower low
3 = Outside Bar — Expansion, higher high AND lower low in single bar
C3 = Composite 3 — Multi-bar expansion pattern (2d→2u or 2u→2d completing the range)
Color coding helps identify conviction:
• Green = Bullish structure with bullish close
• Red = Bearish structure with bearish close
• Orange = Conflicted (structure and close disagree)
• Yellow = Outside Bar (3)
• Purple = Composite 3 (C3)
▸ Automatic Formation Detection
The indicator detects when price proves it can take both sides of a range, then:
• Draws dynamic upper and lower boundary lines
• Extends lines forward as projected support/resistance
• Updates the formation in real-time as price makes new highs or lows
• Detects breakouts when price closes through boundaries with conviction
▸ Support/Resistance Test Dots
Visual markers show when price tests the formation boundaries:
• Red dot at high = Price wicked into upper resistance but closed below (failed test)
• Green dot at low = Price wicked into lower support but closed above (held support)
These dots help you see where the market is probing the boundaries before a decisive move.
▸ Breakout & Reclaim Detection
Clear labels mark key events:
• BREAKOUT ↑ = Close above upper boundary (bullish break)
• BREAKOUT ↓ = Close below lower boundary (bearish break)
• RECLAIM ↑ = Failed breakdown, price recovered back into range
• RECLAIM ↓ = Failed breakout, price fell back into range
Reclaims are powerful signals — failed breakouts often lead to strong moves in the opposite direction. The formation automatically expands to include the failed move.
▸ Sub-Formations (Internal Triangles)
White lines show nested formations within larger structures. These internal patterns can provide earlier signals before the major formation resolves.
Sub-formations only appear when they are truly internal to the parent (not touching parent boundaries).
▸ Formation Labels
Each formation is labeled at its trigger point:
• 3 = Triggered by outside bar
• C3 = Triggered by composite pattern
• R1, R2... = Number of reclaims (e.g., "3 R2" = outside bar trigger with 2 reclaims)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS
Show Bar Classification Labels Display 1/2u/2d/3/C3 below each bar
Detect Composite 3s Identify multi-bar expansion patterns
Show Sub/Internal Formations Display nested formations in white
Show Support/Resistance Test Dots Mark boundary tests with colored dots
Show Breakout/Reclaim Labels Label breakouts and reclaims
Major BF Line Color Color for primary formation lines
Sub BF Line Color Color for nested formation lines
Line Width Thickness of formation lines
Bars to Project Forward How far to extend lines into the future
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALERTS
Set alerts for key events:
• Outside Bar (3) — Single-bar expansion detected
• Composite 3 (C3) — Multi-bar expansion pattern detected
• New BF Started — New broadening formation triggered
• BF Break — Price closed through formation boundary
• BF Reclaim — Failed breakout, formation continues with expanded range
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
Understand your position:
Are you near the upper boundary, lower boundary, or mid-range? Context matters.
Watch for closes, not wicks:
Wicks test levels. Closes show conviction. The indicator only triggers breakouts on closes through the boundary.
Pay attention to reclaims:
A break that fails and reclaims often leads to an aggressive move the other direction. The "R" count on the label shows how many times this has happened.
Use test dots for entries:
Multiple red dots at resistance followed by a green bar = potential short setup. Multiple green dots at support followed by a red bar = potential long setup.
Sub-formations give early signals:
When an internal triangle breaks, it can front-run the larger formation's move.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTES
• Works on all timeframes and instruments
• Lines update dynamically as new bars form
• Historical formations are preserved on the chart
• Composite 3s (C3) are shown in purple to distinguish from single-bar triggers
• Best used to understand current market structure — combine with your existing strategy for entries
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Objective structure. No guesswork.
p.s This is a public version in a different language than our true BF identification algorithm. There will be some bugs and it is unlikely we will fix it in the near future.
Statistics
BTC Regime Oscillator (MC + Spread) [1D]ONLY SUPPOSED TO BE USED FOR BTC PERPS, AND SPOT LEVERAGING:
This is a risk oscillator that measures whether Bitcoin’s price is supported by real capital or is running ahead of it, and converts that into a simple risk-regime oscillator.
It's built with market cap, and FDV, and Z-scores compressed to -100 <-> 100
I created this indicator because I got tired of FOMO Twitter and Wall Street games.
DO NOT USE THIS AS A BEGIN-ALL-AND-END-ALL. YOU NEED TO USE THIS AS A CONFIRMATION INDICATOR, AND ON HTF ONLY (1D>) IF YOU USE THIS ON LOWER TIMEFRAMES, YOU ARE FEEDING YOUR MONEY TO A LOW-LIFE DING BAT ON WALL STREET. HERE IS HOW IT WORKS:
This indicator is Split up by
A) Market Cap
--> Represents real money in BTC
--> Ownership capital
--> If MC is rising, money is entering BTC
B) FDV (Fully Diluted Valuation)
--> For BTC: price(21M) (21,000,000)
--> Represents the theoretical valuation
--> Since BTC really has a fixed cap, FDV mostly tracks the price
C) Oscillators
Both MC and FDV are:
--> Logged (to handle scale)
--> Normalized (Z-score)
--> Compressed to -100 <-> 100
HERE ARE THREE THINGS YOU ARE GOING TO SEE ON THE CHART
A) The market cap oscillator (MC OSC)
--> Normalized trend of real capital
RISING: Indicates capital inflow
FALLING: Indicates capital outflow
B) FDV Oscillator
--> Normalized trend of valuation pressure
ABOVE MC: Price is ahead of capital
BELOW MC: Capital is keeping up
!!!! FDV IS CONTEXT NOT SIGNALS !!!!
C) Spread = (FDV - MC)
--> The difference between valuation and capital
(THIS IS THE CORE SIGNAL)
NEGATIVE: Capital is gonna lead price
NEAR 0: Balanced
POSITIVE: Price leads capital
(THIS MEANS STRESS FOR BTC, NOT DILLUTION!)
WHAT DOES -60, 0, 60 MEAN?:
--> These are meant to serve as risk zones, not buy/sell dynamics; this is not the same as an RSI oscillator.
A) 0 level
--> Price and capital are balanced
--> No structural stress
(TRADE WITH NORMAL POSITION SIZE, AND NORMAL EXPECTATIONS)
B) Below -60 (Supportive/Compressed)
--> BTC is relatively cheap to recent history
--> Capital supports price well
(ALWAYS REMEMBER TO CONFIRM THIS WITH WHAT THE CHART IS TELLING YOU)
--> Press trends
--> Use higher ATRs
--> Pullbacks are better here
C) Above 60 (Overextension, or fragile)
--> BTC is expensive relative to recent history
--> Price is ahead of capital
(ALWAYS REMEMBER TO CONFIRM THIS WITH WHAT THE CHART IS TELLING YOU)
--> Reduce leverage, use smaller ATR
--> Use lower ATRs, TP faster
--> Do not chase breakouts
--> Expect volatility and whipsaws
"Can I press trades right now? Or do I need to hog my capital?"
CONDITIONS:
Spread Less than 0 and below -60 = Press trades
Spread near 0 = Normal trading conditions
Spread is Greater than 0 or above 60+ = Capital protection
Volume Analysis🙏🏻 (signed) Volume Analysis is 2 of 2 structural layer / ordeflow analysis scripts, while the first one is Liquidity Analysis. Both are independent so can’t be released together as a single script, but should be used together.
The same math used in this script can be applied to other types of aggressive volume data: non-aggregated flow of market orders, volume traded of put vs call options.
There’s no universal agreement about terminology, but this script works with volumes signed by the aggressor who initiated a transaction. Then these volumes get aggregated by time and a cumulative sum is calculated. Mostly this is widely known as Cumulative Volume Delta.
However this script works with 'inferred' volumes vs the provided ones. It’s the better choice for equities, bonds; neutral choice for currencies; and suboptimal choice for natural and artificial commodities.
Contents:
Output description;
How to analyze & use the outputs;
How to use it together with Liquidity Analysis script;
How did I use both scripts to finish The Leap profitably and skipped many losses.
1. Output description
Color of the CVD line reflects (signed) volume imbalance state: red is negative, purple is neutral, blue is positive.
3 purple lines are lower deviation (lower band), basis (middle band), upper deviation (upper band): used to generate signals by a ruleset that would be explained in a minute
Gray number in the script’s status line is the advised input you may put into Inferred volume multiplier in script’s setting, I will explain it
Vertical dash line marks the moving window end, this way you can be certain over what exact data you see the profile was built.
2. How to analyze & use the outputs
Setup up the script:
Moving window length: set it to ~ ¼ of your data analysis window. E.g if you see on your charts and use ~ 256 bars, set the length to 64.
Inferred volume multiplier: you can easily leave it 256, this is not a critical factor for the math, it’s mostly there if you want to ~ equate inferred volumes with real ones in scale. For this, use the gray number in the script status line, it’s calculated as ratio of long term real volumes weighted avg to long term inferred volumes weighted avg.
Again, changing the inferred volume multiplier won’t affect the math.
Use 2 timeframes: main one and a far lower one 3 steps down, just like on the screenshot.
Find out current volume imbalance state:
As mentioned before, based on CVD line color, it can be negative, neutral or positive. This is the state variable that changes slowly and denies/confirms the signals generated by crossovers of CVD line and 3 purple thresholds.
For this I use my own very fast and lightweight metric that is totally statistically grounded, utilizes temporal information, and calculates volume imbalance without using heavy math like regressions as it’s usually done. It also provides a natural neutral zone, when volume imbalance is not strong enough to be confirmed.
...
CVD-based signals:
First you need to understand what precisely a touch of a threshold is:
Touch: an event when either of these 2 happens:
One CVD datapoint is above the threshold, and the next CVD datapoint is below the threshold
One CVD datapoint is below the threshold, and the next CVD datapoint is above the threshold
These are usually called crossovers/crossunders.
Now with the 3 purple thresholds we follow this logic:
Monitor the last touched threshold;
Once another threshold is touched, here we may generate a signal but only once !, after the first generated signal at that threshold we can’t generate more signals on this threshold, we need to wait when CVD comes to another threshold.
If CVD touches one threshold, and then goes down and touches another threshold downwards, we wait when CVD makes a datapoint above this threshold. When it happens, we register a long signal
If CVD touches one threshold, and then goes up and touches another threshold upwards, we wait when CVD makes a datapoint below this threshold. When it happens, we register a short signal
However, don’t open new trades against the current volume imbalance state. So don’t open shorts when the CDV line is blue, and don’t open longs when CVD line is red.
Btw, this technique I call it “reclaim” of a level/threshold. It can be applied to horizontal levels, and it’s very powerful especially when you fade levels on very volatility assets like BTC. This technique allows you to Not fade a level straight away, but wait when price goes past the level a bit, and then comes back and reclaims it, only there you enter, and moreover you now have a very well defined risk point.
The last part is multi-timeframe logic. Prefer to act when a lower timeframe is Not against the main timeframe. That’s all, no multiple higher timeframes are needed.
3. How to use it together with Liquidity Analysis script.
That script also has a mean to generate its own signals, and another state variable called Liquidity Imbalance.
So now you’re not only looking at volume imbalance but also at liquidity imbalance that would deny/confirm the CVD based signal. You need at least one of these two to favor your long or short.
This is the same logic widely used in HFT, where MM bots cancel/shift/resize orders when book is too onesided And ordeflow is one sided as well.
4. How did I use both scripts to finish The Leap profitably and skipped many losses.
Even tho you can use structural information as your main strategic layer, as many so-called orderflow traders do, I traded in objective style: my fade signals were volatility based in essence, and I used ordeflow for better entries and stops, but most importantly to skip losses.
When ‘both‘ liquidity imbalance and volume imbalance (in their main timeframes) were against my trades, I skipped them all, saving many ~$500 stop losses (that was my basis risk unit for the Leap). Unless I had a very strong objective signal, i.e. confluence of several signals, or just one higher timeframe signal, I did all these skips.
I traded ~ intraweek timeframe, so I was analyzing either the last 230 30min bars or 1380 5min bars. Both Liquidity Analysis and (signed) Volume Analysis scripts were set to moving window length 46 or 276 for either granularity.
I finished the leap with 9% profit and max DD ~ 5%, a bit short of my goal of 12.5%. If not these 2 scripts I would’ve finished a bit above breakeven I think.
,,,
Another thing, I made these 2 scripts invite-only because they are made particularly for trading, particularly for certain types of market data. These are tools adapted for particular use case, not like my other posts with general math entities like Kernel Density Estimation or Kalman filter, that you can take and apply properly on any data you need yourself.
However these are made from general math entities like everything else. ‘All’ the components are available in my other scripts, ideas, and other sources related to me. If you want to reverse-engineer these, you can find all the components you need in my already posted open source work.
∞
Worstfx Key Time Windows + 5 Day Journal🕒 Key Time Windows — Features & Purpose
✔️ Includes 6 Major Time Windows:
• 7:45 PM (Asia Open Overview)
• 12:00 AM (Daily Reset Liquidity Shift)
• 2:00 AM (London Accumulation / Manipulation)
• 7:00 AM (Pre-NY / Expansion Setup)
• 10:00 AM (NY Reversal Window)
• 2:00 PM (NY Power Move / Final Push) ← added
These windows are not random — they are the exact points in the day where:
• Liquidity resets
• Volatility compresses or expands
• Session trends form or reverse
• Market makers reposition
• High-probability setups appear
The panel shows:
➤ INSIDE
You are currently in the window.
Expect movement, structure breaks, or trap/reversal behavior.
➤ NEAR
Approaching a key window.
Prepare, observe order flow, plan entries.
➤ FAR
Out of the actionable range.
Ideal for reducing screen time and avoiding emotional trades.
➤ IDLE
The window passed.
High-probability moment is over — walk away or wait for the next one.
⚡ Why this matters
Most blown accounts come from trading outside high-probability times.
Your edge comes from timing, not randomness.
This panel keeps your brain aligned with the correct moments — not boredom, FOMO, or impulse.
📊 5-Day Performance Journal — Features
✔️ Enter daily P/L manually
• Monday → Friday
• Accepts positive or negative values
• Example: +2500, -300, 0
✔️ Auto-Calculated Weekly Total
• Shown right next to Friday
• Colored based on profit or loss
• Light highlight tint to stand out without distractions
✔️ Two Clean Layouts
• Vertical → For corner placement
• Horizontal → For header-like week summaries
✔️ Psychology Through Design
• Green = rewarded discipline
• Red = consequence of breaking plan
• White-dim = zero day → neutral, no shame, no heat
The goal is not the number —
It’s accountability, awareness, and emotional grounding.
🧠Consistency Over Drama
The weekly total next to Friday forces your brain to think in weeks, not minutes.
Bad day?
You stop early to protect weekly total.
Good day?
You don’t overtrade because the number is already green.
This shifts your psychology from:
“I need to win right now.”
to:
“I need to preserve my weekly edge.
🔋To unlock the full power of the framework, run this together with Worstfx Fractal Sessions🔋
Liquidity Analysis🙏🏻 Liquidity Analysis is 1 of 2 structural layer / orderflow layer analysis scripts. Both are independent so can’t be released together as a single script, but should be used together. The second one which is called (Signed) Volume Analysis is incoming.
The same math used in this script can be applied on other types of profile-like data: orderbooks, trading volumes of all options for each strike.
Important: market or volume profile, just as orderbooks and options traded volume by strikes, are all liquidity ‘estimates’, showing where liquidity is more likely or less likely to be. These estimates however, especially combined with other info, are really useful and reliable.
This script works with inferred volumes vs the provided one. It's the better choice for equities, bonds; neutral choice for currencies; and suboptimal choice for natural & artificial commodities.
Contents:
Output description;
How to analyze & use the outputs;
How to use it together with upcoming (Signed) Volume Analysis script;
How did I use both scripts to finish The Leap profitably and skipped many losses.
1. Output description
Color of the profile reflects the liquidity imbalance state: red is negative, purple is neutral, blue is positive.
Bar coloring represents history values of liquidity imbalance for backtesting purposes. It can be turned on/off in the script's Style settings.
Two purple vertical lines represent calculated borders of excessive liquidity (HVN), scarce liquidity (LVN), and sufficient liquidity (NVN) zones.
Vertical dash line marks the moving window end, this way you can be certain over what exact data you see the profile was built.
2. How to analyze & use the outputs
Setup up the script:
Moving window length: set it to ~ ¼ of your data analysis window. E.g if you see on your charts and use ~ 256 bars, set the length to 64.
Native tick size multiplier: leave it at 0 to calculate optimal number of rows automatically, or set it manually to match native tick size multiples you desire.
Use 2 timeframes: main one and a far lower one 3 steps down, just like on the screenshot.
Native lot size multiplier allows to round profile rows themselves to nearest multiples of native lot size. I added this just in case any1 needs it.
Find out current liquidity imbalance state:
As mentioned before, based on profile color, it can be negative, neutral or positive. This is the state variable that changes slowly and denies/confirms the signals that would be explained in the minute.
I use my own statistically grounded imbalance metric (no hardcoded/learned thresholds), that unlike mainstream imbalance metrics (e.g orderbook imbalance as sum of bids vs sum of asks) provides a natural neutral zone, when liquidity imbalance is ofc there but not strong enough to be considered.
…
Profile-based signals: look at profile shape vs 2 vertical purple lines.
where profile rows exceed the left purple line, these prices are considered HVN. Too much potential liquidity is there.
where profile rows don’t exceed the right purple line, these prices are considered LVN. Potential thin/lack of liquidity is expected there.
where profile rows are in between these 2 purple lines, these are NVN, or neutral liquidity zones.
Trading ruleset itself is based on couple of simple rules:
Only! Use limit orders hence provide liquidity in LVNs and Only! use stop-market orders hence consume liquidity in HVNs;
These orders should be put in advance ‘only’. This is how you discover the direction or orders: you can only put sell limit orders above you and buy limit orders below you, and you can only put buy stop orders above you, and sell stop orders below you.
This is really it. It may look weird, but once you just try to follow these 2 rules letter by letter for 1 hour, you’ll see how liquidity trading works.
Now once you know that, just don’t open new trades against the liquidity imbalance state. So don’t open shorts when the profile is blue, and don’t open longs when it’s red.
The last part is multi-timeframe logic. Prefer to act when a lower timeframe is Not against the main timeframe. That’s all, no multiple higher timeframes are needed.
3. How to use it together with upcoming (Signed) Volume Analysis script.
That upcoming script would also have a mean to generate its own signals, and another state variable called volume imbalance.
So now you’re not only looking at liquidity imbalance but also at volume imbalance that would deny/confirm a profile based signal. You need at least one of these to favor your long or short.
This is the same logic widely used in HFT, where MM bots cancel/shift/resize orders when book is too onesided And ordeflow is one sided as well.
4. How did I use both scripts to finish The Leap profitably and skipped many losses.
Even tho you can use structural information as your main strategic layer, as many so-called orderflow traders do, I traded in objective style: my fade signals were volatility based in essence, and I used ordeflow for better entries and stops, but most importantly to skip losses.
When ‘both‘ liquidity imbalance and volume imbalance (in their main timeframes) were against my trades, I skipped them all, saving many ~$500 stop losses (that was my basis risk unit for the Leap). Unless I had a very strong objective signal, i.e confluence of several signals, or just one higher timeframe signal, I did all these skips.
I traded ~ intraweek timeframe, so I was analyzing either the last 230 30min bars or 1380 5min bars. Both Liquidity Analysis and (signed) Volume Analysis scripts were set to moving window length 46 or 276 for either granulary.
I finished the leap with 9% profit and max DD ~ 5%, a bit short of my goal of 12.5%. If not these 2 scripts I would’ve finished a bit above breakeven I think.
∞
FF calculation Saptarshi ChatterjeeForward factor (in options contexts) measures implied volatility (IV) for a future period between two expirations, like from 30 DTE (days to expiry) front-month to 60 DTE back-month options.
This indicator calculates the FORWARD FACTOR(FF) using 2 IVs of 2 DTEs.
+ve value means front DTE is rich in premium and back expiry is cheap.
-ve value means front DTE IV is cheap and 2nd DTE is expensive
we can use this term structure disbalance to trade calendar spreads with edge.
Mutanabby_AI | ONEUSDT_MR1
ONEUSDT Mean-Reversion Strategy | 74.68% Win Rate | 417% Net Profit
This is a long-only mean-reversion strategy designed specifically for ONEUSDT on the 1-hour timeframe. The core logic identifies oversold conditions following sharp declines and enters positions when selling pressure exhausts, capturing the subsequent recovery bounce.
Backtested Period: June 2019 – December 2025 (~6 years)
Performance Summary
| Metric | Value |
|--------|-------|
| Net Profit | +417.68% |
| Win Rate | 74.68% |
| Profit Factor | 4.019 |
| Total Trades | 237 |
| Sharpe Ratio | 0.364 |
| Sortino Ratio | 1.917 |
| Max Drawdown | 51.08% |
| Avg Win | +3.14% |
| Avg Loss | -2.30% |
| Buy & Hold Return | -80.44% |
Strategy Logic :
Entry Conditions (Long Only):
The strategy seeks confluence of three conditions that identify exhausted selling:
1. Prior Move Filter:*The price change from 5 bars ago to 3 bars ago must be ≥ -7% (ensures we're not entering during freefall)
2. Current Move Filter: The price change over the last 2 bars must be ≤ 0% (confirms momentum is stalling or reversing)
3. Three-Bar Decline: The price change from 5 bars ago to 3 bars ago must be ≤ -5% (confirms a significant recent drop occurred)
When all three conditions align, the strategy identifies a potential reversal point where sellers are exhausted.
Exit Conditions:
- Primary Exit: Close above the previous bar's high while the open of the previous bar is at or below the close from 9 bars ago (profit-taking on strength)
- Trailing Stop: 11x ATR trailing stop that locks in profits as price rises
Risk Management
- Position Sizing:Fixed position based on account equity divided by entry price
- Trailing Stop:11× ATR (14-period) provides wide enough room for crypto volatility while protecting gains
- Pyramiding:Up to 4 orders allowed (can scale into winning positions)
- **Commission:** 0.1% per trade (realistic exchange fees included)
Important Disclaimers
⚠️ This is NOT financial advice.
- Past performance does not guarantee future results
- Backtest results may contain look-ahead bias or curve-fitting
- Real trading involves slippage, liquidity issues, and execution delays
- This strategy is optimized for ONEUSDT specifically — results may differ on other pairs
- Always test before risking real capital
Recommended Usage
- Timeframe:*1H (as designed)
- Pair: ONEUSDT (Binance)
- Account Size: Ensure sufficient capital to survive max drawdown
Source Code
Feedback Welcome
I'm sharing this strategy freely for educational purposes. Please:
- Drop a comment with your backtesting results any you analysis
- Share any modifications that improve performance
- Let me know if you spot any issues in the logic
Happy trading
As a quant trader, do you think this strategy will survive in live trading?
Yes or No? And why?
I want to hear from you guys
RTH Gap & Stdev [Sword & Shield]Dynamic RTH Gap & Stdev - Technical Description
Description
This script implements a specialized methodology for analyzing the Regular Trading Hours (RTH) Opening Gap, focusing on the "void" created between the previous session's RTH Close and the current session's RTH Open. Unlike standard gap indicators that may reference the Settlement or pre-market range, this tool isolates the specific liquidity gap formed by the primary session auction.
The script is designed to help traders identify:
The Gap Zone: The precise price range where no RTH trading occurred.
Internal Quartiles: Key harmonic subdivisions (25%, 50%, 75%) within the gap, often serving as intraday support/resistance.
Expansion Targets: Projected volatility levels (Standard Deviations) above and below the gap.
Mitigation State: Real-time tracking of how much of the gap has been "filled" by price action.
Underlying Concepts & Calculations
1. RTH Session Detection
The indicator strictly follows asset-specific timetables (e.g., Indices 09:30-16:00 ET). It detects the RTH Close of the previous day (closing print of the last RTH bar) and the RTH Open of the current day.
Gap High: Max(PrevClose, CurOpen)
Gap Low: Min(PrevClose, CurOpen)
2. Quartile & Harmonic Levels
We divide the gap range (GapHigh - GapLow) into quartiles. The 50% level (Consequent Encroachment) is a widely recognized equilibrium point in gap trading.
Formula: Level(x) = GapLow + (GapRange * x) where x is 0.25, 0.50, 0.75.
3. Volatility Projections (Standard Deviations)
The script offers two distinct volatility models for projecting targets:
Gap Range Basis: A harmonic expansion model where 1.0σ (Standard Deviation) is rigidly defined as 100% of the Gap Range. This assumes the market often expands in multiples of the initial opening impulse.
Calculation: +1.0σ Level = GapHigh + GapRange
VWAP Bands Basis: A statistical model estimating daily volatility using the deviation of price from the VWAP (Volume Weighted Average Price) from the previous session. This allows the bands to adapt to the broader market volatility rather than just the gap size.
4. Dynamic Extension & Clamping
Uniquely, this script uses a forward-projection bar-loop. Lines and labels are instantiated at the Open and extended incrementally with each new bar.
Clamping: The script calculates the precise timestamp of the RTH Close and clamps all drawing objects to this time. This prevents lines from extending into the post-market or next day, ensuring a clean chart layout.
5. Mitigation Tracking
The dashboard calculates the Unmitigated Percentage of the gap:
Logic: It tracks the session's Highest High and Lowest Low.
Calculation: FilledRange = PriceExtreme - GapBoundary.
Status: displayed as "Unmitigated, 100% rem" or "Mitigated XX%", providing a precise metric for gap-fill strategies.
Usage
Traders can use this tool to:
Target the 50% fill described as "Consequent Encroachment".
Fade extremes at +1.0σ gap expansions.
Monitor the "Mitigation %" to gauge trend strength (e.g., a gap that remains <20% filled often indicates a strong trend day).
Student Wyckoff SR Strength (Multi Levels)
This indicator builds a simple, objective map of support and resistance based on recent price action. It scans a user-defined lookback window and clusters bar lows into support zones and bar highs into resistance zones. For each cluster it measures how often price interacted with that level and ranks the strongest zones.
**How it works**
* The script looks back over the last *N* bars (input **“Range length in bars left”**).
* Every bar low is added to a “support cluster”, every bar high to a “resistance cluster”.
* Price levels that are closer than a given number of ticks (input **“Merge levels, ticks”**) are merged into one zone.
* For each cluster the script counts how many bars touched that zone and divides this by the number of bars in the window.
* The result is plotted as horizontal lines: the top *K* support levels and the top *K* resistance levels, where *K* is set in **“Max support/resistance levels”**.
* Each line has a label with the level type and its **strength in %** (share of bars in the lookback window that touched this zone).
Higher percentages mean that price has interacted with this level more frequently inside the chosen range, which can help to highlight zones where the market repeatedly reacted in the past. The script does **not** generate trade signals; it only provides a visual context for your own Wyckoff / price-reading analysis.
**Inputs**
* **Range length in bars left** – number of bars used for calculating levels. Longer ranges give more “global” zones, shorter ranges focus on local structure.
* **Merge levels, ticks** – price tolerance for merging nearby highs/lows into one level.
* **Max support/resistance levels** – how many strongest support and resistance lines to display (1–5).
* **Support line width / Resistance line width** – thickness of each line.
* **Support line color / Resistance line color** – color of support and resistance lines.
* **Show strength in percent** – toggle labels with percentage strength.
* **Support label text / Resistance label text** – base text shown in labels before the percentage (can be customized).
* **Support label background / text color** – styling for support labels.
* **Resistance label background / text color** – styling for resistance labels.
* **Label text size** – global label font size (Tiny / Small / Normal / Large / Huge).
**Notes**
* All calculations are done on confirmed bars (`barstate.isconfirmed`) to avoid repainting within the current bar.
* The strength value is statistical and depends on the chosen range and merge settings. It should be combined with your own context analysis, volume, and higher-time-frame structure rather than used as a standalone entry or exit signal.
LuxyEnergyIndexThe Luxy Energy Index (LEI) library provides functions to measure price movement exhaustion by analyzing three dimensions: Extension (distance from fair value), Velocity (speed of movement), and Volume (confirmation level).
LEI answers a different question than traditional momentum indicators: instead of "how far has price gone?" (like RSI), LEI asks "how tired is this move?"
This library allows Pine Script developers to integrate LEI calculations into their own indicators and strategies.
How to Import
//@version=6
indicator("My Indicator")
import OrenLuxy/LuxyEnergyIndex/1 as LEI
Main Functions
`lei(src)` → float
Returns the LEI value on a 0-100 scale.
src (optional): Price source, default is `close`
Returns : LEI value (0-100) or `na` if insufficient data (first 50 bars)
leiValue = LEI.lei()
leiValue = LEI.lei(hlc3) // custom source
`leiDetailed(src)` → tuple
Returns LEI with all component values for detailed analysis.
= LEI.leiDetailed()
Returns:
`lei` - Final LEI value (0-100)
`extension` - Distance from VWAP in ATR units
`velocity` - 5-bar price change in ATR units
`volumeZ` - Volume Z-Score
`volumeModifier` - Applied modifier (1.0 = neutral)
`vwap` - VWAP value used
Component Functions
| Function | Description | Returns |
|-----------------------------------|---------------------------------|---------------|
| `calcExtension(src, vwap)` | Distance from VWAP / ATR | float |
| `calcVelocity(src)` | 5-bar price change / ATR | float |
| `calcVolumeZ()` | Volume Z-Score | float |
| `calcVolumeModifier(volZ)` | Volume modifier | float (≥1.0) |
| `getVWAP()` | Auto-detects asset type | float |
Signal Functions
| Function | Description | Returns |
|---------------------------------------------|----------------------------------|-----------|
| `isExhausted(lei, threshold)` | LEI ≥ threshold (default 70) | bool |
| `isSafe(lei, threshold)` | LEI ≤ threshold (default 30) | bool |
| `crossedExhaustion(lei, threshold)` | Crossed into exhaustion | bool |
| `crossedSafe(lei, threshold)` | Crossed into safe zone | bool |
Utility Functions
| Function | Description | Returns |
|----------------------------|-------------------------|-----------|
| `getZone(lei)` | Zone name | string |
| `getColor(lei)` | Recommended color | color |
| `hasEnoughHistory()` | Data check | bool |
| `minBarsRequired()` | Required bars | int (50) |
| `version()` | Library version | string |
Interpretation Guide
| LEI Range | Zone | Meaning |
|-------------|--------------|--------------------------------------------------|
| 0-30 | Safe | Low exhaustion, move may continue |
| 30-50 | Caution | Moderate exhaustion |
| 50-70 | Warning | Elevated exhaustion |
| 70-100 | Exhaustion | High exhaustion, increased reversal risk |
Example: Basic Usage
//@version=6
indicator("LEI Example", overlay=false)
import OrenLuxy/LuxyEnergyIndex/1 as LEI
// Get LEI value
leiValue = LEI.lei()
// Plot with dynamic color
plot(leiValue, "LEI", LEI.getColor(leiValue), 2)
// Reference lines
hline(70, "High", color.red)
hline(30, "Low", color.green)
// Alert on exhaustion
if LEI.crossedExhaustion(leiValue) and barstate.isconfirmed
alert("LEI crossed into exhaustion zone")
Technical Details
Fixed Parameters (by design):
Velocity Period: 5 bars
Volume Period: 20 bars
Z-Score Period: 50 bars
ATR Period: 14
Extension/Velocity Weights: 50/50
Asset Support:
Stocks/Forex: Uses Session VWAP (daily reset)
Crypto: Uses Rolling VWAP (50-bar window) - auto-detected
Edge Cases:
Returns `na` until 50 bars of history
Zero volume: Volume modifier defaults to 1.0 (neutral)
Credits and Acknowledgments
This library builds upon established technical analysis concepts:
VWAP - Industry standard volume-weighted price measure
ATR by J. Welles Wilder Jr. (1978) - Volatility normalization
Z-Score - Statistical normalization method
Volume analysis principles from Volume Spread Analysis (VSA) methodology
Disclaimer
This library is provided for **educational and informational purposes only**. It does not constitute financial advice. Past performance does not guarantee future results. The exhaustion readings are probabilistic indicators, not guarantees of price reversal. Always conduct your own research and use proper risk management when trading.
GIX Analizor strategiiGIX Analyzer – Intelligent Time Filters + X Strategy
This script combines the X Strategy with an advanced system for filtering trades based on time intervals. The strategy allows:
Filtering by preset trading hours (active sessions )
Filtering by a fully customizable time interval (hour + minute, Romania time )
Filtering by calendar range (Start Date → End Date)
Simultaneous activation of both time-filter modes for maximum control
Trading only within valid time ranges, while keeping all logic unchanged
This indicator provides high flexibility for testing and optimizing trading entries based on hours, minutes, and calendar periods—while preserving the simplicity and efficiency of any strategy
Pardos Info DashboardThis indicator presents basic data in a concentrated form
Additions to the indicator are welcome by email to gshayp@gmail.com
Trinity ATR Real Move DetectorTrinity ATR Real Move Detector
This ATR Energy Table indicator is one of the simplest yet most powerful filters you can have on a chart when trading short-dated or 0DTE options or swing trades on any timeframe from 1-minute up to 4-hour. Its entire job is to answer the single most important question in intraday and swing trading: “Does the underlying actually have enough short-term explosive energy right now to make a directional position worth the theta and the spread, or is this just pretty candles that will die in ten minutes?”
Most losing 0DTE and short-dated option trades happen because people buy or sell direction on a “nice-looking” breakout or pullback while the underlying is actually in low-energy grind mode. The premium decays faster than the move develops, and you lose even when you’re “right” on direction. This little table stops that from ever happening again.
Here’s what it does in plain English:
Every bar it measures two things:
- The current ATR on whatever timeframe you are using (1 min, 3 min, 5 min, 10 min, etc.). This tells you how big the average true range of the last 14 bars has been — in other words, how violently the stock or index is actually moving right now.
- The daily ATR (14-period on the daily chart). This is your benchmark for “normal” daily movement over the last two–three weeks.
It then multiplies the daily ATR by a small number (the multiplier you set) and compares the two. If the short-term ATR is bigger than that percentage of the daily ATR, the table turns bright green and says “ENOUGH ENERGY”. If not, it stays red and says “NOT ENOUGH”.
Why this works so well:
- Real explosive moves that carry for 0DTE and 1–3 DTE options almost always show a short-term ATR spike well above the recent daily average. Quiet grind moves never do.
- The comparison is completely adaptive — on a high-vol day the threshold automatically rises, on a low-vol day it automatically drops. You never have to guess if “2 points on SPY is big today”.
- It removes emotion completely. You simply wait for green before you even think about clicking buy or sell on an option.
Key settings and what to do with them:
- Energy Multiplier — this is the only number you ever touch. It is expressed as a decimal (0.15 = 15 % of the daily ATR). Lower = more signals, higher = stricter and higher win rate. The tooltip gives you the exact sweet-spot numbers for every popular timeframe (0.09 for 1-minute scalping, 0.13 for 3-minute, 0.14–0.16 for 5-minute, 0.15–0.19 for 10-minute, etc.). Just pick your timeframe once and type the number — done forever.
- ATR Length — leave it at 14. That’s the standard and works perfectly.
- Table Position — move the table to wherever you want on the chart (top-right, bottom-right, bottom-left, top-left).
- Table Size — make the text Tiny, Small, Normal or Large depending on how much screen space you have.
How this helps you make money and stop losing it:
- On most days you will see red 80–90 % of the time — that’s good! It is forcing you to sit on your hands instead of overtrading low-energy chop that eats premium.
- When it finally flips green you know institutions are actually pushing size right now — follow-through probability jumps from ~40 % to 65–75 % depending on the stock and timeframe.
- You stop buying calls on every green candle and puts on every red candle. You only strike when the market is genuinely “awake”.
- Over a week you take dramatically fewer trades, but your win rate and average winner size go way up — which is exactly how consistent intraday option profits are made.
In short, this tiny table is the closest thing to an “edge on/off switch” that exists for short-dated options. Red = preserve capital and go do something else. Green = pull the trigger with confidence. Use it religiously and you’ll immediately feel the difference in your P&L.
TFGI Lite: Technical Fear & Greed Dashboard (All-Assets)📊 TFGI Lite: Technical Fear & Greed Dashboard (All-Assets)
Don't guess the sentiment. Measure it.
不要猜測情緒,去測量它。
🇹🇼 繁體中文:市場情緒的導航儀
什麼是 TFGI Lite?
這是一個簡潔的「市場氣象儀表板」,直接顯示在您的 K 線圖上。它幫助您判斷現在市場是處於「過度恐懼(適合貪婪)」還是「過度貪婪(適合謹慎)」的狀態。適用於股票、加密貨幣、外匯與期貨。
數字代表什麼意義?
分數範圍為 0 到 100:
0 - 25 (極度恐懼 / 綠色區域):
市場陷入恐慌,價格可能被低估。這通常是尋找買點的機會(別人恐懼我貪婪)。
75 - 100 (極度貪婪 / 紅色區域):
市場過熱,追高風險極大。這通常是考慮獲利了結或警惕回調的時刻。
25 - 75 (中性震盪):
市場處於正常波動範圍,順勢操作即可。
儀表板上的三個關鍵數據:
Local TFGI (當前商品):您現在看的這張圖表(例如比特幣或台積電)的情緒分數。
Global TFGI (全球宏觀):全球資金的流向與風險偏好(綜合了美股、波動率 VIX、美元與債市)。這就像是「大盤天氣」。如果全球都在下雨(恐慌),您的股票也很難獨善其身。
Spread (情緒溫差):
如果 Local 分數遠高於 Global,代表這個商品漲過頭了,要注意風險。
如果 Local 分數遠低於 Global,代表這個商品被錯殺了,可能是機會。
🇺🇸 English: Navigate Market Sentiment Simply
What is TFGI Lite?
A clean, professional "Weather Dashboard" for your chart. It quantifies market psychology, helping you decide when to be contrarian. It works on any asset class (Stocks, Crypto, Forex).
How to Read the Numbers (0-100 Score)
0 - 25 (Extreme Fear / Green Zone):
Investors are panicking. The asset may be oversold. Historically, this is often a buying opportunity.
75 - 100 (Extreme Greed / Red Zone):
The market is overheated and FOMO is high. The risk of a correction is increasing. It might be time to take profits.
25 - 75 (Neutral):
Normal market fluctuations.
Key Features on the Dashboard:
Local TFGI: The sentiment score of the specific asset you are watching right now.
Global TFGI: The sentiment of the entire global market (Aggregating SPY, VIX, DXY, and Bonds). Think of this as the "Macro Tide". It's hard to swim against the tide.
Spread: The difference between the Asset and the Global market.
Positive Spread: This asset is hotter than the global market (Potential Overvaluation).
Negative Spread: This asset is weaker than the global market (Potential Undervaluation).
🇯 日本語:相場の「過熱感」を一目で判断
TFGI Liteとは?
チャート上に表示されるシンプルな「センチメント(市場心理)ダッシュボード」です。市場が「悲観(買い時)」にあるのか、「楽観(売り時)」にあるのかを客観的な数値で示します。株、仮想通貨、FXなど、あらゆる資産に対応しています。
スコアの見方(0〜100)
0 - 25 (極度の恐怖 / 緑エリア):
市場はパニック状態です。売られすぎの可能性があり、逆張りの買いチャンスとなることが多いゾーンです。
75 - 100 (極度の強欲 / 赤エリア):
市場は過熱しており、イケイケの状態です。暴落のリスクが高まっているため、利益確定を検討する警戒ゾーンです。
25 - 75 (中立):
通常の変動範囲内です。
ダッシュボードの3つの重要指標:
Local TFGI (個別): 現在表示している銘柄のセンチメントスコアです。
Global TFGI (全体): 世界市場全体のムード(米国株、VIX指数、ドル、債券を総合分析)。「地合い」を確認するために使います。
Spread (乖離): 個別銘柄と世界市場の温度差。この数値が大きい場合、その銘柄だけが異常に買われすぎている可能性があります。
🇰🇷 한국어: 시장의 공포와 탐욕을 한눈에
TFGI Lite란 무엇인가요?
차트 위에 직접 표시되는 깔끔한 "시장 심리 계기판"입니다. 현재 시장이 '과도한 공포(저점 매수 기회)'인지 '과도한 탐욕(고점 매도 주의)'인지 판단하는 데 도움을 줍니다. 주식, 코인, 외환 등 모든 자산에 적용 가능합니다.
숫자가 의미하는 것 (0~100점)
0 - 25 (극심한 공포 / 초록색 구간):
투자자들이 패닉에 빠져 투매가 나옵니다. 역사적으로 이는 저가 매수(Buy the dip)의 기회일 가능성이 높습니다.
75 - 100 (극심한 탐욕 / 빨간색 구간):
시장이 과열되었습니다. 추격 매수는 위험하며, 이익 실현을 고려하거나 조정을 대비해야 할 때입니다.
25 - 75 (중립):
일반적인 시장 변동 구간입니다.
대시보드의 핵심 데이터:
Local TFGI (개별 종목): 지금 보고 계신 차트(코인/주식)의 자체적인 심리 점수입니다。
Global TFGI (글로벌 매크로): 전 세계 자금의 흐름과 위험 선호도(미국 증시, VIX, 달러, 채권 종합). 시장 전체의 "날씨"를 알려줍니다。
Spread (괴리율): 개별 종목과 글로벌 시장 간의 온도 차이. 개별 종목 점수가 글로벌보다 훨씬 높다면, 해당 종목이 과매수되었을 수 있습니다。
KernelFunctionsLibrary "KernelFunctions"
This library provides non-repainting kernel functions for Nadaraya-Watson estimator implementations. This allows for easy substition/comparison of different kernel functions for one another in indicators. Furthermore, kernels can easily be combined with other kernels to create newer, more customized kernels.
rationalQuadratic(_src, _lookback, _relativeWeight, startAtBar)
Rational Quadratic Kernel - An infinite sum of Gaussian Kernels of different length scales.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_relativeWeight (simple float) : Relative weighting of time frames. Smaller values resut in a more stretched out curve and larger values will result in a more wiggly curve. As this value approaches zero, the longer time frames will exert more influence on the estimation. As this value approaches infinity, the behavior of the Rational Quadratic Kernel will become identical to the Gaussian kernel.
startAtBar (simple int)
Returns: yhat The estimated values according to the Rational Quadratic Kernel.
gaussian(_src, _lookback, startAtBar)
Gaussian Kernel - A weighted average of the source series. The weights are determined by the Radial Basis Function (RBF).
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
startAtBar (simple int)
Returns: yhat The estimated values according to the Gaussian Kernel.
periodic(_src, _lookback, _period, startAtBar)
Periodic Kernel - The periodic kernel (derived by David Mackay) allows one to model functions which repeat themselves exactly.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period (simple int) : The distance between repititions of the function.
startAtBar (simple int)
Returns: yhat The estimated values according to the Periodic Kernel.
locallyPeriodic(_src, _lookback, _period, startAtBar)
Locally Periodic Kernel - The locally periodic kernel is a periodic function that slowly varies with time. It is the product of the Periodic Kernel and the Gaussian Kernel.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period (simple int) : The distance between repititions of the function.
startAtBar (simple int)
Returns: yhat The estimated values according to the Locally Periodic Kernel.
Open Interest Z-Score [BackQuant]Open Interest Z-Score
A standardized pressure gauge for futures positioning that turns multi venue open interest into a Z score, so you can see how extreme current positioning is relative to its own history and where leverage is stretched, decompressing, or quietly re loading.
What this is
This indicator builds a single synthetic open interest series by aggregating futures OI across major derivatives venues, then standardises that aggregated OI into a rolling Z score. Instead of looking at raw OI or a simple change, you get a normalized signal that says "how many standard deviations away from normal is positioning right now", with optional smoothing, reference bands, and divergence detection against price.
You can render the Z score in several plotting modes:
Line for a clean, classic oscillator.
Colored line that encodes both sign and momentum of OI Z.
Oscillator histogram that makes impulses and compressions obvious.
The script also includes:
Aggregated open interest across Binance, Bybit, OKX, Bitget, Kraken, HTX, and Deribit, using multiple contract suffixes where applicable.
Choice of OI units, either coin based or converted to USD notional.
Standard deviation reference lines and adaptive extreme bands.
A flexible smoothing layer with multiple moving average types.
Automatic detection of regular and hidden divergences between price and OI Z.
Alerts for zero line and ±2 sigma crosses.
Aggregated open interest source
At the core is the same multi venue OI aggregation engine as in the OI RSI tool, adapted from NoveltyTrade's work and extended for this use case. The indicator:
Anchors on the current chart symbol and its base currency.
Loops over a set of exchanges, gated by user toggles:
Binance.
Bybit.
OKX.
Bitget.
Kraken.
HTX.
Deribit.
For each exchange, loops over several contract suffixes such as USDT.P, USD.P, USDC.P, USD.PM to cover the common perp and margin styles.
Requests OI candles for each exchange plus suffix pair into a small custom OI type that carries open, high, low and close of open interest.
Converts each OI stream into a common unit via the sw method:
In COIN mode, OI is normalized relative to the coin.
In USD mode, OI is scaled by price to approximate notional.
Exchange specific scaling factors are applied where needed to match contract multipliers.
Accumulates all valid OI candles into a single combined OI "candle" by summing open, high, low and close across venues.
The result is oiClose , a synthetic close for aggregated OI that represents cross venue positioning. If there is no valid OI data for the symbol after this process, the script throws a clear runtime error so you know the market is unsupported rather than quietly plotting nonsense.
How the Z score is computed
Once the aggregated OI close is available, the indicator computes a rolling Z score over a configurable lookback:
Define subject as the aggregated OI close.
Compute a rolling mean of this subject with EMA over Z Score Lookback Period .
Compute a rolling standard deviation over the same length.
Subtract the mean from the current OI and divide by the standard deviation.
This gives a raw Z score:
oi_z_raw = (subject − mean) ÷ stdDev .
Instead of plotting this raw value directly, the script passes it through a smoothing layer:
You pick a Smoothing Type and Smoothing Period .
Choices include SMA, HMA, EMA, WMA, DEMA, RMA, linear regression, ALMA, TEMA, and T3.
The helper ma function applies the chosen smoother to the raw Z score.
The result is oi_z , a smoothed Z score of aggregated open interest. A separate EMA with EMA Period is then applied on oi_z to create a signal line ma that can be used for crossovers and trend reads.
Plotting modes
The Plotting Type input controls how this Z score is rendered:
1) Line
In line mode:
The smoothed OI Z score is plotted as a single line using Base Line Color .
The EMA overlay is optionally plotted if Show EMA is enabled.
This is the cleanest view when you want to treat OI Z like a standard oscillator, watching for zero line crosses, swings, and divergences.
2) Colored Line
Colored line mode adds conditional color logic to the Z score:
If the Z score is above zero and rising, it is bright green, representing positive and strengthening positioning pressure.
If the Z score is above zero and falling, it shifts to a cooler cyan, representing positive but weakening pressure.
If the Z score is below zero and falling, it is bright red, representing negative and strengthening pressure (growing net de risking or shorting).
If the Z score is below zero and rising, it is dark red, representing negative but recovering pressure.
This mapping makes it easy to see not only whether OI is above or below its historical mean, but also whether that deviation is intensifying or fading.
3) Oscillator
Oscillator mode turns the Z score into a histogram:
The smoothed Z score is plotted as vertical columns around zero.
Column colors use the same conditional palette as colored line mode, based on sign and change direction.
The histogram base is zero, so bars extend up into positive Z and down into negative Z.
Oscillator mode is useful when you care about impulses in positioning, for example sharp jumps into positive Z that coincide with fast builds in leverage, or deep spikes into negative Z that show aggressive flushes.
4) None
If you only want reference lines, extreme bands, divergences, or alerts without the base oscillator, you can set plotting to None and keep the rest of the tooling active.
The EMA overlay respects plotting mode and only appears when a visible Z score line or histogram is present.
Reference lines and standard deviation levels
The Select Reference Lines input offers two styles:
Standard Deviation Levels
Plots small markers at zero.
Draws thin horizontal lines at +1, +2, −1 and −2 Z.
Acts like a classic Z score ladder, zero as mean, ±1 as normal band, ±2 as outer band.
This mode is ideal if you want a textbook statistical framing, using ±1 and ±2 sigma as standard levels for "normal" versus "extended" positioning.
Extreme Bands
Extreme bands build on the same ±1 and ±2 lines, then add:
Upper outer band between +3 and +4 Z.
Lower outer band between −3 and −4 Z.
Dynamic fill colors inside these bands:
If the Z score is positive, the upper band fill turns red with an alpha that scales with the magnitude of |Z|, capped at a chosen max strength. Stronger deviations towards +4 produce more opaque red fills.
If the Z score is negative, the lower band fill turns green with the same adaptive alpha logic, highlighting deep negative deviations.
Opposite side bands remain a faint neutral white when not in use, so they still provide structural context without shouting.
This creates a visual "danger zone" for position crowding. When the Z score enters these outer bands, open interest is many standard deviations away from its mean and you are dealing with rare but highly loaded positioning states.
Z score as a positioning pressure gauge
Because this is a Z score of aggregated open interest, it measures how unusual current positioning is relative to its own recent history, not just whether OI is rising or falling:
Z near zero means total OI is roughly in line with normal conditions for your lookback window.
Positive Z means OI is above its recent mean. The further above zero, the more "crowded" or extended positioning is.
Negative Z means OI is below its recent mean. Deep negatives often mark post flush environments where leverage has been cleared and the market is under positioned.
The smoothing options help control how much noise you want in the signal:
Short Z score lookback and short smoothing will react quickly, suited for short term traders watching intraday positioning shocks.
Longer Z score lookback with smoother MA types (EMA, RMA, T3) give a slower, more structural view of where the crowd sits over days to weeks.
Divergences between price and OI Z
The indicator includes automatic divergence detection on the Z score versus price, using pivot highs and lows:
You configure Pivot Lookback Left and Pivot Lookback Right to control swing sensitivity.
Pivots are detected on the OI Z series.
For each eligible pivot, the script compares OI Z and price at the last two pivots.
It looks for four patterns:
Regular Bullish – price makes a lower low, OI Z makes a higher low. This can indicate selling exhaustion in positioning even as price washes out. These are marked with a line and a label "ℝ" below the oscillator, in the bullish color.
Hidden Bullish – price makes a higher low, OI Z makes a lower low. This suggests continuation potential where price holds up while positioning resets. Marked with "ℍ" in the bullish color.
Regular Bearish – price makes a higher high, OI Z makes a lower high. This is a classic warning sign of trend exhaustion, where price pushes higher while OI Z fails to confirm. Marked with "ℝ" in the bearish color.
Hidden Bearish – price makes a lower high, OI Z makes a higher high. This is often seen in pullbacks within downtrends, where price retraces but positioning stretches again in the direction of the prevailing move. Marked with "ℍ" in the bearish color.
Each divergence type can be toggled globally via Show Detected Divergences . Internally, the script restricts how far back it will connect pivots, so you do not get stray signals linking very old structures to current bars.
Trading applications
Crowding and squeeze risk
Z scores are a natural way to talk about crowding:
High positive Z in aggregated OI means the market is running high leverage compared to its own norm. If price is also extended, the risk of a squeeze or sharp unwind rises.
Deep negative Z means leverage has been cleaned out. While it can be painful to sit through, this environment often sets up cleaner new trends, since there is less one sided positioning to unwind.
The extreme bands at ±3 to ±4 highlight the rare states where crowding is most intense. You can treat these events as regime markers rather than day to day noise.
Trend confirmation and fade selection
Combine Z score with price and trend:
Bull trends with positive and rising Z are supported by fresh leverage, usually more persistent.
Bull trends with flat or falling Z while price keeps grinding up can be more fragile. Divergences and extreme bands can help identify which edges you do not want to fade and which you might.
In downtrends, deep negative Z that stays pinned can mean persistent de risking. Once the Z score starts to mean revert back toward zero, it can mark the early stages of stabilization.
Event and liquidation context
Around major events, you often see:
Rapid spikes in Z as traders rush to position.
Reversal and overshoot as liquidations and forced de risking clear the book.
A move from positive extremes through zero into negative extremes as the market transitions from crowded to under exposed.
The Z score makes that path obvious, especially in oscillator mode, where you see a block of high positive bars before the crash, then a slab of deep negative bars after the flush.
Settings overview
Z Score group
Plotting Type – None, Line, Colored Line, Oscillator.
Z Score Lookback Period – window used for mean and standard deviation on aggregated OI.
Smoothing Type – SMA, HMA, EMA, WMA, DEMA, RMA, linear regression, ALMA, TEMA or T3.
Smoothing Period – length for the selected moving average on the raw Z score.
Moving Average group
Show EMA – toggle EMA overlay on Z score.
EMA Period – EMA length for the signal line.
EMA Color – color of the EMA line.
Thresholds and Reference Lines group
Select Reference Lines – None, Standard Deviation Levels, Extreme Bands.
Standard deviation lines at 0, ±1, ±2 appear in both modes.
Extreme bands add filled zones at ±3 to ±4 with adaptive opacity tied to |Z|.
Extra Plotting and UI
Base Line Color – default color for the simple line mode.
Line Width – thickness of the oscillator line.
Positive Color – positive or bullish condition color.
Negative Color – negative or bearish condition color.
Divergences group
Show Detected Divergences – master toggle for divergence plotting.
Pivot Lookback Left and Pivot Lookback Right – how many bars left and right to define a pivot, controlling divergence sensitivity.
Open Interest Source group
OI Units – COIN or USD.
Exchange toggles for Binance, Bybit, OKX, Bitget, Kraken, HTX, Deribit.
Internally, all enabled exchanges and contract suffixes are aggregated into one synthetic OI series.
Alerts included
The indicator defines alert conditions for several key events:
OI Z Score Positive – Z crosses above zero, aggregated OI moves from below mean to above mean.
OI Z Score Negative – Z crosses below zero, aggregated OI moves from above mean to below mean.
OI Z Score Enters +2σ – Z enters the +2 band and above, marking extended positive positioning.
OI Z Score Enters −2σ – Z enters the −2 band and below, marking extended negative positioning.
Tie these into your strategy to be notified when leverage moves from normal to extended states.
Notes
This indicator does not rely on price based oscillators. It is a statistical lens on cross venue open interest, which makes it a complementary tool rather than a replacement for your existing price or volume signals. Use it to:
Quantify how unusual current futures positioning is compared to recent history.
Identify crowded leverage phases that can fuel squeezes.
Spot structural divergences between price and positioning.
Frame risk and opportunity around events and regime shifts.
It is not a complete trading system. Combine it with your own entries, exits and risk rules to get the most out of what the Z score is telling you about positioning pressure under the hood of the market.
Synthetic Liquidity HeatmapSYNTHETIC LIQUIDITY HEATMAP (SLH) v1.0
---
DESCRIPTION
The Synthetic Liquidity Heatmap (SLH) is an advanced statistical order book estimation tool that generates a visual representation of probable liquidity zones without requiring direct access to Level 2 market data. By analyzing price action, volume dynamics, and market microstructure patterns, SLH constructs a synthetic approximation of where institutional orders are likely concentrated.
---
KEY INNOVATIONS
1. CHL SPREAD MODEL (Close-High-Low)
Implements a logarithmic spread estimation model based on the relationship between close price and the high-low midrange. This microstructure approach captures the implicit bid-ask spread behavior embedded in OHLC data, providing insight into market maker activity and order flow imbalances.
2. VSA INTEGRATION (Volume Spread Analysis)
Optional Volume Spread Analysis mode weighs liquidity calculations by the product of volume and candle range. This identifies bars with significant effort (volume) relative to result (price movement), highlighting potential accumulation and distribution zones.
3. DYNAMIC LEVEL SPACING
Liquidity levels are spaced using ATR-based calculations, automatically adapting to current market volatility. This ensures relevant level placement across different instruments and timeframes without manual adjustment.
4. ACCUMULATIVE LIQUIDITY TRACKING
When price revisits the same level multiple times, contracts accumulate rather than creating duplicate zones. This mimics real order book behavior where resting orders stack at key price levels.
5. REAL-TIME HIT DETECTION
The system monitors when price reaches liquidity levels, terminating filled zones and maintaining only active resting liquidity. This provides a dynamic, evolving view of the synthetic order book.
---
MATHEMATICAL FOUNDATION
The CHL Spread Model is defined as:
CHL = √(4 × (ln(C) - M) × (ln(C) - M ))
Where:
- C is the closing price
- M = (ln(H) + ln(L)) / 2 is the log midrange
- M is the previous bar's log midrange
The State Factor adjusts liquidity intensity:
State Factor = max(0.2, 1.0 - (Z_spread × 0.15))
Where Z_spread is the z-score of the current spread relative to its moving average.
Liquidity distribution follows close position analysis:
Bid Strength = is_bullish ? (1 - close_position) × 0.7 + 0.3 : close_position × 0.7 + 0.3
Ask Strength = is_bullish ? close_position × 0.7 + 0.3 : (1 - close_position) × 0.7 + 0.3
---
APPLICATIONS
- Identify probable support and resistance zones based on synthetic order flow
- Visualize where institutional liquidity may be resting
- Anticipate potential reversal or breakout zones
- Complement existing Level 2 data with statistical estimation
- Analyze liquidity dynamics on instruments without accessible order book data
---
VISUAL REPRESENTATION
The heatmap displays:
- Green zones (Bids): Probable buy-side liquidity below current price
- Orange zones (Asks): Probable sell-side liquidity above current price
- Color intensity: Proportional to estimated contract concentration
- Level termination: Zones disappear when price "fills" the liquidity
---
AUTHOR
Name: Hector Octavio Piccone Pacheco
Indicator: Synthetic Liquidity Heatmap (SLH)
Version: 1.0
Date: 2025
Original Contributions:
- CHL-based spread estimation for liquidity inference
- Accumulative synthetic order book model
- ATR-adaptive level spacing system
- Real-time liquidity hit detection engine
- VSA-weighted liquidity distribution
---
DISCLAIMER
Trading involves substantial risk of loss. This indicator provides statistical estimations only and does not represent actual market depth or order book data. Past performance does not guarantee future results. Always conduct your own analysis and risk assessment.
---
ACCESS TO SRC
To request access to the SRC indicator, please contact me through:
Discord: octa_0001
machine_learningLibrary "machine_learning"
euclidean(a, b)
Parameters:
a (array)
b (array)
manhattan(a, b)
Parameters:
a (array)
b (array)
cosine_similarity(a, b)
Parameters:
a (array)
b (array)
cosine_distance(a, b)
Parameters:
a (array)
b (array)
chebyshev(a, b)
Parameters:
a (array)
b (array)
minkowski(a, b, p)
Parameters:
a (array)
b (array)
p (float)
dot_product(a, b)
Parameters:
a (array)
b (array)
vector_norm(arr, p)
Parameters:
arr (array)
p (float)
sigmoid(x)
Parameters:
x (float)
sigmoid_derivative(x)
Parameters:
x (float)
tanh_derivative(x)
Parameters:
x (float)
relu(x)
Parameters:
x (float)
relu_derivative(x)
Parameters:
x (float)
leaky_relu(x, alpha)
Parameters:
x (float)
alpha (float)
leaky_relu_derivative(x, alpha)
Parameters:
x (float)
alpha (float)
elu(x, alpha)
Parameters:
x (float)
alpha (float)
gelu(x)
Parameters:
x (float)
swish(x, beta)
Parameters:
x (float)
beta (float)
softmax(arr)
Parameters:
arr (array)
apply_activation(arr, activation_type, alpha)
Parameters:
arr (array)
activation_type (string)
alpha (float)
normalize_minmax(arr, min_val, max_val)
Parameters:
arr (array)
min_val (float)
max_val (float)
normalize_zscore(arr, mean_val, std_val)
Parameters:
arr (array)
mean_val (float)
std_val (float)
normalize_matrix_cols(m)
Parameters:
m (matrix)
scaler_fit(arr, method)
Parameters:
arr (array)
method (string)
scaler_fit_matrix(m, method)
Parameters:
m (matrix)
method (string)
scaler_transform(scaler, arr)
Parameters:
scaler (ml_scaler)
arr (array)
scaler_transform_matrix(scaler, m)
Parameters:
scaler (ml_scaler)
m (matrix)
clip(x, lo, hi)
Parameters:
x (float)
lo (float)
hi (float)
clip_array(arr, lo, hi)
Parameters:
arr (array)
lo (float)
hi (float)
loss_mse(predicted, actual)
Parameters:
predicted (array)
actual (array)
loss_rmse(predicted, actual)
Parameters:
predicted (array)
actual (array)
loss_mae(predicted, actual)
Parameters:
predicted (array)
actual (array)
loss_binary_crossentropy(predicted, actual)
Parameters:
predicted (array)
actual (array)
loss_huber(predicted, actual, delta)
Parameters:
predicted (array)
actual (array)
delta (float)
gradient_step(weights, gradients, lr)
Parameters:
weights (array)
gradients (array)
lr (float)
adam_step(weights, gradients, m, v, lr, beta1, beta2, t, epsilon)
Parameters:
weights (array)
gradients (array)
m (array)
v (array)
lr (float)
beta1 (float)
beta2 (float)
t (int)
epsilon (float)
clip_gradients(gradients, max_norm)
Parameters:
gradients (array)
max_norm (float)
lr_decay(initial_lr, decay_rate, step)
Parameters:
initial_lr (float)
decay_rate (float)
step (int)
lr_cosine_annealing(initial_lr, min_lr, step, total_steps)
Parameters:
initial_lr (float)
min_lr (float)
step (int)
total_steps (int)
knn_create(k, distance_type)
Parameters:
k (int)
distance_type (string)
knn_fit(model, X, y)
Parameters:
model (ml_knn)
X (matrix)
y (array)
knn_predict(model, x)
Parameters:
model (ml_knn)
x (array)
knn_predict_proba(model, x)
Parameters:
model (ml_knn)
x (array)
knn_batch_predict(model, X)
Parameters:
model (ml_knn)
X (matrix)
linreg_fit(X, y)
Parameters:
X (matrix)
y (array)
ridge_fit(X, y, lambda)
Parameters:
X (matrix)
y (array)
lambda (float)
linreg_predict(model, x)
Parameters:
model (ml_linreg)
x (array)
linreg_predict_batch(model, X)
Parameters:
model (ml_linreg)
X (matrix)
linreg_score(model, X, y)
Parameters:
model (ml_linreg)
X (matrix)
y (array)
logreg_create(n_features, learning_rate, iterations)
Parameters:
n_features (int)
learning_rate (float)
iterations (int)
logreg_fit(model, X, y)
Parameters:
model (ml_logreg)
X (matrix)
y (array)
logreg_predict_proba(model, x)
Parameters:
model (ml_logreg)
x (array)
logreg_predict(model, x, threshold)
Parameters:
model (ml_logreg)
x (array)
threshold (float)
logreg_batch_predict(model, X, threshold)
Parameters:
model (ml_logreg)
X (matrix)
threshold (float)
nb_create(n_classes)
Parameters:
n_classes (int)
nb_fit(model, X, y)
Parameters:
model (ml_nb)
X (matrix)
y (array)
nb_predict_proba(model, x)
Parameters:
model (ml_nb)
x (array)
nb_predict(model, x)
Parameters:
model (ml_nb)
x (array)
nn_create(layers, activation)
Parameters:
layers (array)
activation (string)
nn_forward(model, x)
Parameters:
model (ml_nn)
x (array)
nn_predict_class(model, x)
Parameters:
model (ml_nn)
x (array)
accuracy(y_true, y_pred)
Parameters:
y_true (array)
y_pred (array)
precision(y_true, y_pred, positive_class)
Parameters:
y_true (array)
y_pred (array)
positive_class (int)
recall(y_true, y_pred, positive_class)
Parameters:
y_true (array)
y_pred (array)
positive_class (int)
f1_score(y_true, y_pred, positive_class)
Parameters:
y_true (array)
y_pred (array)
positive_class (int)
r_squared(y_true, y_pred)
Parameters:
y_true (array)
y_pred (array)
mse(y_true, y_pred)
Parameters:
y_true (array)
y_pred (array)
rmse(y_true, y_pred)
Parameters:
y_true (array)
y_pred (array)
mae(y_true, y_pred)
Parameters:
y_true (array)
y_pred (array)
confusion_matrix(y_true, y_pred, n_classes)
Parameters:
y_true (array)
y_pred (array)
n_classes (int)
sliding_window(data, window_size)
Parameters:
data (array)
window_size (int)
train_test_split(X, y, test_ratio)
Parameters:
X (matrix)
y (array)
test_ratio (float)
create_binary_labels(data, threshold)
Parameters:
data (array)
threshold (float)
lag_matrix(data, n_lags)
Parameters:
data (array)
n_lags (int)
signal_to_position(prediction, threshold_long, threshold_short)
Parameters:
prediction (float)
threshold_long (float)
threshold_short (float)
confidence_sizing(probability, max_size, min_confidence)
Parameters:
probability (float)
max_size (float)
min_confidence (float)
kelly_sizing(win_rate, avg_win, avg_loss, max_fraction)
Parameters:
win_rate (float)
avg_win (float)
avg_loss (float)
max_fraction (float)
sharpe_ratio(returns, risk_free_rate)
Parameters:
returns (array)
risk_free_rate (float)
sortino_ratio(returns, risk_free_rate)
Parameters:
returns (array)
risk_free_rate (float)
max_drawdown(equity)
Parameters:
equity (array)
atr_stop_loss(entry_price, atr, multiplier, is_long)
Parameters:
entry_price (float)
atr (float)
multiplier (float)
is_long (bool)
risk_reward_take_profit(entry_price, stop_loss, ratio)
Parameters:
entry_price (float)
stop_loss (float)
ratio (float)
ensemble_vote(predictions)
Parameters:
predictions (array)
ensemble_weighted_average(predictions, weights)
Parameters:
predictions (array)
weights (array)
smooth_prediction(current, previous, alpha)
Parameters:
current (float)
previous (float)
alpha (float)
regime_classifier(volatility, trend_strength, vol_threshold, trend_threshold)
Parameters:
volatility (float)
trend_strength (float)
vol_threshold (float)
trend_threshold (float)
ml_knn
Fields:
k (series int)
distance_type (series string)
X_train (matrix)
y_train (array)
ml_linreg
Fields:
coefficients (array)
intercept (series float)
lambda (series float)
ml_logreg
Fields:
weights (array)
bias (series float)
learning_rate (series float)
iterations (series int)
ml_nn
Fields:
layers (array)
weights (matrix)
biases (array)
weight_offsets (array)
bias_offsets (array)
activation (series string)
ml_nb
Fields:
class_priors (array)
means (matrix)
variances (matrix)
n_classes (series int)
ml_scaler
Fields:
min_vals (array)
max_vals (array)
means (array)
stds (array)
method (series string)
ml_train_result
Fields:
loss_history (array)
final_loss (series float)
converged (series bool)
iterations_run (series int)
ml_prediction
Fields:
class_label (series int)
probability (series float)
probabilities (array)
value (series float)
Price Levels ConstructorHello friends,
This is a multi-period OHLC level mapping tool that lets you build your own higher-timeframe levels directly on the chart - across up to 20 customizable period slots.
You choose which periods matter (Year, Half-Year, Quarter, Month, Week, Day, weekdays, etc.), how recent they should be, and which levels to show (Open/High/Mid/Low/Close).
The script then renders those levels with automatic stacking and clear label formatting, giving you a compact higher-timeframe map for intraday and swing trading.
🛠️ How It Works
Each selected period slot creates a period model with its own OHLC+Mid data.
For each active level type, the script draws the price level, tracks the correct H/L/C timestamps when needed, and generates a label consisting of:
The selected recency (Current, Previous, 2nd Previous, …)
The period name (e.g., Month, Q1, Monday)
The level type (O/H/Mid/L/C)
All levels are fed into a registry that merges levels at identical prices, stacks their labels vertically or horizontally, and displays only one rendered line per price with combined label text.
This produces clean clusters when multiple periods share the same level.
Global settings control left/right extensions, label compactness, label content (name, price, % distance), and stacking direction.
🔥 Key Features
20 period slots
Ability to specify period (31 options, from Year to various weekdays)
Ability to specify recency for each selected period (13 options)
5 levels (Open, High, Mid, Low, Close) for each selected period
Stacking of labels of matching levels
% from All-Time High (ATH)
% from All-Time Low (ATL)
Alerts
📸 Visual Examples
The percentages in the level labels make it easy to see the current performance relative to that level
Labels with full level names
Compact labels with vertical stacking
Compact labels with horizontal stacking
👋 Good luck and happy trading!
Paid script
Granger Causality Flow IndicatorGranger Causality Flow Indicator
█ OVERVIEW
The Granger Causality Flow Indicator is a statistical analysis tool designed to identify predictive relationships between two assets (Symbol X and Symbol Y). In econometrics, "Granger Causality" does not test for actual physical causation (e.g., rain causes mud); rather, it tests for predictive causality .
This script is designed to answer a specific question for traders: "Does the past price action of Asset X provide statistically significant information about the future price of Asset Y, beyond what is already contained in the past prices of Asset Y itself?"
This tool is particularly useful for Pairs Traders , Arbitrageurs , and Macro Analysts looking to identify lead-lag relationships between correlated assets (e.g., BTC vs. ETH, NASDAQ vs. SPY, or Gold vs. Silver).
█ CONCEPTS & CALCULATIONS
To determine if Symbol X "Granger-causes" Symbol Y, this script utilizes a variance-reduction approach based on Auto-Regressive (AR) models. Due to the runtime constraints of Pine Script™, we employ an optimized proxy for the standard Granger test using an AR(1) logic (looking back 1 period).
The calculation performs a comparative test over a rolling window (Default: 50 bars):
The Restricted Model (Baseline):
We attempts to predict the current value of Y using only the previous value of Y (Auto-Regression). We measure the error of this prediction (the "Residuals") and calculate the Variance of the Restricted Model (Var_R) .
The Unrestricted Model (Proxy):
We then test if the past value of X can explain the errors made by the Restricted Model. If X contains predictive power, including it should reduce the error variance. We calculate the remaining Variance of the Unrestricted Model (Var_UR) .
The GC Score:
The script calculates a score based on the ratio of variance reduction:
Score = 1 - (Var_UR / Var_R)
If the Score is High (> 0) : It implies that including X significantly reduced the prediction error for Y. Therefore, X "Granger-causes" Y.
If the Score is Low or 0 : It implies X added no predictive value.
█ HOW TO USE
This indicator is not a simple Buy/Sell signal generator; it is a context filter for cross-asset analysis.
1. Setup
Symbol 1 (X): The potential "Leader" (e.g., BINANCE:BTCUSDT).
Symbol 2 (Y): The potential "Follower" (e.g., BINANCE:ETHUSDT).
Differencing: Enabled by default. This checks the changes in price rather than absolute price, which is crucial for statistical stationarity.
2. Interpreting the Visuals
The script changes the background color and displays a table to indicate the current flow of causality:
Green Background (X → Y): Symbol 1 is leading Symbol 2. Price moves in Symbol 1 are statistically likely to foreshadow moves in Symbol 2.
Orange Background (Y → X): Symbol 2 is leading Symbol 1. The relationship has inverted.
Blue Background (Bidirectional): Both assets are predicting each other (tight coupling or feedback loop).
Gray/No Color: No statistically significant relationship detected.
3. Trading Application
Trend Confirmation: If you trade Symbol Y, wait for the background to turn Green . This indicates that the "Leader" (Symbol X) is currently exerting predictive influence, potentially making trend-following setups on Symbol Y more reliable.
Divergence Warning: If you are trading a correlation pair and the causality breaks (turns Gray), the correlation may be weakening, signaling a higher risk of divergence.
█ SETTINGS
Symbol 1 (X) & Symbol 2 (Y): The two tickers to analyze.
Use Differencing: (Default: True) Converts prices to price-changes. Highly recommended for accurate statistical results to avoid spurious regression.
Calculation Window: The number of bars used to compute the variance and coefficients. Larger windows provide smoother, more stable signals but react slower to regime changes.
Significance Threshold: (0.01 - 0.99) The minimum variance reduction score required to trigger a causal signal.
█ DISCLAIMER
This tool provides statistical analysis of historical price data and does not guarantee future performance. Granger Causality is a measure of predictive capability, not necessarily fundamental causation. Always use appropriate risk management.
IQRIQR Indicator — Simple Notes
Standard IQR: Q1, Q3, IQR = Q3–Q1, bands = Q3 ± 1.5×IQR.
IQR uses last len bars (default 60).
Display uses last N calendar days (default 60), not N bars.
Shows only the recent N-day window unless custom dates are enabled.
With overlay=true, all lines stay on the price axis and scale with candles.
IQR Bands – Date Range VersionQR Indicator — Simple Notes
Standard IQR: Q1, Q3, IQR = Q3–Q1, bands = Q3 ± 1.5×IQR.
IQR uses last len bars (default 60).
Display uses last N calendar days (default 60), not N bars.
Shows only the recent N-day window unless custom dates are enabled.
With overlay=true, all lines stay on the price axis and scale with candles.






















