Uptrick: Universal Z-Score ValuationOverview
The Uptrick: Universal Z-Score Valuation is a tool designed to help traders spot when the market might be overreacting—whether that’s on the upside or the downside. It does this by combining the Z-scores of multiple key indicators into a single average, letting you see how far the current market conditions have stretched away from “normal.” This average is shown as a smooth line, supported by color-coded visuals, signal markers, optional background highlights, and a live breakdown table that shows the contribution of each indicator in real time. The focus here is on spotting potential reversals, not following trends. The indicator works well across all timeframes and asset classes, from fast intraday charts like the 1-minute and 5-minute, to higher timeframes such as the 4-hour, daily, or even weekly. Its universal design makes it suitable for any market — whether you're trading crypto, stocks, forex, or commodities.
Introduction
To understand what this indicator does, let’s start with the idea of a Z-score. In simple terms, a Z-score tells you how far a number is from the average of its recent history, measured in standard deviations. If the price of an asset is two standard deviations above its mean, that means it’s statistically “rare” or extended. That doesn’t guarantee a reversal—but it suggests the move is unusual enough to pay attention.
This concept isn’t new, but what this indicator does differently is apply the Z-score to a wide set of market signals—not just price. It looks at momentum, volatility, volume, risk-adjusted performance, and even institutional price baselines. Each of those indicators is normalized using Z-scores, and then they’re combined into one average. This gives you a single, easy-to-read line that summarizes whether the entire market is behaving abnormally. Instead of reacting to one indicator, you’re reacting to a statistically balanced blend.
Purpose
The goal of this script is to catch turning points—places where the market may be topping out or bottoming after becoming overstretched. It’s built for traders who want to fade sharp moves rather than follow trends. Think of moments when price explodes upward and starts pulling away from every moving average, volume spikes, volatility rises, and RSI shoots up. This tool is meant to spot those situations—not just when price is stretched, but when multiple different indicators agree that something is overdone.
Originality and Uniqueness
Most indicators that use Z-scores only apply them to one thing—price, RSI, or maybe Bollinger Bands. This one is different because it treats each indicator as a contributor to the full picture. You decide which ones to include, and the script averages them out. This makes the tool flexible but also deeply informative.
It doesn’t rely on complex or hidden math. It uses basic Z-score formulas, applies them to well-known indicators, and shows you the result. What makes it unique is the way it brings those signals together—statistically, visually, and interactively—so you can see what’s happening in the moment with full transparency. It’s not trying to be flashy or predictive. It’s just showing you when things have gone too far, too fast.
Inputs and Parameters
This indicator includes a wide range of configurable inputs, allowing users to customize which components are included in the Z-score average, how each indicator is calculated, and how results are displayed visually. Below is a detailed explanation of each input:
General Settings
Z-Score Lookback (default: 100): Number of bars used to calculate the mean and standard deviation for Z-score normalization. Larger values smooth the Z-scores; smaller values make them more reactive.
Bar Color Mode (default: None): Determines how bars are visually colored. Options include: None: No candle coloring applied. - Heat: Smooth gradient based on the Z-score value. - Latest Signal: Applies a solid color based on the most recent buy or sell signal
Boolean - General
Plot Universal Valuation Line (default: true): If enabled, plots the average Z-score (zAvg) line in the separate pane.
Show Signals (default: true): Displays labels ("𝓤𝓹" for buy, "𝓓𝓸𝔀𝓷" for sell) when zAvg crosses above or below user-defined thresholds.
Show Z-Score Table (default: true): Displays a live table listing each enabled indicator's Z-score and the current average.
Select Indicators
These toggles enable or disable each indicator from contributing to the Z-score average:
Use VWAP Z-Score (default: true)
Use Sortino Z-Score (default: true)
Use ROC Z-Score (default: true)
Use Price Z-Score (default: true)
Use MACD Histogram Z-Score (default: false)
Use Bollinger %B Z-Score (default: false)
Use Stochastic K Z-Score (default: false)
Use Volume Z-Score (default: false)
Use ATR Z-Score (default: false)
Use RSI Z-Score (default: false)
Use Omega Z-Score (default: true)
Use Sharpe Z-Score (default: true)
Only enabled indicators are included in the average. This modular design allows traders to tailor the signal mix to their preferences.
Indicator Lengths
These inputs control how each individual indicator is calculated:
MACD Fast Length (default: 12)
MACD Slow Length (default: 26)
MACD Signal Length (default: 9)
Bollinger Basis Length (default: 20): Used to compute the Bollinger %B.
Bollinger Deviation Multiplier (default: 2.0): Standard deviation multiplier for the Bollinger Band calculation.
Stochastic Length (default: 14)
ATR Length (default: 14)
RSI Length (default: 14)
ROC Length (default: 10)
Zones
These thresholds define key signal levels for the Z-score average:
Neutral Line Level (default: 0): Baseline for the average Z-score.
Bullish Zone Level (default: -1): Optional intermediate zone suggesting early bullish conditions.
Bearish Zone Level (default: 1): Optional intermediate zone suggesting early bearish conditions.
Z = +2 Line Level (default: 2): Primary threshold for bearish signals.
Z = +3 Line Level (default: 3): Extreme bearish warning level.
Z = -2 Line Level (default: -2): Primary threshold for bullish signals.
Z = -3 Line Level (default: -3): Extreme bullish warning level.
These zone levels are used to generate signals, fill background shading, and draw horizontal lines for visual reference.
Why These Indicators Were Merged
Each indicator in this script was chosen for a specific reason. They all measure something different but complementary.
The VWAP Z-score helps you see when price has moved far from the volume-weighted average, often used by institutions.
Sortino Ratio Z-score focuses only on downside risk, which is often more relevant to traders than overall volatility.
ROC Z-score shows how fast price is changing—strong momentum may burn out quickly.
Price Z-score is the raw measure of how far current price has moved from its mean.
RSI Z-score shows whether momentum itself is stretched.
MACD Histogram Z-score captures shifts in trend strength and acceleration.
%B (Bollinger) Z-score indicates how close price is to the upper or lower volatility envelope.
Stochastic K Z-score gives a sense of how high or low price is relative to its recent range.
Volume Z-score shows when trading activity is unusually high or low.
ATR Z-score gives a read on volatility, showing if price movement is expanding or contracting.
Sharpe Z-score measures reward-to-risk performance, useful for evaluating trend quality.
Omega Z-score looks at the ratio of good returns to bad ones, offering a more nuanced view of efficiency.
By normalizing each of these using Z-scores and averaging only the ones you turn on, the script creates a flexible, balanced view of the market’s statistical stretch.
Calculations
The core formula is the standard Z-score:
Z = (current value - average) / standard deviation
Every indicator uses this formula after it’s calculated using your chosen settings. For example, RSI is first calculated as usual, then its Z-score is calculated over your selected lookback period. The script does this for every indicator you enable. Then it averages those Z-scores together to create a single value: zAvg. That value is plotted and used to generate visual cues, signals, table values, background color changes, and candle coloring.
Sequence
Each selected indicator is calculated using your custom input lengths.
The Z-score of each indicator is computed using the shared lookback period.
All active Z-scores are added up and averaged.
The resulting zAvg value is plotted as a line.
Signal conditions check if zAvg crosses user-defined thresholds (default: ±2).
If enabled, the script plots buy/sell signal labels at those crossover points.
The candle color is updated using your selected mode (heatmap or signal-based).
If extreme Z-scores are reached, background highlighting is applied.
A live table updates with each individual Z-score so you know what’s driving the signal.
Features
This script isn’t just about stats—it’s about making them usable in real time. Every feature has a clear reason to exist, and they’re all there to give you a better read on market conditions.
1. Universal Z-Score Line
This is your primary reference. It reflects the average Z-score across all selected indicators. The line updates live and is color-coded to show how far it is from neutral. The further it gets from 0, the brighter the color becomes—cyan for deeply oversold conditions, magenta for overbought. This gives you instant feedback on how statistically “hot” or “cold” the market is, without needing to read any numbers.
2. Signal Labels (“𝓤𝓹” and “𝓓𝓸𝔀𝓷”)
When the average Z-score drops below your lower bound, you’ll see a "𝓤𝓹" label below the bar, suggesting potential bullish reversal conditions. When it rises above the upper bound, a "𝓓𝓸𝔀𝓷" label is shown above the bar—indicating possible bearish exhaustion. These labels are visually clear and minimal so they don’t clutter your chart. They're based on clear crossover logic and do not repaint.
3. Real-Time Z-Score Table
The table shows each indicator's individual Z-score and the final average. It updates every bar, giving you a transparent breakdown of what’s happening under the hood. If the market is showing an extreme average score, this table helps you pinpoint which indicators are contributing the most—so you’re not just guessing where the pressure is coming from.
4. Bar Coloring Modes
You can choose from three modes:
None: Keeps your candles clean and untouched.
Heat: Applies a smooth gradient color based on Z-score intensity. As conditions become more extreme, candle color transitions from neutral to either cyan (bullish pressure) or magenta (bearish pressure).
Latest Signal: Applies hard coloring based on the most recent signal—greenish for a buy, purple for a sell. This mode is great for tracking market state at a glance without relying on a gradient.
Every part of the candle is colored—body, wick, and border—for full visibility.
5. Background Highlighting
When zAvg enters an extreme zone (typically above +2 or below -2), the background shifts color to reflect the market’s intensity. These changes aren’t overwhelming—they’re light fills that act as ambient warnings, helping you stay aware of when price might be reaching a tipping point.
6. Customizable Zone Lines and Fills
You can define what counts as neutral, overbought, and oversold using manual inputs. Horizontal lines show your thresholds, and shaded regions highlight the most extreme zones (+2 to +3 and -2 to -3). These lines give you visual structure to understand where price currently stands in relation to your personal reversal model.
7. Modular Indicator Control
You don’t have to use all the indicators. You can enable or disable any of the 12 with a simple checkbox. This means you can build your own “blend” of market context—maybe you only care about RSI, price, and volume. Or maybe you want everything on. The script adapts accordingly, only averaging what you select.
8. Fully Customizable Sensitivity and Lengths
You can adjust the Z-score lookback length globally (default 100), and tweak individual indicator lengths separately. This lets you tune the indicator’s responsiveness to suit your trading style—slower for longer swings, faster for scalping.
9. Clean Integration with Any Chart Layout
All visual elements are designed to be informative without taking over your chart. The coloring is soft but clear, the labels are readable without being huge, and you can turn off any feature you don’t need. The indicator can work as a full dashboard or as a simple line with a couple of alerts—it’s up to you.
10. Precise, Real-Time Signal Logic
The crossover logic for signals is exact and only fires when the Z-score moves across your defined boundary. No estimation, no delay. Everything is calculated based on current and previous bar data, and nothing repaints or back-adjusts.
Conclusion
The Universal Z-Score Valuation indicator is a tool for traders who want a clear, unbiased way to detect overextension. Instead of relying on a single signal, you get a composite of several market perspectives—momentum, volatility, volume, and more—all standardized into a single view. The script gives you the freedom to control the logic, the visuals, and the components. Whether you use it as a confirmation tool or a primary signal source, it’s designed to give you clarity when markets become chaotic.
Disclaimer
This indicator is for research and educational use only. It does not constitute financial advice or guarantees of performance. All trading involves risk, and users should test any strategy thoroughly before applying it to live markets. Use this tool at your own discretion.
Statistics
Hidden Markov ModelDescription
This model uses a Hidden Markov Model to detect potential tops and bottoms. It is designed to probabilistically identify market regime changes and predict potential reversal point using a forward algorithm to calculate the probability of a state.
State 0: (Normal Trading): Market continuation patterns, balanced buying/selling
State 1: (Top Formation): Exhaustion patterns at price highs
State 2: (Bottom Formation): Capitulation patterns at price lows
Background: The HMM assumes that market behavior follows hidden states that aren't directly observable, but can be inferred from observable market data (emissions). The model uses a (somewhat simplified) Bayesian inference to estimate these probabilities.
How to use
1) Identify the trend (you can also use it counter-trend)
2) For longing, look for a green arrow. The probability values should be red. For shorting, look for a red arrow. The probability values should be green
3) For added confluence, look for high probability values
Alpha Trend Strength Pro🔥 What You’ll See on the Chart
✅ A floating label appears near the most recent candle.
✅ Label shows:
🔥 Trend direction: Uptrend / Downtrend / Neutral / Near VWAP
💪 Trend strength: Strong / Moderate / Weak / Range
📈 EMA alignment
🎯 RSI momentum state
💥 MACD crossover
📊 Volatility condition (Expanding / Contracting)
🔵 VWAP proximity if enabled
✅ The chart background turns:
Green for Uptrend
Red for Downtrend
Neutral/Gray if in range (no background color)
⚙️ Customize Settings
Click the gear icon ⚙️ next to the script’s name on your chart.
Change things like:
Show/hide background color
Toggle VWAP-based filtering
Adjust RSI, MACD, Bollinger parameters
ORB Screener-Multiple Indicators [Marin adjusted]ORB screener for multiple instruments. it needs just the customization of time/ timezone.
CLMM Vault策略回测 (专业版) v5Explanation of the CLMM (Concentrated Liquidity - Market Maker) Strategy Backtesting Model Developed for the Sui Chain Vaults Protocol
Why Are We Doing This?
Conducting strategy backtesting is a crucial step for us to make data-driven decisions, validate the feasibility of strategies, and manage potential risks before committing real funds and significant development resources. A strategy that appears to have a high APY may perform entirely differently once real-world frictional costs (such as rebalancing fees and slippage) are deducted. The goal of this backtesting model is to quickly and cost-effectively identify which strategy parameter combinations have the potential to be profitable and which ones pose risks before formal development, thereby avoiding significant losses and providing data support for the project's direction.
Core Features of the Backtesting Model
We have built a "pro version" (v5) strategy simulator using TradingView's Pine Script. It can quickly simulate the core performance of our auto-compounding and rebalancing Vaults on historical price data, with the following main features:
Auto-Compounding: Continuously adds the generated fee income to the principal based on the set profit range (e.g., 0.01%).
Auto-Rebalancing: Simulates automatic rebalancing actions when the price exceeds the preset profit range and deducts the corresponding costs.
Smart Filtering Mechanism: To make the simulation closer to our ideal "smart" decision-making, it integrates three freely combinable filtering mechanisms:
Buffer Zone: Tolerates minor and temporary breaches of the profit range to avoid unnecessary rebalancing.
Breakout Confirmation: Requires the price to be in the trigger zone for N consecutive candles to confirm a breakout, filtering out market noise from "false breakouts."
Time Cooldown: Enforces a minimum time interval between two rebalances to prevent value-destroying high-frequency trading in extreme market conditions.
Important: Simplifications and Assumptions of the Model
To quickly prototype and iterate on the TradingView platform, we have made some key simplifications to the model.
A fully accurate backtest would require a deep simulation of on-chain liquidity pools (Pool Pair), calculating the price impact (Slippage) and impermanent loss (IL) caused by each rebalance on the pool. Since TradingView cannot access real-time on-chain liquidity data, we have made the following simplifications:
Simplified Rebalancing Costs: Instead of simulating real transaction slippage, we use a unified input parameter of single rebalance cost (%) to "bundle" and approximate the total of Gas fees, slippage, and realized impermanent loss.
Simplified Fee Income: Instead of calculating fees based on real-time trading volume, we directly input an average fee annualized return (%) as the core income assumption for our strategy.
How to Use and Test
Team members can load this script and test different strategies by adjusting the input parameters on the panel. The most critical parameters include: position profit range, average fee annualized return, single rebalance cost, and the switches and corresponding values of the above three smart filters.
BTC/Fiat Divergence & Spread Monitor📄 BTC/Fiat Divergence & Spread Monitor
This indicator visualizes Bitcoin’s relative performance across multiple fiat currencies and highlights periods of unusual divergence. It helps traders assess which fiat pairs BTC has outperformed or underperformed over a configurable lookback period and monitor the dynamic spread between the strongest and weakest pairs.
Features:
Relative Performance Matrix:
Ranks BTC returns in 6 fiat pairs, displaying a color-coded table of percentage changes and ranks.
Divergence Spread Oscillator:
Calculates the spread between the top and bottom performing pairs and normalizes this using a Z-Score. The oscillator helps identify when fiat pricing divergence is unusually high or compressed.
Dynamic Smoothing:
Optional Hull Moving Average smoothing to reduce noise in the spread signal.
Customizable Inputs:
Lookback period for percent change.
Z-Score normalization window.
Smoothing length.
Symbol selection for each fiat pair.
Visual Mode Toggle:
Switch between relative performance lines and spread oscillator view.
Potential Use Cases:
Fiat Rotation:
Identify which fiat is relatively weak or strong to optimize your exit currency when taking BTC profits.
Volatility Detection:
Use the spread Z-Score to detect periods of high divergence across fiat pairs, signaling macro FX volatility or dislocations.
Regime Analysis:
Track when fiat spreads are converging or expanding, potentially signaling market regime shifts.
Risk Management:
When divergence is extreme (Z-Score > +1), consider reducing position sizing or waiting for reversion.
Disclaimer:
This indicator is provided for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any security or asset. Always do your own research and consult a qualified financial professional before making trading decisions. Use at your own risk.
Tip:
Experiment with different lookback periods and smoothing settings to adapt the indicator to your timeframe and trading style.
Previous Day/Week/Month - High/Lows + Open/Close (RC)Its an indicator marking previous day and previous week and last month's high, low open, close.
8H/12H Trend + RSI + MACD🧠 RSI 8/12H – The Indicator That Shows Reversals Before the Move Happens
Standard RSI (14) is too slow.
By the time it flashes a signal, the move is usually halfway done.
📍 RSI 8/12H is faster, sharper, and built to spot local reversals early – before the crowd sees them.
Why 8/12H Works:
✅ Detects overbought/oversold zones with precision
✅ Especially powerful on gold, oil, and indices
✅ Gives 1–2 clean, high-probability signals per week – no noise, no clutter
🔥 If you're tired of chasing late entries,
RSI 8/12H gives you the edge to get in before the breakout.
Don’t just watch where the market’s been.
Anticipate where it turns.
xetra//@version=5
indicator("First Candle Range", overlay=true)
// Налаштування сесії
session = input.session("0930-1030", title="Сесія")
// Визначити, чи поточна свічка — перша у сесії
is_new_session = ta.change(time(session))
// Змінні для збереження значень першої свічки
var float first_high = na
var float first_low = na
var int first_index = na
// Коли настає нова сесія — зберігаємо high та low першої свічки
if is_new_session
first_high := high
first_low := low
first_index := bar_index
// Побудова ліній
if not na(first_index)
line.new(first_index, first_high, bar_index, first_high, color=color.green, width=1, extend=extend.right)
line.new(first_index, first_low, bar_index, first_low, color=color.red, width=1, extend=extend.right)
// (Опційно) Заливка області між high та low
bgcolor(time(session) and bar_index == first_index ? color.new(color.orange, 85) : na)
Previous Day O H L C Calculation By Md//@version=6
indicator("Previous Day O H L C Calculation By Md", overlay=true)
// Check if the previous daily candle is green (bullish) or red (bearish)
previousCandleBullish = close > open
previousCandleBearish = close < open
// Calculate the difference for bullish candles: previous day's high minus previous day's open
bullishCalculation = high - open
// Calculate the difference for bearish candles: previous day's low minus previous day's close
bearishCalculation = low - close
// Show the result at the top of the current daily candle if the previous candle was bullish
if previousCandleBullish
label.new(bar_index, high, "Bullish Calc: " + str.tostring(bullishCalculation), color=color.green, textcolor=color.white, style=label.style_label_left, size=size.small)
// Show the result at the bottom of the current daily candle if the previous candle was bearish
if previousCandleBearish
label.new(bar_index, low, "Bearish Calc: " + str.tostring(bearishCalculation), color=color.red, textcolor=color.white, style=label.style_label_left, size=size.small)
FastMetrixLibrary "FastMetrix"
This is a library I've been tweaking and working with for a while and I find it useful to get valuable technical analysis metrics faster (why its called FastMetrix). A lot of is personal to my trading style, so sorry if it does not have everything you want. The way I get my variables from library to script is by copying the return function into my new script.
TODO: Volatility and short term price analysis functions
slope(source, smoothing)
Parameters:
source (float)
smoothing (int)
integral(topfunction, bottomfunction, start, end)
Parameters:
topfunction (float)
bottomfunction (float)
start (int)
end (int)
deviation(x, y)
Parameters:
x (float)
y (float)
getema(len)
TODO: return important exponential long term moving averages and derivatives/variables
Parameters:
len (simple int)
getsma(len)
TODO: return requested sma
Parameters:
len (int)
kc(mult, len)
TODO: Return Keltner Channels variables and calculations
Parameters:
mult (simple float)
len (simple int)
bollinger(len, mult)
TODO: returns bollinger bands with optimal settings
Parameters:
len (int)
mult (simple float)
volatility(atrlen, smoothing)
TODO: Returns volatility indicators based on atr
Parameters:
atrlen (simple int)
smoothing (int)
premarketfib()
countinday(xcondition)
Parameters:
xcondition (bool)
countinsession(condition, n)
Parameters:
condition (bool)
n (int)
Session SizeAnalyze previous Sessions Size (Asia, London, New York) and give back the average range size in points.
Great tool if you want to take seriously the time and price
Open Interest Footprint IQ [TradingIQ]Hello Traders!
Th e Open Interest Footprint IQ indicator is an advanced visualization tool designed for cryptocurrency markets. It provides a granular, real-time breakdown of open interest changes across different price levels, allowing traders to see how aggressive market participation is distributed within each bar.
Unlike standard footprint charts that rely solely on volume, this indicator offers unique insights by focusing on the interaction between price action and changes in open interest (OI) — a leading metric often used to infer trader intent and positioning.
How it works
The Open Interest Footprint IQ processes lower timeframe price and open interest data to build a footprint-style chart that shows how traders are positioning themselves within each candle.
Here’s a breakdown of the process:
1. Granular OI & Price Sampling
The script retrieves lower-timeframe data (1-minute, 1-second, or 1-tick, based on your setting).
For each candle, it captures:
High and low prices
Price change direction
Change in open interest (OI)
2. Classifying Trader Behavior
For each lower-timeframe segment, the indicator determines the type of positioning occurring based on price movement and OI change:
If price is moving up and open interest is increasing, it suggests that long positions are being opened. This is considered a "Longs Opening" event, labeled as UU (Up/Up).
If price is moving up but open interest is decreasing, it indicates that short positions are being closed. This is referred to as UD (Up/Down), or "Shorts Closing."
If price is moving down and open interest is increasing, it signals that short positions are being opened. This is known as DU (Down/Up), or "Shorts Opening."
If price is moving down while open interest is also decreasing, it means that long positions are being closed. This is labeled as DD (Down/Down), or "Longs Closing."
These are stored in separate arrays and displayed at specific price levels.
It is particularly useful for identifying:
Where longs or shorts are opening/closing positions
Stacked imbalances (indicative of potential absorption or exhaustion)
Value area zones and POC (Point of Control) based on OI, not volume
This footprint runs on your choice of sub-bar granularity and is ideal for high-frequency trading, scalping, and entries based on order flow dynamics.
Key Features
Footprint Visualization
At each price level within a candle:
Long/short opening and closing behavior is broken down.
Delta (net open interest change) is displayed both numerically and color-coded.
Optional gradient coloring shows intensity and type of flow (longs/shorts opened/closed).
Cumulative or per-bar reset modes allow you to track OI evolution over time.
The image above explains the information that each Footprint box shows across a candlestick!
Each footprint box shows:
OI Delta
OI Delta %
Longs Opened (LO)
Longs Closed (LC)
Shorts Opened (SO)
Shorts Closed (SC)
The image above explains the color-coding feature of the indicator.
Boxes are color coded to show which position action
dominated at the price area.
For this example:
Green boxes = Long positions being opened dominated
Purple boxes = Long positions being closed dominated
Red boxes = Short positions being opened dominated
Yellow boxes = Short positions being closed dominated
All colors are customizable.
Additionally, for traders who are only interested in whether OI increased/decreased, a "two-color" option is available in the settings.
For the two-color option, footprint boxes can be one of two colors. Showing whether OI increased or decreased at the level.
Cumulative Levels
Open Interest Footprint IQ contains a "Cumulative Levels" feature that tracks/stores open interest change at tick levels over time, rather than resetting per bar.
With the "Cumulative Levels" feature enabled, traders can see open interest changes persist across all candlesticks. This feature is useful for determining whether longs opening, longs closing, shorts opening, or shorts closing are dominating at particular price areas over time rather than on a single bar.
A useful feature to see if shorts/longs are favoring certain price throughout the day, week, month, etc.
Input Settings Explained
Granularity (Dropdown: Granularity)
Options: 1-Minute, 1-Second, 1-Tick
Determines how finely the script samples the lower timeframe data to construct the footprint.
For precision:
1-Tick = Highest accuracy, but more resource-intensive.
1-Second/1-Minute = Suitable for broader or more zoomed-out analysis.
Tick Level Distance (Tick Level Distance (0 = Auto))
Defines the vertical spacing between levels in the footprint chart.
If 0, the script uses an automatic calculation based on ATR to adapt to volatility.
Set a manual value (e.g., 5) to control the height granularity of each level in ticks.
Cumulative Levels (Toggle)
If enabled, the footprint builds cumulatively over time, rather than resetting per candle.
Use case: Visualize ongoing buildup of OI activity across a session or day.
Cumulative Levels Reset TF (Timeframe)
Sets the reset interval for the cumulative view (e.g., reset daily, hourly, etc.)
Works only when Cumulative Levels is enabled.
Delta Box Display Settings
Show Delta Percentage
Toggles the display of the percentage change in OI across the footprint level.
Helpful to gauge how aggressive positioning is relative to total OI at that level.
Show Longs/Shorts (Opened/Closed)
Show Longs Opened: Displays OI increase in up candles (price ↑, OI ↑).
Show Longs Closed: Displays OI decrease in down candles (price ↓, OI ↓).
Show Shorts Opened: OI increase in down candles (price ↓, OI ↑).
Show Shorts Closed: OI decrease in up candles (price ↑, OI ↓).
These behaviors are color-coded to give traders instant context:
Blue-green for longs opening.
Purple for longs closing.
Red for shorts opening.
Yellow for shorts closing.
Value Area & POC
Value Area % (Value Area %)
Controls how much cumulative open interest is used to define the value area.
Example: 70% means the smallest range of prices that contains 70% of total OI in that bar will be marked.
Helps identify zones of interest, support/resistance, and institutional levels.
The image above explains how to identify the VAH/VAL/POC shown by Open Interest Footprint IQ.
VAH = Upper 🞂
POC = ●
VAL = Lower 🞂
Imbalances
Imbalance Percentage
Defines the minimum delta % required at a level to be marked as an imbalance.
If the net open interest change at a level exceeds this threshold, a visual marker appears.
Stacked Imbalance Count
If the number of consecutive imbalance levels meets this count, a “Stacked Imbalance” alert will trigger.
This can signal aggressive buying or selling pressure, potential breakout zones, or institutional absorption.
Color Settings
Longs Opened / Closed, Shorts Opened / Closed
Customize the color palette for each order flow behavior.
These colors appear in the background gradient of the footprint boxes.
Up/Down Only Mode
Toggle to override all behavior-based colors with a single Up Color and Down Color.
Useful if you prefer a simple bull/bear view.
Up Color / Down Color
If "Up/Down Only" is enabled, these two colors are used to represent all net positive or negative deltas.
Special Notes
Crypto only: This script works only with crypto tickers on TradingView.
For other assets (stocks, futures), a warning message will appear instead.
OI data must be available from the exchange (many perpetual pairs support this).
If the footprint is too small or invisible, increase your tick level spacing in the settings.
Alerts
When a stacked imbalance is detected, an alert is fired ("Stacked Imbalance").
This feature is useful for automated systems, bots, or simply staying informed of potential trade setups.
And that's all for now!
If you have any questions or features you'd like to see feel free to share them in the comments below!
Thank you traders!
LoggersLibrary "Loggers"
helper functions for easily logging debug info into the console and for coloring them dynamically according to their meaning.
fun(x)
TODO: add function description here
Parameters:
x (float) : TODO: add parameter x description here
Returns: TODO: add what function returns
loginfo(name, value, unit)
Parameters:
name (string)
value (float)
unit (string)
loginfo(name, value, unit)
Parameters:
name (string)
value (bool)
unit (string)
loginfo(name, value, unit)
Parameters:
name (string)
value (int)
unit (string)
logwarning(name, value, unit)
Parameters:
name (string)
value (float)
unit (string)
logwarning(name, value, unit)
Parameters:
name (string)
value (bool)
unit (string)
logwarning(name, value, unit)
Parameters:
name (string)
value (int)
unit (string)
logerror(name, value, unit)
Parameters:
name (string)
value (float)
unit (string)
logerror(name, value, unit)
Parameters:
name (string)
value (bool)
unit (string)
logerror(name, value, unit)
Parameters:
name (string)
value (int)
unit (string)
logdynamic_lowbad(name, value, unit, treshold_yellow, treshold_red)
Parameters:
name (string)
value (float)
unit (string)
treshold_yellow (float)
treshold_red (float)
logdynamic_lowbad(name, value, unit, treshold_yellow, treshold_red)
Parameters:
name (string)
value (int)
unit (string)
treshold_yellow (float)
treshold_red (float)
logdynamic_highbad(name, value, unit, treshold_yellow, treshold_red)
Parameters:
name (string)
value (float)
unit (string)
treshold_yellow (float)
treshold_red (float)
logdynamic_highbad(name, value, unit, treshold_yellow, treshold_red)
Parameters:
name (string)
value (int)
unit (string)
treshold_yellow (float)
treshold_red (float)
logdynamic_falsebad(name, value, unit)
Parameters:
name (string)
value (bool)
unit (string)
logdynamic_truebad(name, value, unit)
Parameters:
name (string)
value (bool)
unit (string)
Auto LevelsAutomatically paints open, high, low, and close levels from previous periods.
RTH data only in traditional cash markets.
Previous periods included are:
- Day
- Week
- Month
- Quarter
- Year.
Customization options allow for:
- Enabling/disabling of each type of level for each period
- Text size and colors of labels
- Colors and styles of lines
- Line extension length
*Also, there is a close-price ray included. Can be disabled.
Creates new levels once they generate, and removes old and outdated levels.
The idea is to be transparent about the relevancy of levels and portray them as they generate in time. Full 2-way-ray horizontal lines can appear to give false-reaction data in historical bars from before the level was generated. This can give traders a false sense of importance to a level.
Works on any ticker/symbol.
Known bugs:
** Open levels distort based on open/closed status in traditional markets. Fix pending.
** Different candle types (Heikin Ashi) distort all open/close level data. Fix pending.
** Line extension doesn't work in closed markets. Fix pending.
Message me on twitter for other bug reports.
Z Score Overlay [BigBeluga]🔵 OVERVIEW
A clean and effective Z-score overlay that visually tracks how far price deviates from its moving average. By standardizing price movements, this tool helps traders understand when price is statistically extended or compressed—up to ±4 standard deviations. The built-in scale and real-time bin markers offer immediate context on where price stands in relation to its recent mean.
🔵 CONCEPTS
Z Score Calculation:
Z = (Close − SMA) ÷ Standard Deviation
This formula shows how many standard deviations the current price is from its mean.
Statistical Extremes:
• Z > +2 or Z < −2 suggests statistically significant deviation.
• Z near 0 implies price is close to its average.
Standardization of Price Behavior: Makes it easier to compare volatility and overextension across timeframes and assets.
🔵 FEATURES
Colored Z Line: Gradient coloring based on how far price deviates—
• Red = oversold (−4),
• Green = overbought (+4),
• Yellow = neutral (~0).
Deviation Scale Bar: A vertical scale from −4 to +4 standard deviations plotted to the right of price.
Active Z Score Bin: Highlights the current Z-score bin with a “◀” arrow
Context Labels: Clear numeric labels for each Z-level from −4 to +4 along the side.
Live Value Display: Shows exact Z-score on the active level.
Non-intrusive Overlay: Can be applied directly to price chart without changing scaling behavior.
🔵 HOW TO USE
Identify overbought/oversold areas based on +2 / −2 thresholds.
Spot potential mean reversion trades when Z returns from extreme levels.
Confirm strong trends when price remains consistently outside ±2.
Use in multi-timeframe setups to compare strength across contexts.
🔵 CONCLUSION
Z Score Overlay transforms raw price action into a normalized statistical view, allowing traders to easily assess deviation strength and mean-reversion potential. The intuitive scale and color-coded display make it ideal for traders seeking objective, volatility-aware entries and exits.
Daily Trading Barometer (DTB) with DJIA OverlayThe "Daily Trading Barometer (DTB) with DJIA Overlay" is a custom technical indicator designed to identify intermediate-term overbought and oversold conditions in the stock market, inspired by Edson Gould's original DTB methodology. This indicator combines three key components:
A 7-day advance-decline oscillator, a 20-day volume oscillator, and a 28-day DJIA price ratio, normalized into a composite index scaled around 110–135. Values below 110 signal potential oversold conditions, while values above 135 indicate overbought territory, aiding in timing market reversals.
The overlay of a normalized DJIA plot allows for visual correlation with the broader market trend. Use this tool to anticipate turning points in oscillating markets, though it’s best combined with other indicators for confirmation. Ideal for traders seeking probabilistic insights into bear or bull market transitions.
How to use -
If the DTB line (blue) and normalized DJIA (orange) are under the green dashed line, high probability for a long and reversal.
Use with the symbol SPX/QQQ
Dow Jones Industrial Average - DJIA
Gap % Distribution Table (2% Bins)Description
This indicator displays a Gap % Distribution Table categorized in 2% bins ranging from `< -20%` to `> +20%`. It calculates the gap between today’s open and the previous day’s close, and groups occurrences into defined bins. The table includes:
Gap range, count, and percentage for each bin
A total row summarizing all entries
Customizable appearance including:
Font color, cell background fill (with transparency), and table border color
Column headers and full outer border
Date filtering using selectable start and end dates
Position control for placing the table on the chart area
Ideal for analyzing the historical behavior of opening gaps for any instrument.
Average Day Range(%)Average Day Range in percentages. This indicator shows that average movement of the stock price in last n number of candles in percentages. This gives you an idea of the volatility of the stock's price.