Bitcoin vs Inverted DXY Regime | Astral Vision Bitcoin vs Inverted DXY Regime | Astral Vision 🌠💠
Inspired by: @JackGreenCrypto
This indicator plots the Z-Score of Bitcoin's log price and the inverted Z-Score of the DXY Dollar Index on the same scale, shifted forward in time by a configurable lag, to visualize the historical inverse relationship between dollar strength and Bitcoin price and to identify divergences between the two series before they resolve in price.
Calculation ⚙️
Both Bitcoin and DXY are first transformed by taking their natural logarithm. Working in log space is essential for two reasons: Bitcoin has moved across several orders of magnitude, so raw price differences between 2015 and 2024 are not comparable; and the inverse relationship between DXY and Bitcoin is proportional rather than linear, meaning a 10% move in DXY has a proportionally similar impact regardless of absolute price level.
The Z-Score is then computed independently for each series using the same formula: subtract the simple moving average of the log series over the lookback window from the current log value, then divide by the standard deviation of the same window. The result for each series is: Z = (log(price) - SMA(log(price), N)) / StDev(log(price), N), where N is the configurable Z-Score lookback. This expresses each series in units of standard deviations above or below its own rolling mean, making the two series directly comparable on the same scale regardless of their absolute price differences.
The DXY Z-Score is then multiplied by -1 to invert it. Since DXY and Bitcoin historically move in opposite directions, the uninverted DXY Z-Score would mirror Bitcoin rather than track it. After inversion, the two series should theoretically overlap or move together during periods of normal inverse correlation. Divergences, where Bitcoin's Z-Score moves in one direction while the inverted DXY Z-Score moves in the other, signal a breakdown in the typical relationship that has historically tended to resolve by one series catching up to the other.
The inverted DXY line is plotted with a configurable forward offset in bars. This operationalizes the observed lag between dollar index movements and their full transmission into Bitcoin price, allowing the DXY signal to be read as a leading indicator rather than a coincident one.
Plots 📊
Bitcoin log Z-Score over the configurable lookback window
Inverted DXY log Z-Score shifted forward by the configurable lag
Inputs 🎛️
Z-Score Lookback: rolling window for mean and standard deviation applied to both series
DXY Lag: bars to shift the inverted DXY signal forward in time
Colors 🎨
5 Astral Vision presets + custom override. Default: Paradiso.
Purpose 🎯
Standard correlation tools between Bitcoin and DXY operate on raw prices or percentage returns, which are distorted by the enormous scale difference between the two assets and by Bitcoin's exponential growth trend. Computing both in log space and normalizing via Z-Score removes these distortions entirely, placing both series on equal statistical footing. The forward shift on the DXY line turns a coincident correlation chart into a directional leading signal: when the inverted DXY is rising ahead of Bitcoin's Z-Score, it suggests dollar weakness is building that has not yet fully priced into Bitcoin, and vice versa.
Disclaimer ⭕️
This indicator is for informational and educational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always do your own research before making investment decisions. Indicator

Indicator

TimeWarp BatmanSPX Batman 1DTE — Strike Signal & Alert Tool
This indicator identifies end-of-day entry conditions for the SPX Batman spread, a two-legged options structure consisting of a long call butterfly placed out of the money above spot and a long put butterfly placed out of the money below spot. Neither fly shares legs. Both are sized and positioned independently.
What the Batman spread is
The Batman is a defined-risk, direction-neutral options trade designed to profit from a pin near expiry. It is not a straddle or strangle. Each leg is a long butterfly. The long call fly is entered OTM above spot at the close, targeting next-day expiry or Monday for Friday entries. The long put fly is entered OTM below spot on the same terms. The structure earns maximum profit if the underlying pins near either body at expiry. Max loss on each fly is limited to the debit paid.
How this indicator works
At 3:55 PM ET each session the indicator calculates proposed strike levels for both flies based on three inputs. Wing width is derived from VIX in dynamic mode or set manually, widening at elevated volatility. Body offset starts at 65 points plus the wing width from spot, rounded to the nearest 5-point SPX strike. Target debit range is calculated from your reward-to-risk inputs. A 1:15 to 1:20 target corresponds to a debit of approximately 4.8% to 6.25% of wing width per fly.
A label fires on the chart at signal time showing all six strike levels, the target debit range in points, and the expiry type. Strike lines remain visible through the next session. If the underlying trades through an outer wing a background highlight fires and a separate alert is available.
How to use it
Add the indicator to a 1-minute or 5-minute SPX chart. At the signal, open your broker's options chain for the next-day expiry. Locate the proposed call fly and put fly strikes. Walk the body strikes up or down in 5-point increments until the actual debit falls within the displayed target range. Enter both flies and manage through expiry.
Set alerts on Batman 1DTE Entry and Batman 3DTE Entry to be notified at signal time without watching the chart.
Inputs
VIX Symbol sets the data source for volatility-based width calculation.
Wing Width Mode switches between dynamic
VIX-scaled sizing and fixed widths of 20, 25, or 30 points.
Fixed Width sets the manual width when not using dynamic mode.
Min Reward to Risk and Max Reward to Risk define the acceptable debit range for each fly, defaulting to 1:15 and 1:20.
Important
This is a signal and visualization tool. It does not model options P&L, implied volatility, or time decay. PulseWire cannot accurately backtest multi-leg options structures and this indicator makes no attempt to do so. All fills, debit verification, and risk management occur in your broker. Past signal frequency is not indicative of future profitability.
Indicator

Indicator

Cadence Reversion Cartography [JOAT]Cadence Reversion Cartography
Introduction
Cadence Reversion Cartography is an open-source mean-reversion and exhaustion overlay designed to locate stretched conditions around an EMA envelope and anchored VWAP framework. It focuses on mapping where price has moved too far from local balance, then grades whether a return toward value has enough supporting evidence to matter.
The problem this script solves is selective reversal timing. Price can stay overextended for longer than expected, so simple band-touch logic is not enough. Cadence Reversion Cartography combines envelope stretch, VWAP stretch, RSI exhaustion, volume impulse, rejection-candle behavior, reclaim logic, and projected response boxes so the user can distinguish weak touches from stronger reversion candidates.
Core Concepts
1. Dual Stretch Model
Price is compared to both an EMA deviation envelope and an anchored VWAP deviation layer. A long-side exhaustion condition requires price to stretch below both lower references. A short-side exhaustion condition requires price to stretch above both upper references.
2. Exhaustion Quality Filters
RSI can require oversold or overbought context, volume can require impulse relative to average participation, and candle structure can require a visible rejection profile.
3. Reclaim And Signal Grading
A setup becomes actionable only after price closes back inside the envelope on a confirmed bar. The script then scores the setup by counting how many filters aligned and promotes stronger signals to a prime grade.
4. Projection Mapping
When a setup forms, the script can draw a forward projection with a risk box, reward box, signal zone, and reclaim line. This is meant to show the structure of the reversion idea rather than acting as a promise of outcome.
Features
EMA reversion envelope: Basis plus statistical deviation bands
Anchored VWAP stretch layer: Secondary value reference around VWAP
RSI exhaustion filter: Optional momentum exhaustion gate
Volume impulse filter: Optional participation confirmation
Rejection-candle filter: Optional candle-structure confirmation
Signal grading: Standard and prime long or short responses
Signal zones and reclaim lines: On-chart response structure around the active setup
Risk and reward projection boxes: Optional forward mapping of stop and target structure
Context candle coloring: Candles can tint with stretch state
Dashboard: Displays stretch, setup bias, and active context
Input Parameters
Reversion Envelope:
Channel Length
Deviation Multiplier
VWAP Stretch Multiplier
Filters And Display:
RSI settings
Volume average and impulse multiplier
Rejection-candle requirement
Projection-box toggle, stop percent, reward multiple, projection length, and signal cooldown
Dashboard, background, candle-color, and signal-zone toggles
How to Use This Indicator
Step 1: Wait for price to stretch beyond both the EMA envelope and the VWAP stretch layer.
Step 2: Check whether RSI, volume, and rejection filters support the move.
Step 3: Wait for confirmed re-entry back inside the envelope instead of fading the first touch.
Step 4: Use the signal grade and projection structure to judge whether the setup is marginal or stronger.
Step 5: Use the basis and reclaim line as the first balance reference after entry.
Indicator Limitations
Strong directional trends can keep price stretched for extended periods and delay reversion
Volume-based confirmation is less meaningful on symbols with irregular volume reporting
Projection boxes are planning tools, not guaranteed outcomes
This script is designed for reversion analysis and is not intended to replace broader trend context
Originality Statement
Cadence Reversion Cartography is original in how it coordinates envelope stretch, VWAP stretch, filter-based exhaustion grading, and forward projection structure inside one reversion workflow. The components are combined to answer one analytical problem: not just whether price is stretched, but whether the stretch is mature enough to support a structured return toward value.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Reversion setups can fail during strong trends or regime expansion, so all signals should be used with independent confirmation and risk management.
-Made with passion by jackofalltrades
Indicator

Opening Range + Session Windows + Volume ProfileOpening Range + Session Windows + Volume Profile
This is a revised repost of my previous script version that trended on the PulseWire community indicators page. The script has been rewritten, renamed, and cleaned up so the publication follows PulseWire House Rules more closely.
The goal of this indicator is to make intraday session structure easier to read from one chart.
Opening range levels can be useful, but they are much more useful when viewed with nearby volume-based context. A move away from the opening range is not always the same type of move. It can be moving into an area where volume previously built, away from an area where volume was thin, or toward a level where participation has already concentrated.
This script is built to help show that context visually.
📊 What the script shows
• Opening range high, low, and range box
• Configurable session windows
• Current session volume profile
• Previous session volume profile
• POC, HVN, and LVN levels
• Live and prior session node labels
• A terminal-style HUD for session state, trend, range size, POC, HVN, LVN, and impulse counts
• A pressure meter based on session volume standard deviation
• Filtered buy-volume and sell-volume impulse labels
🧠 Why it was built this way
The script is designed around one main idea: the opening range should not be viewed in isolation.
A breakout, rejection, or rotation around the opening range can look completely different depending on where volume is sitting around price. If price is moving into a high-volume area, that can suggest a different type of environment than price moving through a thinner low-volume area. If a prior POC or volume node is nearby, that may also change how a trader studies the move.
This indicator does not try to replace analysis. It simply brings the important intraday structure into one clean visual layout so the user can study the session with more context.
⚙️ How to use it
1. Set the main session and opening range times in the settings.
2. Use the opening range box to mark the first part of the session.
3. Watch how price behaves around the current and prior volume nodes.
4. Use POC, HVN, LVN, and session levels as structure references.
5. Use the HUD to quickly read session state, trend, range size, and active nodes.
6. Use the volume gauge and impulse labels to study stronger participation events.
7. Adjust the session windows to match the market and timezone you trade.
🔁 Current vs prior levels
Live session levels are labeled as LIVE .
Previous session levels are labeled as PRIOR .
This makes it easier to separate developing session structure from levels carried forward from the last completed session.
⚡ Volume impulse labels
The volume impulse labels are intentionally filtered. They are not meant to appear on every volume increase. The script only prints them when participation is stronger than normal based on the selected settings.
This helps keep the chart cleaner and prevents the indicator from turning into a label-heavy mess.
🕒 Session windows
The session windows are visual time references only. They are fully configurable from the settings and can be adjusted, enabled, or disabled depending on the market being viewed.
⚠️ Important notes
This is not a trading system.
This script does not place trades, issue alerts to buy or sell, provide financial advice, or tell the user what action to take. It is a decision-support tool for studying intraday structure, volume location, session context, and participation.
FOR PINECODERS TEAM: Promotional references, branding, and unclear wording have been removed, and this description has been expanded so users can understand the purpose of the tool without needing to read the Pine code. I cannot, within reason, direct users any further regarding specific use of this indicator as to avoid providing any form of financial advice. It is a framework tool for various use-cases outlined above.
The user is responsible for their own analysis, risk management, and execution decisions.
✅ Best used on
Intraday charts where opening range structure and volume context matter, including index futures, stocks, ETFs, and other liquid instruments with meaningful volume data. Indicator

Percentile SD OscillatorPercentile SD Oscillator
Percentile SD Oscillator is a momentum oscillator that measures the distance between price and its own dynamic reference levels — derived from percentile bands and a volatility-adjusted standard deviation filter. Rather than using fixed overbought/oversold levels, it continuously adapts to recent price behavior and only confirms a directional state when price demonstrates genuine statistical strength beyond its own boundaries.
The result is a histogram that oscillates around a zero line — positive and blue when the market is in a confirmed bullish state, negative and red when bearish.
How It Works
A moving average of your choice is calculated on a configurable source and length. Two percentile bands are then derived from this MA — an upper band and a lower band — defining the statistical range of recent price behavior.
A standard deviation of the close price is then calculated and added to the lower percentile band, creating a volatility-adjusted long reference level called sd_long. Price must close above both the upper percentile band AND sd_long to confirm a long — requiring double confirmation before entering a bullish state.
For the short side, a simple and fast condition is used — price only needs to close at or below the lower percentile band. Once a short state is confirmed, the oscillator measures the distance between the close price and the upper percentile band plus standard deviation as the bearish momentum value.
An EMA of the oscillator value acts as a confluence filter — the final signal only confirms when the oscillator is not only positive or negative but also above or below its own EMA. This ensures the oscillator only shows a confirmed state when momentum is genuinely building in that direction.
Why This Approach Works
Most momentum oscillators use fixed thresholds that do not adapt to changing market conditions. By combining percentile bands with a close-based standard deviation filter, the Percentile SD Oscillator requires price to break beyond levels that are dynamically calculated from both recent price structure and current volatility.
The asymmetric design between long and short is intentional and reflects the structural reality of markets like crypto. Longs require double confirmation — price must clear both the upper percentile band and the volatility-adjusted SD level — ensuring only genuinely strong bullish moves trigger an entry. Shorts are deliberately simpler and faster — price only needs to break below the lower percentile band, allowing quick exits when support is lost. This asymmetry prevents premature long entries while ensuring fast risk-off behavior when the market weakens.
The bullish momentum is measured against the lower percentile band — this captures how far price has risen above its support zone, giving a direct measure of bullish momentum strength. The bearish momentum is measured against the upper percentile band plus standard deviation — this creates a wider reference that captures how far price has fallen from the resistance zone, giving a more meaningful picture of bearish momentum strength.
Settings
MA Type — Moving average type used as the basis for the percentile calculation: DEMA, EMA, SMA, WMA, HMA, RMA (default: DEMA)
MA Length — Lookback period for the moving average (default: 8)
MA Source — Price source for the moving average calculation (default: high)
Percentile Length — Lookback period for the percentile band calculation (default: 57)
Percentile Up — Upper percentile threshold defining the bullish boundary (default: 60)
Percentile Down — Lower percentile threshold defining the bearish boundary (default: 46)
SD Length — Lookback period for the standard deviation calculation (default: 19)
SD Multiplier — Controls the strength of the standard deviation filter. Set to 0 to disable the SD filter entirely (default: 1.0)
EMA Length — Lookback period for the EMA confluence filter (default: 48)
Background Transparency — Controls the transparency of the optional background color (default: 85)
Color Background — Enables background coloring of the chart based on the current state (default: false)
Use Bar Coloring — Colors bars based on the current state (default: true)
How to trade it
Long — when the histogram turns blue and rises above zero, a bullish state has been confirmed. This is the signal to look for long entries or to hold existing long positions
Short / Cash — when the histogram turns red and falls below zero, the bearish state has been confirmed. This is the signal to exit longs, move to cash, or look for short entries depending on your strategy
Avoid trading against the signal — if the histogram is red do not look for longs, if it is blue do not look for shorts
The EMA line acts as a dynamic reference — when the histogram is above the EMA momentum is building, when it crosses below the EMA momentum is weakening
Recommended Usage
Best used on the 1D timeframe for clean and reliable signal generation
Should not be used alone for trade entries — combine with a trend-following indicator for best results
Set SD Multiplier to 0 to rely solely on the percentile bands — useful when you want more frequent signals in trending markets
Higher SD Multiplier values increase signal quality at the cost of fewer signals — lower values make the indicator more reactive
The asymmetric design makes this oscillator particularly well suited for bullish-biased markets like crypto — long entries require double confirmation while short exits are fast and decisive
All signals are confirmed on bar close. Indicator

Bitcoin Transaction Fees Z-Score | Astral Vision Bitcoin Transaction Fees Z-Score | Astral Vision 🌠💠
Transaction fees are one of the most direct expressions of genuine on-chain demand pressure. When users compete to get transactions confirmed, fees spike and historically those spikes have aligned tightly with late-stage cycle euphoria. Conversely, fee compression marks periods of network inactivity that have repeatedly preceded major accumulation opportunities.
This indicator standardizes total Bitcoin transaction fees (USD) in log space over a configurable lookback window, producing a Z-Score that exposes statistically extreme deviations from the long-term fee baseline, both to the upside and the downside.
Calculation ⚙️
`Z = (log(SMA(Total Fees USD, smooth)) − SMA(log_fees, length)) / StdDev(log_fees, length)`
Total on-chain fees in USD are first smoothed by a short SMA to reduce daily noise, then transformed into log space before standardization. The Z-Score measures how many standard deviations the current fee level sits above or below its long-term mean, compressing Bitcoin's exponential fee growth into a cycle-comparable signal.
Plots 📊
Z-Score line, colored by active regime (positive, negative, or neutral)
Extreme High threshold line (default 2.5)
Low threshold line (default −1.35)
Fill between Z-Score and Extreme High threshold when breached (distribution zone)
Fill between Z-Score and Low threshold when breached (accumulation zone)
Candle coloring on the price chart by active regime
Background highlight on the price chart when either threshold is active
Inputs 🎛️
`Z-Score Length (days)`: lookback window for mean and standard deviation calculation (default 730)
`Smooth Input (days)` : SMA applied to raw fee data before log transformation (default 7)
`Extreme High Threshold` : Z-Score level marking fee-driven distribution zones (default 2.5)
`Low Threshold` : Z-Score level marking fee-driven accumulation zones (default −1.35)
Colors 🎨
5 Astral Vision presets + custom override. Default: Futura. Positive color activates below the Low threshold; negative color activates above the Extreme High threshold; neutral applies between thresholds.
Purpose 🎯
Raw fee charts are dominated by Bitcoin's exponential price growth, making cycle-to-cycle comparison visually meaningless. Standard fee indicators plot absolute values with no statistical context, offering no signal on whether current fees are elevated or compressed relative to historical norms.
This indicator solves both problems: log transformation removes the exponential trend, and Z-Score standardization makes every cycle directly comparable regardless of Bitcoin's price magnitude. The result is a clean, threshold-driven signal that identifies when fee demand has reached statistically extreme levels, either as a distribution warning or an accumulation opportunity, directly overlaid on the price chart through candle and background coloring.
Disclaimer ⭕️
It is not financial advice, not an investment recommendation, and not affiliated with any financial institution, research firm, or organization of any kind. All content is provided for educational and informational purposes only. Always conduct your own research before making any financial decision. Indicator

MSL Squeeze Pulse**MSL Squeeze Pulse** is a volatility-compression and momentum indicator. It highlights when the market is winding up before an explosive move and shows the direction once the spring uncoils.
### What you see
- **Yellow background on the pane** — the market is currently in compression. Price is tightening, volatility is fading, movement stalls. The longer the yellow stays on, the larger the expected breakout.
- **Yellow diamond on the zero line** — the bar where the coil unwinds. Compression has ended, a new move begins.
- **Pulse histogram** — direction and pace of the move:
- filled green = up, accelerating
- hollow green = up, fading
- filled red = down, accelerating
- hollow red = down, fading
- **Dots on the zero line** — current volatility state: yellow = coiled, gray = expanded, blue = neutral.
### How to use
This is a context tool, not a stand-alone signal. The yellow zone is your cue to prepare: pick the setup, mark levels, wait for direction. When the tint clears and the diamond appears, look at the histogram color — that's the direction the coil released into.
On a strong trend the histogram stays solidly filled. The first hollow bars are an early warning that momentum is fading.
### Alerts (optional)
Via PulseWire's Add Alert dialog you can set push/email notifications:
- **Coil On** — compression has started
- **Coil Released** — the spring uncoiled
- **Pulse Flip Up / Down** — pulse changed sign
Alerts are notifications only — nothing is drawn on the chart. The indicator does NOT produce BUY/SELL arrows.
### Suggested timeframes
- Intraday: 15m – 4h
- Swing: 1D – 1W
### Settings
- **Volatility Length / Mult** — standard-deviation band parameters. Wider band = rarer coils.
- **Channel Length / Mult** — bar-range channel parameters. Wider channel = more frequent coils.
- **Use True Range** — use True Range instead of high − low (handles gaps). Indicator

Asymmetric Volatility Trend Line [QuantAlgo]🟢 Overview
Asymmetric Volatility Trend Line is a trend-following indicator built on adaptive standard deviation thresholds rather than fixed bands or moving average crossovers. It quantifies the statistical volatility of recent price movement to determine asymmetric conditions for trend continuation versus trend reversal, then uses those conditions to anchor a dynamic trend line that adjusts position in response to confirmed directional moves, helping traders distinguish between genuine breakouts and noise-driven fluctuations across every timeframe and market.
🟢 How It Works
The foundation of the indicator is a rolling standard deviation applied to the selected price source over a configurable lookback window, scaled by a threshold multiplier to produce the volatility boundary used in all trend logic:
vol_threshold = ta.stdev(src, lookback) * threshold_mult
This threshold is intentionally asymmetric in application. When the trend line is in a bullish state, a smaller fraction of the threshold (0.5x) is required for price to confirm continuation, while a full threshold breach in the opposite direction is needed to trigger a reversal. The same asymmetry applies in reverse during bearish states:
if trend_dir >= 0
if src > trend_line + vol_threshold * 0.5
trend_line := math.max(trend_line, src - vol_threshold * 0.25)
trend_dir := 1
else if src < trend_line - vol_threshold
trend_line := src + vol_threshold * 0.25
trend_dir := -1
This design means continuation requires less evidence than reversal. A directional move only needs to exceed half the volatility threshold to sustain the current trend, but must overcome the full threshold to flip it. The 0.25x offset applied when repositioning the trend line keeps it anchored within the volatility envelope rather than jumping directly to price, producing a smoother line that does not overreact to a single bar.
When a reversal is confirmed, the trend line is placed on the opposite side of price at a quarter-threshold distance, giving it room to develop without immediately triggering another flip:
trend_line := src + vol_threshold * 0.25 // repositioned on bearish flip
trend_dir := -1
Direction state is tracked through two integer variables, with reversal conditions derived from comparing the current and prior bar states:
turned_bullish = trend_dir == 1 and trend_dir == -1
turned_bearish = trend_dir == -1 and trend_dir == 1
is_reversal = trend_dir != prev_dir and bar_index > 0
🟢 Signal Interpretation
▶ Bullish Trend (Green): When price closes above the trend line by more than half the volatility threshold, the indicator enters bullish mode with green colouring applied across the trend line, gradient fill, and reversal marker (⦿). This state persists until price closes below the trend line by the full volatility threshold, allowing normal pullbacks to occur without triggering a direction change.
▶ Bearish Trend (Red): When price closes below the trend line by more than half the volatility threshold, the indicator enters bearish mode with red colouring across all visual elements. A full threshold breach to the upside is required to exit this bearish state.
🟢 Features
▶ Preconfigured Presets: Three parameter sets cover different trading approaches. "Default" targets swing trading on 4-hour and daily charts with moderate threshold sensitivity. "Fast Response" reduces the volatility barrier and shortens the lookback for intraday charts where the indicator needs to adapt to shorter-duration moves. "Smooth Trend" raises the reversal threshold substantially for position trading on daily and weekly timeframes, where the cost of a false flip is higher than the cost of a delayed one. Selecting a preset overrides the individual multiplier and lookback inputs.
▶ Built-in Alerts: Three alert conditions cover all directional states. "Bullish Trend Signal" fires on the bar where the trend direction flips from bearish to bullish. "Bearish Trend Signal" fires on the bar where it flips from bullish to bearish. "Any Trend Change" combines both into a single condition for traders who want a unified notification regardless of direction.
▶ Visual Customisation: Six colour presets (Classic, Aqua, Cosmic, Cyber, Neon, and Custom) apply coordinated bullish and bearish colour schemes across the trend line, gradient fill, reversal markers, and optional bar and background colouring. Bar colouring tints price candles with the active trend colour at a configurable transparency level, and background colouring extends the directional tint across the full chart pane. Both are disabled by default and controlled independently.
Indicator

Median ATR TrendMedian ATR Trend
Median ATR Trend is a trend-following indicator that identifies the dominant market direction using a percentile-based median combined with an ATR buffer and a standard deviation filter — confirming trend changes only when price shows genuine strength beyond its own statistical boundaries.
The result is a dynamic line that moves with the market — sitting above price in a bullish trend and below price in a bearish trend, with a fill between the line and price for clear visual trend identification.
How It Works
A moving average of your choice is calculated on a configurable source and length. The median of this MA is then derived using a percentile calculation — giving a robust, noise-resistant central reference level that adapts to recent price behavior.
Two independent filters then validate whether a trend change is genuine:
ATR buffer — the ATR defines a zone around the median. For longs, price must stay above the lower boundary of this zone — if price drops too far below the median the long condition fails. For shorts, price must fall below the upper boundary of this zone — meaning the bullish momentum has faded and price has re-entered the median zone from above. The ATR Multiplier controls how wide this zone is — higher values create a wider zone and fewer signals, lower values make the indicator more sensitive
Standard deviation filter — price must additionally clear the upper standard deviation band of the median before a long is confirmed, ensuring only statistically significant moves trigger an entry
A confirmation mechanism requires both conditions to hold for a defined number of bars before the trend state changes — separately configurable for long and short signals. This prevents the indicator from reacting to brief spikes that immediately reverse, keeping the trend state stable and reducing false signals in choppy market conditions.
By default the indicator is asymmetric — longs require SD confirmation while shorts only require the ATR condition. This means the long side is stricter and more selective, while the short side reacts faster to any weakness. Enabling the Short SD Filter makes the short condition equally strict, requiring price to additionally break below the lower standard deviation band before confirming a bearish trend — making both sides symmetric.
In markets like crypto that have a strong structural bullish bias, the default asymmetry makes a lot of sense — price spends significantly more time trending upward than downward. A strict long condition ensures only genuine bullish moves are entered, while a fast short condition allows quick exits when momentum fades. Enable the Short SD Filter in ranging or bearish markets where you want both sides to require the same level of statistical confirmation before triggering.
Why This Approach Works
Most trend indicators use fixed levels or simple moving average crossovers that trigger on any price touch — even weak or noise-driven ones. By combining a percentile-based median with two independent volatility filters, Median ATR Trend requires price to demonstrate genuine statistical strength before confirming a trend. Minor retracements and noise-driven spikes around the median are ignored — only moves with real conviction behind them trigger a signal.
Settings
MA Type — Moving average type used as the basis for the median calculation: DEMA, EMA, SMA, WMA, HMA, RMA (default: DEMA)
MA Length — Lookback period for the moving average (default: 9)
MA Source — Price source for the moving average calculation (default: close)
Median Length — Lookback period for the percentile median calculation (default: 61)
ATR Length — Lookback period for ATR calculation (default: 12)
ATR Multiplier — Controls the size of the ATR buffer. Set to 0 to disable the ATR filter entirely (default: 0.5)
SD Length — Lookback period for standard deviation calculation (default: 29)
SD Multiplier Long — Controls the strength of the standard deviation filter for long signals. Set to 0 to disable (default: 1.0)
Use Short SD Filter — Enables a symmetric standard deviation filter for short signals, matching the long side. When disabled the indicator is asymmetric by default — longs require SD confirmation, shorts do not (default: false)
SD Multiplier Short — Controls the strength of the standard deviation filter for short signals when enabled (default: 1.0)
Long Confirmation Bars — Number of bars the bullish condition must hold before confirming (default: 1)
Short Confirmation Bars — Number of bars the bearish condition must hold before confirming (default: 1)
Use Bar Coloring — Colors bars based on the current trend state (default: true)
How to trade it
Long — when the line turns blue and the fill appears above price, a bullish trend has been confirmed. This is the signal to look for long entries or to hold existing long positions
Short / Cash — when the line turns red and the fill appears below price, the bullish structure has broken down. This is the signal to exit longs, move to cash, or look for short entries depending on your strategy
Avoid trading against the trend — if the line is red do not look for longs, if the line is blue do not look for shorts
Recommended Usage
Best used on the 1D timeframe for clean and reliable trend identification
Should not be used alone for trade entries — combine with a momentum or volume indicator for confirmation
Set SD Multiplier Long to 0 to rely solely on the ATR filter — useful in trending markets where the SD filter may delay entries
Keep the Short SD Filter disabled for bullish or trending markets — the default asymmetry keeps long entries strict while allowing fast exits when momentum fades
Enable the Short SD Filter in ranging or bearish markets where you want both sides to require the same level of statistical confirmation before triggering
Higher ATR Multiplier values increase signal quality at the cost of fewer signals — lower values make the indicator more reactive
Higher Confirmation Bar values reduce false signals at the cost of slightly later entries — useful in choppy or ranging markets
Swing trading — the confirmation mechanism keeps the indicator stable during pullbacks, allowing you to hold through minor retracements without being shaken out prematurely
Breakout trading — the combination of ATR buffer and SD filter ensures you only act on genuine breakouts with real momentum behind them
All signals are confirmed on bar close. Indicator

Adaptive RSI ZScoreAdaptive RSI ZScore
Adaptive RSI ZScore is a normalized momentum oscillator that measures the statistical deviation of the RSI from its own moving average, expressed as a Z-Score. Rather than reading momentum on an absolute scale like traditional RSI, it shows how unusual the current momentum state is relative to its own historical behavior — making it self-adjusting across different market conditions.
The result is an oscillator that turns blue when momentum is unusually strong and red when momentum is unusually weak — always relative to its own recent history, not fixed overbought/oversold levels.
How It Works
The RSI is calculated on a configurable source and length. A moving average of the RSI is then computed using a separately configurable MA length and type — allowing the smoothing behavior to be tuned independently from the RSI calculation itself. The Z-Score is derived from the difference between the RSI and its moving average, normalized by the standard deviation of the RSI.
When the Z-Score crosses above the Long Threshold a bullish state is confirmed. When it crosses below the Short Threshold a bearish state is confirmed. The state persists until the opposite condition is met.
Why Dynamic Thresholds Matter
Fixed thresholds work well in stable market conditions but struggle in highly volatile environments — a Z-Score move that would be significant in a calm market may be completely normal during high volatility. The Dynamic Threshold feature solves this by automatically adjusting the Long and Short thresholds based on the current standard deviation of the Z-Score itself. This means the indicator always requires an equally significant statistical deviation to trigger a signal, regardless of how volatile the market currently is.
This makes the indicator particularly well suited for volatile assets where market conditions shift frequently and fixed thresholds would quickly become unreliable. By default Dynamic Thresholds are enabled. They can be disabled in favor of fixed manual thresholds if preferred.
Settings
RSI Length — Lookback period for RSI calculation (default: 39)
MA Length — Lookback period for the moving average and standard deviation (default: 37)
Source — Price source for RSI calculation (default: open)
MA Type — Moving average type used to calculate the RSI mean: SMA, EMA, WMA, RMA, HMA, VWMA (default: SMA)
Long Threshold — Z-Score level for bullish confirmation when dynamic thresholds are disabled (default: 0.85)
Short Threshold — Z-Score level for bearish confirmation when dynamic thresholds are disabled (default: -1.71)
Use Dynamic Thresholds — Enables adaptive thresholds based on Z-Score standard deviation (default: true)
Long SD Multiplier — Controls the sensitivity of the dynamic long threshold (default: 1.1)
Short SD Multiplier — Controls the sensitivity of the dynamic short threshold (default: 1.3)
Use Bar Coloring — Colors bars based on the current state (default: true)
Color Background — Colors the chart background based on the current state (default: false)
Background Transparency — Controls the transparency of the background color (default: 85)
How to trade it
Long — when the oscillator turns blue the momentum state is statistically unusually strong. This is the signal to look for long entries or to hold existing long positions
Short / Cash — when the oscillator turns red the momentum state has weakened significantly. This is the signal to exit longs, move to cash, or look for short entries depending on your strategy
Avoid trading against the signal — if the oscillator is red do not look for longs, if it is blue do not look for shorts
Recommended Usage
Best used on the 1D timeframe — the statistical deviation signals are cleaner and more reliable on higher timeframes where noise is reduced
Designed to be used as a confirmation filter alongside a trend-following indicator — it identifies statistically significant momentum shifts that support or contradict the prevailing trend
Should not be used alone for trade entries — combine with a structural or trend filter for best results
Separating RSI Length and MA Length allows fine-tuning of signal sensitivity independently from smoothing behavior
Dynamic Thresholds are recommended for volatile markets and assets — disable them for more stable and predictable signals
Use the Long and Short SD Multipliers to control how extreme the momentum deviation must be before a signal fires — higher values mean fewer but higher quality signals
All signals are confirmed on bar close. Indicator

Structural Deviation Compass [JOAT]Structural Deviation Compass
Introduction
The Structural Deviation Compass is an overlay indicator designed to map where price stands relative to its own statistical history. Rather than drawing fixed-distance envelopes or relying on a single moving average, it constructs a hybrid centerline from two distinct low-lag moving average types, then wraps that centerline in volatility-adaptive bands derived from Z-score normalization. A secondary oscillator layer — applied to RSI — creates a dual-confirmation signal gate that fires only when both price deviation and momentum reach simultaneous extremes. Shadow bands built from the Average True Range provide additional spatial context across three volatility tiers.
The indicator does not predict future price. It identifies statistically unusual deviations from an estimated mean structure and flags conditions where a reversion or continuation setup may be forming, subject to confirmation from the trader's own process.
Core Concepts
The ComboMA Centerline
The foundation of the indicator is a composite moving average called the ComboMA, formed by averaging two lines:
ALMA (Arnaud Legoux Moving Average): Uses a Gaussian-weighted kernel positioned asymmetrically along the lookback window. The offset and sigma parameters control how far toward the recent end the weight mass sits and how tightly it is concentrated. This produces a smooth line that tracks price closely while suppressing noise better than a simple EMA of the same length.
ZLMA (Zero-Lag Moving Average): Constructed by doubling a base EMA and subtracting a second EMA of that EMA — a technique that estimates and removes the inherent lag of an exponential average. The result is then smoothed once more to reduce the noise amplification that zero-lag constructions can introduce.
Averaging the two produces a centerline that carries reduced lag from the ZLMA side while retaining the smooth, noise-filtered character of the ALMA side. Neither line alone fully satisfies both goals; together they produce a more balanced result.
Z-Score Price Bands
Rather than plotting bands at a fixed multiple of a standard deviation (as Bollinger Bands do using a rolling standard deviation of price itself), the SDC first computes the deviation of close from the ComboMA, then Z-score normalizes that deviation series over a separate lookback window. The bands are then placed back on the price chart by multiplying the rolling standard deviation of deviations by the chosen Z-score threshold values.
The practical effect is that the band width reflects how unusual the current deviation is relative to the recent distribution of deviations — not simply how wide price has swung in a raw sense. Two threshold levels are provided, creating an inner and outer band pair on each side of the ComboMA.
RSI Z-Score
RSI is computed in the standard way, then subjected to the same Z-score normalization: the RSI value is compared to its own rolling mean and expressed in standard deviations. This removes the fixed-level bias of RSI (where 30/70 thresholds mean different things in different market regimes) and produces a momentum reading that is self-calibrating to recent RSI behavior.
Dual Z-Score Signal Gate
A long signal requires all of the following simultaneously:
Price Z-score below the negative trigger threshold (price is statistically far below the ComboMA)
RSI Z-score below the negative trigger threshold (momentum is statistically depressed)
RSI EMA below 38 (confirming a bearish momentum context rather than a pullback within strength)
The current bar closed above the prior bar's close (a micro-confirmation that selling pressure may be easing)
The bar is confirmed (signal does not repaint on the forming bar)
Short signals apply the mirror logic. The requirement for extremes in both dimensions simultaneously is intentionally strict — it filters out the many cases where price is extended but momentum is not, or vice versa.
ATR Shadow Bands
Three pairs of shadow bands are drawn around the ComboMA at 1x, 2x, and 3x of a rolling ATR. These are not signal bands — they serve as a spatial reference, helping to contextualize how far price has traveled from the estimated mean in volatility-adjusted terms. A move to the 3x ATR shadow in a low-volatility environment carries different significance than the same move in a high-volatility environment.
RGB Smooth Color Transition
The ComboMA line color transitions smoothly between a bull and bear palette by independently blending the red, green, and blue channels via EMA. Each channel tracks a target value set by the current bull/bear state, and converges toward it gradually. This avoids abrupt color flips and gives a visual sense of momentum continuity.
Gradient Bar Coloring
Individual bars are colored based on where the close sits within the band range relative to the ComboMA. Bars near the upper bands trend toward the bull color; bars near the lower bands trend toward the bear color. Bars near the ComboMA receive a neutral tone. This is a visual aid only and does not constitute a signal.
Information Table
A 9-row table displays the current readings for: market regime, price Z-score, RSI Z-score, RSI EMA, band width, signal strength, active signal, and ComboMA value. This gives a snapshot of the indicator's internal state without requiring the trader to hover over each plotted element.
---
Features
Hybrid ComboMA centerline combining ALMA and ZLMA
Volatility-adaptive Z-score bands at two threshold levels (inner and outer)
RSI Z-score normalization for regime-independent momentum reading
Dual Z-score signal gate requiring simultaneous extremes in price and momentum
Three-layer ATR shadow bands for spatial volatility context
Smooth RGB channel blending on the ComboMA line color
Gradient bar coloring based on position within band range
Real-time information table with 9 indicator state readings
Non-repainting signals (barstate.isconfirmed)
Fully toggleable visual components
---
Input Parameters
MA Length: Base length for the ZLMA and ATR calculations
ALMA Offset: Controls asymmetric weight positioning within the ALMA window (0 = old end, 1 = recent end)
ALMA Sigma: Controls weight concentration; lower values spread the weight, higher values tighten it
Z-Score Lookback: Rolling window for computing the mean and standard deviation of price deviations (default: 50)
Inner Band Threshold: Z-score level for the inner band pair (default: 1.5σ)
Outer Band Threshold: Z-score level for the outer band pair (default: 2.5σ)
RSI Length: Period for RSI calculation (default: 14)
RSI Z-Score Lookback: Rolling window for normalizing RSI
Signal Trigger: Z-score threshold required in both dimensions to generate a signal (default: 1.8σ)
ATR Multipliers: Multipliers for the three shadow band tiers (1x, 2x, 3x)
Visual Toggles: Individual on/off controls for bands, shadows, bar coloring, table, and signals
---
How to Use
Reading the centerline: The ComboMA acts as the estimated mean structure. Price consistently above it with a bull-colored line suggests sustained upward bias; price oscillating around it suggests a ranging environment.
Reading the bands: The inner bands (±1.5σ by default) represent moderately unusual deviations. The outer bands (±2.5σ by default) represent statistically rare deviations. A touch or breach of the outer band does not by itself mean a reversal is due — it means the move is statistically uncommon and warrants attention.
Reading the shadow bands: Use the ATR shadows to understand how far, in volatility-adjusted terms, price has moved from the ComboMA. Price at the 3x shadow while also at the outer Z-score band is a more notable condition than either reading alone.
Acting on signals: The dual Z-score signals flag confluent extremes. They should be used as an alert layer within a broader trading framework — not as standalone entry triggers. Consider the broader trend context, the timeframe, and supporting structure before acting.
Using the table: Monitor the signal strength reading to understand how close the current state is to triggering a signal. This is useful for watching a developing setup in real time.
Timeframe notes: The indicator functions on any timeframe. Higher timeframes produce fewer but more structurally significant signals. Lower timeframes will produce more signals, many of which will be noise. Adjust the Z-score lookback and trigger threshold accordingly.
---
Limitations
This indicator does not predict future price movement. All readings are descriptive of past and current bar data.
The ComboMA, like all moving averages, will lag price during sharp trend changes. The ZLMA component reduces but does not eliminate this lag.
Z-score bands assume that price deviations are approximately normally distributed. In instruments with fat-tailed distributions or during extreme events, the statistical thresholds will underestimate the probability of outlier moves.
Signals are non-repainting on confirmed bars but will update on the forming bar until it closes. Always wait for bar close before acting on a signal.
A signal firing does not mean price will reverse. Trending markets can sustain extreme Z-score readings for extended periods.
The RSI EMA threshold (38 for longs) is a fixed filter that may not suit all instruments or regimes. It should be adjusted or disabled if it is filtering out valid setups in the instrument being traded.
The ATR shadow bands are informational only and carry no predictive weight.
Past signal performance on a given instrument is not indicative of future performance.
---
Originality Statement
The ALMA and ZLMA are established concepts. The ComboMA is not either of them — it is a blended centerline that takes the asymmetric-weight smoothness of ALMA and the lag-reduction property of ZLMA and produces a composite that neither achieves individually. The Z-score normalization of price deviations is a statistical adaptation that makes the bands self-calibrating to the instrument's deviation distribution rather than fixed. Applying the same normalization independently to RSI produces a momentum reading that is self-referential to recent RSI behavior rather than anchored to universal threshold levels. The signal gate that requires simultaneous Z-score extremes in both price deviation and RSI — not one or the other — creates a logical AND condition that is substantially stricter than conventional oscillator crossovers or single-band-touch triggers. The three ATR shadow tiers, smooth RGB color blending, and gradient bar coloring are supporting visual constructs that serve interpretation rather than adding trading logic. The combination of these elements into a single overlay tool — ComboMA centerline, adaptive Z-score bands, normalized momentum gate, ATR spatial context, and state table — represents an original integration not replicated by any standard built-in indicator.
---
Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice, investment advice, or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Past performance of any indicator or strategy is not indicative of future results. Always conduct your own research and consult a qualified financial professional before making any trading decisions.
-Made with passion by officialjackofalltrades
Indicator

Indicator

Indicator

Anchored Regression Oracle [JOAT]Anchored Regression Oracle
Introduction
Linear regression is one of the most powerful tools in statistical analysis, yet its application in most trading indicators is limited to a fixed rolling window applied to closing prices — a single-dimensional view of a multi-dimensional problem. The Anchored Regression Oracle extends classical Ordinary Least Squares regression in four distinct ways: it supports both logarithmic and linear price scaling, it offers multiple anchor modes (fixed bar count or calendar-period anchoring), it computes a full set of deviation, Fibonacci, and extreme projection levels above and below the regression line, and it incorporates the Pearson R correlation coefficient and theta angle as real-time quality metrics that control signal eligibility.
The fundamental insight motivating the log/linear duality is that financial prices grow multiplicatively, not additively. A $10 move from $100 is a 10% change; a $10 move from $1000 is a 1% change. Fitting a straight line through raw prices on a linear scale treats these as equivalent. Fitting through log-transformed prices treats them as proportionally equivalent — and for equities, cryptocurrencies, and other compounding instruments, the log-space regression is often the more meaningful representation of trend. The indicator handles both cases transparently, transforming all calculation into log space when selected and back-transforming all output levels to price space for display.
The calendar anchoring system adds a dimension that pure bar-count indicators cannot provide: the ability to reset and recalculate the regression window at the start of each new trading day, week, month, or other period — automatically. This makes the regression channel contextually anchored to the current period's price action rather than an arbitrary historical bar count, without any manual intervention.
Core Concepts
1. Manual OLS Linear Regression
The indicator implements the full Ordinary Least Squares regression formula manually rather than using Pine Script's built-in ta.linreg(). This is a deliberate choice: the manual implementation supports both logarithmic transformation and expanding anchor windows, neither of which the built-in function accommodates. The calculation accumulates bar-level sums across the current window to derive the exact OLS slope and intercept.
slope = (n * sumXY - sumX * sumY) / (n * sumXX - sumX * sumX)
intercept = (sumY - slope * sumX) / n
lrValue = intercept + slope * n
Where n is the current window size, sumXY is the sum of bar-index times price products, sumXX is the sum of squared bar indices, and sumX and sumY are the simple sums of indices and prices respectively. In log mode, all price values entering the sums are first transformed via math.log(), and all output levels are back-transformed via math.exp() before rendering on the chart.
2. Pearson R Correlation Coefficient
After computing slope and intercept, the Pearson R coefficient is derived from the same accumulated sums. R measures the linearity of the relationship between bar index and price — essentially, how well the regression line fits the actual price path. Values near 1.0 or -1.0 indicate strong linear trends where the regression line is a reliable representation. Values near 0 indicate that price is moving chaotically relative to a linear model.
dxt = sumXX - sumX * sumX / n
dyt = sumYY - sumY * sumY / n
pearsonR = (sumXY - sumX * sumY / n) / math.sqrt(dxt * dyt)
The dashboard displays Pearson R with color coding: teal for |R| ≥ 0.8 (strong fit), orange for |R| ≥ 0.5 (moderate fit), red for |R| below 0.5 (weak fit). When the Pearson filter is enabled, only readings with |R| above the user threshold are eligible for signal generation — preventing trades on regression lines that do not actually describe the price behavior.
3. Theta Angle
The slope of the regression line is an abstract mathematical quantity that is not intuitively interpretable. Converting it to a theta angle using the arctangent function produces a human-readable degree value: a steeply rising trend shows a large positive angle, a flat trend shows near-zero degrees, and a declining trend shows a negative angle. The minimum theta filter allows users to exclude signals from very shallow trends — requiring a minimum degree of directional conviction before entries are considered.
theta = math.atan(-slope) * 180 / math.pi
Note that the negative sign before slope accounts for the inversion between mathematical y-axis convention (upward) and screen y-axis convention (downward in most chart implementations), ensuring the displayed angle intuitively matches the visual slope direction on the chart.
4. Window Modes: Rolling vs. Anchored
The "Bar" mode uses a fixed rolling window of N bars — the regression line covers exactly the last N candles regardless of calendar position. All period-based modes ("Minute", "Hour", "Day", "Week", "Month") use an expanding anchor: a bar counter resets to zero each time a new period begins (detected via timeframe.change()), and the regression window expands from that anchor point through the current bar. This means on day anchoring, the regression always describes the current day's price action from the first bar to now — expanding as the day progresses and resetting at the start of each new day.
var int windowBars = 0
periodChanged = timeframe.change(targetTF)
windowBars := periodChanged ? 1 : windowBars + 1
effectiveLen = windowMode == "Bar" ? barLen : windowBars
5. Deviation and Fibonacci Projection Levels
Six lines are drawn on the chart, all updated on barstate.islast to avoid performance overhead. The center line is the regression line itself. The upper and lower deviation lines are offset by user-configurable standard deviation multiples. A Fibonacci level is plotted at 1.618 standard deviations. Historical high and low lines track the maximum deviation point actually reached by price above and below the regression line over the window — providing empirical rather than statistical bounds.
f_lvl(base, std, mult) =>
logMode ? math.exp(math.log(base) + std * mult) : base + std * mult
upperDev = f_lvl(lrValue, stdDev, upperMult)
lowerDev = f_lvl(lrValue, stdDev, lowerMult)
fibLevel = f_lvl(lrValue, stdDev, 1.618)
In log mode, the offset is applied additively in log space (equivalent to multiplicative scaling in price space), ensuring the deviation levels remain proportionally consistent with the log-scale price representation.
6. Five Signal Modes
The signal system offers five distinct behavioral modes. "None" disables signals entirely. "Deviation|Breakout" fires when price crosses above the upper deviation (long) or below the lower deviation (short). "Deviation|MeanReversion" fires when price crosses back inside the deviation bands after an excursion outside. "Extreme|Breakout" uses the historical high and low deviation lines as the reference. "Extreme|MeanReversion" fires when price returns inside the historical extremes. "Theta-Only" generates signals based solely on the theta angle crossing the minimum threshold, regardless of price position relative to deviation levels.
Features
Full Manual OLS Regression: Complete Ordinary Least Squares implementation supporting both log and linear price scaling without any ta.linreg() dependency.
Log/Linear Scale Toggle: Log mode transforms all prices via math.log before regression and back-transforms all output levels, producing proportionally correct channels for compounding instruments.
Multiple Window Modes: Fixed bar count or calendar-anchored expanding windows (Minute, Hour, Day, Week, Month) that reset automatically on period transitions.
Pearson R Coefficient: Real-time correlation quality metric with color-coded dashboard display and optional signal eligibility filter.
Theta Angle: Human-readable trend angle from arctangent of slope with optional minimum threshold signal filter.
Six Regression Lines: Center regression line, upper and lower user-configured deviation bands, 1.618 Fibonacci level, and historical high/low deviation extremes.
Five Signal Modes: Deviation breakout, deviation mean-reversion, extreme breakout, extreme mean-reversion, and theta-only — covering different trading philosophies.
Historical Ghost Plots: Non-repainting semi-transparent historical regression and deviation plots for visual context of prior channel positions.
Efficient Line Updates: All six lines are updated on barstate.islast only, maintaining performance even on long chart histories.
Seven-Row Dashboard: Pearson R (color-coded), theta with sign, direction, signal mode, window type, standard deviation, and window size.
Four Alert Conditions: Long entry, short entry, long exit, short exit — all gated by optional Pearson and theta filters.
Input Parameters
Regression Settings:
Window Mode: Bar, Minute, Hour, Day, Week, or Month (default: Day)
Bar Length: Fixed window size when mode is "Bar" (default: 100)
Target Timeframe: Calendar period string used in timeframe.change() for anchored modes (default: "D")
Log Mode: Enable logarithmic price transformation (default: false)
Deviation Settings:
Upper Deviation Multiplier: Standard deviation multiple for upper channel boundary (default: 2.0)
Lower Deviation Multiplier: Standard deviation multiple for lower channel boundary (default: 2.0)
Show Fibonacci Level: Toggle the 1.618 StdDev Fibonacci projection line (default: true)
Show Historical Extremes: Toggle the historical high/low deviation lines (default: true)
Signal Settings:
Signal Mode: None, Deviation|Breakout, Deviation|MeanReversion, Extreme|Breakout, Extreme|MeanReversion, Theta-Only (default: Deviation|Breakout)
Minimum Theta: Minimum absolute angle in degrees required for signal eligibility (default: 5)
Pearson Filter: Enable Pearson R minimum threshold (default: false)
Min Pearson R: Minimum |R| required when filter is active (default: 0.7)
Display Settings:
Show Historical Plots: Toggle ghost regression and deviation plots (default: true)
Historical Alpha: Transparency level for historical plots (default: 75)
Show Dashboard: Toggle the seven-row information table (default: true)
How to Use This Indicator
Step 1: Select the Appropriate Window Mode
Start by choosing the window mode that matches your analytical context. For intraday trading, Day anchoring is most natural — it resets the regression at the start of each session, showing how the current day's price action trends from the open. For swing trading, Week or Month anchoring provides a broader structural perspective. Bar mode is appropriate when you want consistent lookback regardless of calendar, for example in crypto markets that trade continuously without session boundaries.
Step 2: Evaluate Regression Quality Before Trusting Signals
Check the Pearson R value in the dashboard before interpreting any signal. A strong R (teal, ≥ 0.8) means price has been moving in a well-defined linear trend — the regression line is descriptively accurate and signals from it carry more weight. A weak R (red, < 0.5) means price has been choppy and non-linear; the regression line is fitting noise, and deviation-based signals will be unreliable. If the Pearson filter is enabled, signals will simply not fire when R is below threshold, automating this quality check.
Step 3: Choose a Signal Mode Matching Your Strategy
Breakout modes are suited for momentum strategies — they enter when price is moving away from the regression mean with statistical force. Mean-reversion modes are suited for range-expansion strategies — they enter when price returns inside the channel after an excursion, betting on a return to mean. The Extreme modes use the actual historical high/low deviations rather than the fixed multiplier, making them adaptive to the specific price behavior observed in the current window.
Step 4: Apply Theta and Pearson Filters for Quality Control
Enable the minimum theta filter to avoid trading very shallow trends. A trend angled at 3 degrees has minimal directional conviction — the regression line is nearly horizontal, and any deviation signals from it may be as much noise as signal. Setting a minimum of 10-15 degrees for active entries ensures you are trading genuine directional moves rather than sideways grinding. Combine this with the Pearson filter for the highest-quality signal subset.
Indicator Limitations
Linear regression assumes the relationship between time and price is fundamentally linear during the window. In strongly trending markets this is approximately true; in markets with curves, accelerating trends, or parabolic moves, the linear model will systematically underfit the actual trajectory.
The OLS calculation accumulates sums over the entire window on every bar. On very long bar counts or in expanding anchor modes late in a long session, this can affect script execution time, particularly when combined with other indicators on the same chart.
Calendar anchoring uses timeframe.change() which is resolution-dependent. If the chart timeframe is coarser than the anchor period (e.g., viewing a weekly chart with day anchoring), the anchor period may not transition as expected.
Pearson R measures linear correlation specifically. A price series that follows a consistent curve will produce a lower R than one that follows a straight line, even if the curve describes a very orderly trend. In log mode, this issue is partially mitigated for exponentially trending instruments.
Historical ghost plots are informational only and represent completed regression windows. They do not update after their respective periods close.
In log mode, the volatility measure used for deviation computation is the standard deviation of log-transformed prices, which is equivalent to a percentage standard deviation. For very short windows, this measure can be highly sensitive to individual bar outliers.
Signals on the current (incomplete) bar are not displayed, as all signal conditions require barstate.isconfirmed to prevent look-ahead.
Originality Statement
The Anchored Regression Oracle is a substantially original analytical tool that addresses specific limitations of existing regression-based indicators on PulseWire.
The manual OLS implementation (computing slope, intercept, and Pearson R from accumulated sums without ta.linreg()) enables the log-space calculation that built-in functions do not support — allowing mathematically correct regression channels for compounding assets.
The calendar-anchored expanding window system (using timeframe.change() to reset a bar counter and grow the regression window from a fixed calendar point) is an original approach to making regression contextually meaningful for session-based or period-based analysis.
Computing and displaying the theta angle (arctangent of slope in degrees) as a real-time trend steepness metric, with a configurable minimum threshold that gates signal eligibility, is an original signal quality framework not found in standard regression channel indicators.
The five-mode signal system — providing breakout and mean-reversion variants for both statistical deviation levels and empirical historical extremes, plus a theta-only mode — covers a range of trading philosophies from a single indicator, rather than requiring separate indicators for each approach.
The combination of log/linear duality, calendar anchoring, Pearson quality gating, theta filtering, Fibonacci projection at 1.618 StdDev, and historical ghost plots in a single indicator represents an integration of features not available in any single existing PulseWire regression tool.
Disclaimer
The Anchored Regression Oracle is provided for educational and informational purposes only. It is a technical analysis tool and does not constitute financial advice. Statistical measures such as Pearson R and regression slope describe historical relationships and do not predict future price behavior. All trading involves risk of loss. Users are solely responsible for their own trading decisions. Please consider your individual risk tolerance and consult a licensed financial professional before engaging in any trading activity.
-Made with passion by officialjackofalltrades
Indicator

Initial Balance | TradeSymmetryIf you trade across multiple asset classes on lower timeframes, you know the frustration: every time you switch from US Equities to Metals or Forex, you have to manually adjust your Initial Balance (IB) timings. Furthermore, standard Multi-Timeframe (MTF) indicators often break, clutter your chart with overlapping text, or randomly delete your Higher Timeframe levels due to Pine Script memory limits.
We engineered the Initial Balance to solve these exact problems. This is a robust, institutional-grade structural tool designed to map the Initial Balance and True Open levels automatically, regardless of what chart you are looking at.
🔥 Core Features & Engineering:
🤖 Smart Asset Auto-Detection
Stop changing your settings every time you change your chart. The built-in detection engine reads your ticker symbol and automatically applies the correct New York (EST/EDT) Initial Balance window:
US Equities / Indices (ES, NQ, SPY, etc.) ➡️ 09:30 - 10:30 EST
Metals & Bonds (GC, SI, ZN, etc.) ➡️ 08:20 - 09:20 EST
Energy (CL, NG, etc.) ➡️ 09:00 - 10:00 EST
Forex & FX Futures (EURUSD, 6E, etc.) ➡️ 08:00 - 09:00 EST (NY Session)
Note: Includes a sleek info panel in the bottom right so you always know which session is active. Manual overrides are also available.
⏱️ Absolute Time Anchoring
A common flaw in Pine Script is that drawn lines will shift horizontally when you switch timeframes (e.g., from 1m to 15m). This script anchors every box, line, and label to exact absolute UNIX timestamps. Your levels stay permanently locked to the exact same pixel, irrespective of the timeframe you are viewing.
🧠 Priority Memory Manager (GC Protection)
PulseWire enforces a strict 500-line limit per script. When standard scripts hit this limit, they blindly delete your oldest lines—often ruining your long-term charts. We built a custom Garbage Collection (GC) pruner that constantly monitors line count. If the chart gets too heavy, it safely deletes only the oldest historical days, permanently protecting your current setups.
📊 Included Levels:
Initial Balance High & Low (IBH / IBL)
Intermediate Midpoint (50% / IBM)
Standard Extensions (IBH+Δ, IBL-Δ)
Double Extensions (IBH+2Δ, IBL-2Δ)
Fractional Extensions (IBM+Δ/2, IBM-Δ/2)
Indicator

Rolling VWAP with StdDev BandsRolling VWAP with StdDev Bands (RVWAP+SD)
This indicator calculates a Rolling Volume-Weighted Average Price (RVWAP) over a configurable rolling time window (default: 10 hours), with volume-weighted standard deviation bands overlaid above and below. Unlike session-anchored VWAP, this indicator never resets at session boundaries, making it equally effective on crypto, forex, and equity markets at any timeframe.
What it does
RVWAP : Volume-weighted average price computed over the last N hours of bars using the PineCoders ConditionalAverages library for time-based aggregation. Smoothed with SWMA + RMA(6) to reduce noise.
StdDev Bands : Upper and lower bands at RVWAP +/- (multiplier x volumeWeightedStdDev). Bands are derived from: Variance = SUM((hlc3 - RVWAP)^2 * volume) / SUM(volume), giving true volume-weighted statistical envelopes.
Trend Colouring : RVWAP turns GREEN when it is rising and close > upper band (strong trend up), RED when falling and close < lower band (strong trend down), and WHITE when price oscillates within the bands (neutral / mean-reversion environment). Trend lookback is automatically synchronised to the RVWAP timeframe.
How to use
Trend following : Trade in the direction of a green or red RVWAP when price breaks and holds outside the bands.
Mean reversion : When RVWAP is white (neutral), band tags are potential mean-reversion entries back toward the RVWAP.
Alerts : Two built-in alert conditions are included for price crossing above the upper band or below the lower band.
Inputs
RVWAP Timeframe — Resolution for VWAP aggregation (default: 3-minute). Should be >= your chart timeframe.
RVWAP Time Period in Hours — Rolling window for VWAP calculation (default: 10 hours).
Standard Deviation Multiplier — Band width in standard deviation units (default: 2.0).
Show Bands / Show Fill — Toggle band lines and fill visibility independently.
Important notes
This indicator uses lookahead=barmerge.lookahead_off on all request.security() calls. The last bar may update as real-time volume changes — this is normal VWAP behaviour and not a repainting issue.
The SWMA + RMA smoothing introduces some lag and is not intended for tick-level scalping.
Works on all markets and timeframes. On very thin/illiquid instruments, VWAP reliability depends on volume data quality.
Credits
Rolling time-window aggregation uses the PineCoders/ConditionalAverages/2 library (PineCoders, public domain per TV House Rules). All other code — volume-weighted standard deviation, timeframe synchronisation, trend state logic, and smoothing pipeline — is original.
Indicator

Indicator

KNN Fisher Holistic {LB] KNN FISHER HOLISTIC: Multi-Timeframe Predictive Suite
A Professional Quantitative Tool for Structural Trend Analysis.
The KNN FISHER HOLISTIC is a high-complexity technical indicator designed to eliminate the noise of single-timeframe trading. By combining the mathematical precision of the Fisher Transform with the statistical power of a k-Nearest Neighbors (KNN) algorithm, this tool identifies high-probability zones where market structure and historical patterns align.
■ THE ARCHITECTURE
1. The Holistic Master Axis
At the core of the indicator is a Weighted Multi-Timeframe (MTF) Axis . It standardizes the 15m, 1H, and 4H Fisher Transforms into a unified Z-Score distribution.
Pondération: 4H (50%), 1H (30%), 15m (20%).
Smoothing: We use an ALMA (Arnaud Legoux Moving Average) filter to provide a fluid, "zero-lag" trend line that represents the true institutional flow.
2. KNN Machine Learning Engine
The system features a localized k-Nearest Neighbors logic. It analyzes the current morphology (slope and position) of the Master Axis and compares it to the last 40 historical occurrences.
Predictive Score: The histogram at the bottom represents the KNN's confidence. If the current axis shape historically led to a price increase, the KNN displays a positive green score.
■ VISUAL COMPONENTS
The Multi-Layered Ribbon: Displays the gap between the Fast (15m) and Slow (4H) Fisher values. A "Squeeze" in the ribbon often precedes massive volatility breakouts.
Confluent Axis Coloring:
Cyan/Magenta: The Master Axis and the KNN Engine are in agreement. This is your Green Light for trend following.
Gray: The MTF structure and the KNN prediction are conflicting. This is a Neutral Zone where risk is highest.
KNN Confidence Histogram: Real-time probability scoring of the current trend signature.
■ OPERATIONAL STRATEGY
A. Trend Confluence (The Core Setup)
The strongest entries occur when the Master Axis turns Cyan (Bullish) or Magenta (Bearish). This indicates that the 4H trend is being supported by lower timeframe momentum AND that the KNN engine recognizes this pattern as a historically successful one.
B. Statistical Extremes (The Range Setup)
The indicator includes Z-Score Dotted Lines at +2 and -2 . These represent statistical anomalies (95% of data stays within these bounds).
When the 15m Fisher hits these extremes while the 4H Axis is flat, it signals a high-probability reversal point for mean-reversion traders.
C. Filtering False Breakouts
One of the most powerful uses of this tool is its Gray Filtering . If the price breaks a level but the Axis remains Gray , it means the KNN algorithm does not see historical validation for the move, warning you of a potential "Fake-out."
■ TECHNICAL SPECS
Standardization: Z-Score Normalization for cross-TF comparability.
Filtering: ALMA-based Zero-Lag smoothing.
Logic: Euclidean Distance-based KNN Classification.
Compatibility: Optimized for Pine Script® v6.
Risk Disclaimer: High-level quantitative indicators provide statistical probabilities, not certainties. Always pair this tool with solid risk management and price action confirmation. Indicator

Indicator

Indicator

standard deviation rulerDesigned for people who dislike having weird lines all over their chart and want a cleaner version of their standard deviation levels on the chart, here is your standard deviation ruler!
I don't need to rehash your statistics class in this description, as you know, standard deviations are a measure of the amount of variation or dispersion in a dataset that shows you how spread out the data points are from the mean. Here, the mean in question is the Volume Weighted Average Price (VWAP). This indicator shows you, just like VWAP bands, where price has statistically stayed around and whether it's inside that average range or outside of it.
The advantage of this indicator is that, on top of having the lines not display on top of the candles, leaving space for other stuff, the indicator is able to display exactly how many standard deviations price is currently away from, allowing for greater precision in your decision-making.
I held off on posting this side project for a while because, like many other of my side projects, I've never actually finished this one. The "Anchor Period" and "Length" settings do not change anything, and the indicator is permanently anchored to the start of the first session of the day (Asian session). I thought that, nonetheless, this indicator might interest some people.
Given enough requests or when I feel like it, I will probably fix that issue. Other than that, all settings work as intended. Thanks for reading and thanks for using my indicator!
k4
Indicator
