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!
Statistics
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.
TimeframePine script to create a hover text over the asset indicating the asset, date, and current timeframe.
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.
Order Flow Delta Matrix Pro @MaxMaserati 2.0Order Flow Delta Matrix Pro @MaxMaserati 2.0
Institutional-level order flow analysis
This advanced indicator displays institutional order flow data in an easy-to-read time-series matrix, revealing hidden buying and selling pressure that drives price movements.
KEY FEATURES
🔥 REAL-TIME DELTA TRACKING
- Delta Row: Net buying vs selling pressure per time period
- Live Countdown: Shows exact time remaining until next candle close
- Extended historical view for pattern recognition
CUSTOMIZABLE ROWS (Toggle On/Off)
- Max Delta: Highest buying pressure spikes (accumulation zones)
- *Min Delta: Lowest selling pressure spikes (distribution zones)
- Cumulative Delta: Running total showing institutional bias
- Delta/Volume Ratio: Quality of directional flow vs total volume
- Session Delta: Net flow since session start
- Volume: Raw transaction volume with high-volume highlighting
ADVANCED CONTROLS
- Time Direction: View oldest→newest OR newest→oldest
- 12/24 Hour Format: Choose your preferred time display
- Current Time Highlighting: Blue highlight on active time period
- Full Color Customization: Adapt to any chart theme
- Smart Sensitivity: Low/Normal/High modes for different markets
🎓 HOW TO USE IT
🟢 BULLISH SIGNALS
- Positive Delta Spikes: Look for green +500K+ delta values
- Rising Cumulative Delta: Upward trending cumulative line = institutional accumulation
- High Max Delta: Strong buying pressure at support levels
🔴 BEARISH SIGNALS
- Negative Delta Spikes: Look for red -500K+ delta values
- Falling Cumulative Delta: Downward trending cumulative = institutional distribution
- High Min Delta: Strong selling pressure at resistance levels
PRO TECHNIQUES
-Divergence Analysis: Price goes up but cumulative delta goes down = potential reversal
- Volume Confirmation: High delta + high volume = strong institutional conviction
- Session Bias: Positive session delta = bullish bias, negative = bearish bias
BEST USED FOR
- Scalping: 1-5 minute timeframes for quick institutional flow detection
- Day Trading: 15-60 minute timeframes for session bias and reversal spots
- Volume Profile: Combine with volume profile for complete order flow picture
- Futures Trading: Excellent for ES, NQ, crude oil, forex majors
PRO TIPS
1. Watch for Delta Divergences - Most reliable reversal signal
2. High Volume + High Delta = Institutional activity
3. Session Delta Direction = Overall market bias
4. Blue highlighted column= Current live data
5. Use with Support/Resistance for entry/exit timing
IMPORTANT NOTES
- Works on ALL timeframes and ALL markets
- Real-time updates for live trading decisions
- Historical data available for backtesting strategies
- No repainting - all signals are final and reliable
The matrix format makes complex data easy to interpret, giving a significant edge in understanding market dynamics and smart money order timing.
PRICE MOVEMENT STATISTICS# Price Movement Statistics - Advanced Pattern Recognition System
## Foundation
Price Movement Statistics (PMS) represents a fundamentally different approach to market analysis compared to traditional indicators like RSI, Moving Averages, or Bollinger Bands. While most indicators rely on mathematical transformations of price data, PMS implements a **machine learning-inspired nearest-neighbor algorithm** that compares current market conditions against thousands of historical patterns across multiple correlated instruments.
### What Makes This Original
Unlike standard indicators that follow predetermined formulas, PMS:
1. **Multi-Symbol Pattern Database**: Analyzes up to 4 different but correlated symbols simultaneously, creating a massive historical pattern database that single-symbol indicators cannot access
2. **8-Feature Normalized Vector Comparison**: Converts each candlestick into 8 numerical features (body-to-range ratios, wick proportions, relative positioning, momentum characteristics) and uses Manhattan distance calculations to find statistically similar historical situations
3. **Forward-Looking Statistical Validation**: Instead of just identifying patterns, PMS tracks what actually happened 1-5 bars after similar patterns occurred historically, providing probabilistic forecasts with sample sizes and confidence levels
4. **Adaptive Similarity Scoring**: Uses real-time distance calculations between current conditions and historical patterns, allowing traders to see exactly how many similar cases existed and their outcomes
## Technical Methodology Explained
### Pattern Recognition Engine
The core algorithm transforms each market condition into a normalized 8-dimensional vector containing:
- Short vs. long-term range ratios computed using proprietary envelope calculations
- Price position relative to recent ranges using adaptive scaling methods
- Volatility comparisons across multiple timeframes with logarithmic return analysis
- Momentum divergences between short and long-term linear regression slopes
- Volume behavior patterns using statistical deviation scoring
- Candlestick structure metrics including ATR ratios and boundary touch frequencies
### Advanced Code Architecture
**Multi-Symbol Data Pipeline**: The system employs Pine Script's `request.security()` function in a sophisticated loop structure that simultaneously processes up to 4 different instruments. Each symbol contributes its own 8-feature vector, creating a 32-dimensional search space that dramatically expands pattern recognition capabilities beyond single-symbol analysis.
**Adaptive Normalization Engine**: Rather than using simple percentage changes, the code implements a custom `scale_adaptive()` function that ranks current values against rolling historical distributions. This percentile-based approach ensures pattern recognition remains consistent across different market volatility regimes and price levels.
**Distance Matrix Calculations**: The matching algorithm runs nested loops through thousands of historical bars, computing Manhattan distances for each potential match. The code optimizes performance by using vectorized operations and early termination conditions when similarity thresholds aren't met.
**Forward-Looking Analysis Pipeline**: Once matches are identified, the system implements a sophisticated outcome tracking mechanism that categorizes future price movements, volume behaviors, and candle characteristics. This requires careful index management to avoid look-ahead bias while maintaining real-time calculation efficiency.
### Similarity Matching Process
1. **Data Normalization**: Features are processed through custom percentile ranking against 500-bar rolling windows
2. **Distance Calculation**: Optimized Manhattan distance computation across 8-dimensional vectors with early exit conditions
3. **Multi-Symbol Aggregation**: Matches from different symbols are weighted and combined using statistical averaging techniques
4. **Threshold Filtering**: Dynamic similarity boundaries that adapt to market volatility conditions
5. **Outcome Analysis**: Forward-looking statistical compilation with bias tracking and magnitude calculations
### Statistical Output Generation
The system's proprietary aggregation engine provides:
- **Win/Loss Ratios**: Calculated from actual forward-price movements with statistical weighting
- **Sample Sizes**: Match counts across all symbols with confidence scoring algorithms
- **Average Magnitude**: Expected move calculations using historical outcome distributions
- **Volume Context**: Pattern-specific volume analysis using normalized scoring methods
- **Directional Bias**: Multi-timeframe probability calculations with cross-symbol validation
## Why This Approach is Worth the Investment
### Beyond Traditional Indicators
Standard indicators like RSI or MACD give you oversold/overbought signals or momentum divergences, but they don't answer the crucial question: "What happened historically when similar conditions occurred?" PMS bridges this gap by providing:
1. **Quantified Probabilities**: Instead of subjective pattern recognition, you get actual win rates and sample sizes
2. **Cross-Market Validation**: Patterns confirmed across multiple correlated instruments carry more statistical weight
3. **Sample Size Transparency**: You can see whether a signal is based on 5 occurrences or 500, adjusting confidence accordingly
4. **Magnitude Expectations**: Historical data shows not just direction, but expected move sizes
### Practical Trading Applications
**Entry Timing**: When PMS shows >70% historical win rate with 100+ matches, you have statistical evidence supporting your entry rather than relying on visual pattern interpretation.
**Risk Management**: Historical magnitude data helps size positions appropriately based on expected adverse moves in similar past situations.
**Confirmation**: Multi-symbol analysis provides cross-market confirmation that single-symbol indicators cannot offer.
## How to Use the System
### Signal Interpretation
- **Bias Ratio >1.5**: Historically bullish (more winning long trades than losing ones)
- **Bias Ratio <0.67**: Historically bearish (more winning short trades than losing ones)
- **Sample Size >50**: High confidence (sufficient historical data)
- **Sample Size <20**: Low confidence (limited historical precedent)
### Setup Optimization
- **Symbol Selection**: Choose 3-4 correlated instruments (e.g., stock + sector ETF + index, or currency pairs with base currency relationships)
- **Timeframe Coordination**: Use higher timeframes for broader context, lower timeframes for precise entry timing
- **Threshold Adjustment**: Lower similarity thresholds find more specific matches; higher thresholds increase sample sizes
## Technical Requirements and Limitations
**Data Depth**: Requires minimum 1000 bars per symbol for meaningful analysis; 3000+ bars recommended for optimal performance.
**Computational Load**: Real-time pattern matching across multiple symbols and thousands of historical bars requires TradingView's advanced Pine Script capabilities.
**Market Applicability**: Most effective in liquid markets with sufficient historical data; less reliable in newly listed instruments or during unprecedented market conditions.
## Important Disclaimers
This system identifies historical statistical patterns under similar conditions—it does not predict future movements with certainty. Effectiveness depends on intelligent symbol selection, appropriate timeframe usage, and integration with proper risk management. Past performance patterns do not guarantee future results, and all trading involves substantial risk of loss.
The algorithm's sophistication lies not in complex mathematical formulas, but in its ability to efficiently search through massive historical datasets and quantify pattern outcomes—something impossible to do manually and unavailable in standard technical indicators.
SIP Evaluator and Screener [Trendoscope®]The SIP Evaluator and Screener is a Pine Script indicator designed for TradingView to calculate and visualize Systematic Investment Plan (SIP) returns across multiple investment instruments. It is tailored for use in TradingView's screener, enabling users to evaluate SIP performance for various assets efficiently.
🎲 How SIP Works
A Systematic Investment Plan (SIP) is an investment strategy where a fixed amount is invested at regular intervals (e.g., monthly or weekly) into a financial instrument, such as stocks, mutual funds, or ETFs. The goal is to build wealth over time by leveraging the power of compounding and mitigating the impact of market volatility through disciplined, consistent investing. Here’s a breakdown of how SIPs function:
Regular Investments : In an SIP, an investor commits to investing a fixed sum at predefined intervals, regardless of market conditions. This consistency helps inculcate a habit of saving and investing.
Cost Averaging : By investing a fixed amount regularly, investors purchase more units when prices are low and fewer units when prices are high. This approach, known as dollar-cost averaging, reduces the average cost per unit over time and mitigates the risk of investing a large amount at a peak price.
Compounding Benefits : Returns generated from the invested amount (e.g., capital gains or dividends) are reinvested, leading to exponential growth over the long term. The longer the investment horizon, the greater the potential for compounding to amplify returns.
Dividend Reinvestment : In some SIPs, dividends received from the underlying asset can be reinvested to purchase additional units, further enhancing returns. Taxes on dividends, if applicable, may reduce the reinvested amount.
Flexibility and Accessibility : SIPs allow investors to start with small amounts, making them accessible to a wide range of individuals. They also offer flexibility in terms of investment frequency and the ability to adjust or pause contributions.
In the context of the SIP Evaluator and Screener , the script simulates an SIP by calculating the number of units purchased with each fixed investment, factoring in commissions, dividends, taxes and the chosen price reference (e.g., open, close, or average prices). It tracks the cumulative investment, equity value, and dividends over time, providing a clear picture of how an SIP would perform for a given instrument. This helps users understand the impact of regular investing and make informed decisions when comparing different assets in TradingView’s screener. It offers insights into key metrics such as total invested amount, dividends received, equity value, and the number of installments, making it a valuable resource for investors and traders interested in understanding long-term investment outcomes.
🎲 Key Features
Customizable Investment Parameters: Users can define the recurring investment amount, price reference (e.g., open, close, HL2, HLC3, OHLC4), and whether fractional quantities are allowed.
Commission Handling: Supports both fixed and percentage-based commission types, adjusting calculations accordingly.
Dividend Reinvestment: Optionally reinvests dividends after a user-specified period, with the ability to apply tax on dividends.
Time-Bound Analysis: Allows users to set a start year for the analysis, enabling historical performance evaluation.
Flexible Dividend Periods: Dividends can be evaluated based on bars, days, weeks, or months.
Visual Outputs: Plots key metrics like total invested amount, dividends, equity value, and remainder, with customizable display options for clarity in the data window and chart.
🎲 Using the script as an indicator on Tradingview Supercharts
In order to use the indicator on charts, do the following.
Load the instrument of your choice - Preferably a stable stocks, ETFs.
Chose monthly timeframe as lower timeframes are insignificant in this type of investment strategy
Load the indicator SIP Evaluator and Screener and set the input parameters as per your preference.
Indicator plots, investment value, dividends and equity on the chart.
🎲 Visualizations
Installments : Displays the number of SIP installments (gray line, visible in the data window).
Invested Amount : Shows the cumulative amount invested, excluding reinvested dividends (blue area plot).
Dividends : Tracks total dividends received (green area plot).
Equity : Represents the current market value of the investment based on the closing price (purple area plot).
Remainder : Indicates any uninvested cash after each installment (gray line, visible in the data window).
🎲 Deep dive into the settings
The SIP Evaluator and Screener offers a range of customizable settings to tailor the Systematic Investment Plan (SIP) simulation to your preferences. Below is an explanation of each setting, its purpose, and how it impacts the analysis:
🎯 Duration
Start Year (Default: 2020) : Specifies the year from which the SIP calculations begin. When Start Year is enabled via the timebound option, the script only considers data from the specified year onward. This is useful for analyzing historical SIP performance over a defined period. If disabled, the script uses all available data.
Timebound (Default: False) : A toggle to enable or disable the Start Year restriction. When set to False, the SIP calculation starts from the earliest available data for the instrument.
🎯 Investment
Recurring Investment (Default: 1000.0) : The fixed amount invested in each SIP installment (e.g., $1000 per period). This represents the regular contribution to the SIP and directly influences the total invested amount and quantity purchased.
Allow Fractional Qty (Default: True) : When enabled, the script allows the purchase of fractional units (e.g., 2.35 shares). If disabled, only whole units are purchased (e.g., 2 shares), with any remaining funds carried forward as Remainder. This setting impacts the precision of investment allocation.
Price Reference (Default: OPEN): Determines the price used for purchasing units in each SIP installment. Options include:
OPEN : Uses the opening price of the bar.
CLOSE : Uses the closing price of the bar.
HL2 : Uses the average of the high and low prices.
HLC3 : Uses the average of the high, low, and close prices.
OHLC4 : Uses the average of the open, high, low, and close prices. This setting affects the cost basis of each purchase and, consequently, the total quantity and equity value.
🎯 Commission
Commission (Default: 3) : The commission charged per SIP installment, expressed as either a fixed amount (e.g., $3) or a percentage (e.g., 3% of the investment). This reduces the amount available for purchasing units.
Commission Type (Default: Fixed) : Specifies how the commission is calculated:
Fixed ($) : A flat fee is deducted per installment (e.g., $3).
Percentage (%) : A percentage of the investment amount is deducted as commission (e.g., 3% of $1000 = $30). This setting affects the net amount invested and the overall cost of the SIP.
🎯 Dividends
Apply Tax On Dividends (Default: False) : When enabled, a tax is applied to dividends before they are reinvested or recorded. The tax rate is set via the Dividend Tax setting.
Dividend Tax (Default: 47) : The percentage of tax deducted from dividends if Apply Tax On Dividends is enabled (e.g., 47% tax reduces a $100 dividend to $53). This reduces the amount available for reinvestment or accumulation.
Reinvest Dividends After (Default: True, 2) : When enabled, dividends received are reinvested to purchase additional units after a specified period (e.g., 2 units of time, defined by Dividends Availability). If disabled, dividends are tracked but not reinvested. Reinvestment increases the total quantity and equity over time.
Dividends Availability (Default: Bars) : Defines the time unit for evaluating when dividends are available for reinvestment. Options include:
Bars : Based on the number of chart bars.
Weeks : Based on weeks.
Months : Based on months (approximated as 30.5 days). This setting determines the timing of dividend reinvestment relative to the Reinvest Dividends After period.
🎯 How Settings Interact
These settings work together to simulate a realistic SIP. For example, a $1000 recurring investment with a 3% commission and fractional quantities enabled will calculate the number of units purchased at the chosen price reference after deducting the commission. If dividends are reinvested after 2 months with a 47% tax, the script fetches dividend data, applies the tax, and adds the net dividend to the investment amount for that period. The Start Year and Timebound settings ensure the analysis aligns with the desired timeframe, while the Dividends Availability setting fine-tunes dividend reinvestment timing.
By adjusting these settings, users can model different SIP scenarios, compare performance across instruments in TradingView’s screener, and gain insights into how commissions, dividends, and price references impact long-term returns.
🎲 Using the script with Pine Screener
The main purpose of developing this script is to use it with Tradingview Pine Screener so that multiple ETFs/Funds can be compared.
In order to use this as a screener, the following things needs to be done.
Add SIP Evaluator and Screener to your favourites (Required for it to be added in pine screener)
Create a watch list containing required instruments to compare
Open pine screener from Tradingview main menu Products -> Screeners -> Pine or simply load the URL - www.tradingview.com
Select the watchlist created from Watchlist dropdown.
Chose the SIP Evaluator and Screener from the "Choose Indicator" dropdown
Set timeframe to 1 month and update settings as required.
Press scan to display collected data on the screener.
🎲 Use Case
This indicator is ideal for educational purposes, allowing users to experiment with SIP strategies across different instruments. It can be applied in TradingView’s screener to compare SIP performance for stocks, ETFs, or other assets, helping users understand how factors like commissions, dividends, and price references impact returns over time.
Rapid Ultimat Trading ZonesCRITICAL: The "Set It and Forget It" Timezone System
Have you ever had your session indicators become misaligned when London or New York changes clocks for Daylight Saving Time (DST)? This is a universal problem for traders, forcing you to manually adjust settings twice a year to avoid missing key trading windows. It’s confusing, frustrating, and can lead to costly mistakes.
The Rapid Ultimate Trading Zones indicator permanently solves this issue. We have engineered it with a powerful 'Set It and Forget It' timezone system that provides unmatched accuracy and peace of mind.
How It Works : Automatic DST Adjustment
Each Killzone and each Opening Range in this indicator has its own independent timezone setting. You simply match each session to its real-world location one time. From that moment on, the indicator handles everything automatically.
For the London Session: Set its timezone to Europe/London. The indicator will automatically handle the switch between GMT (winter) and BST (summer). You do not need to do anything.
For the New York Session: Set its timezone to America/New_York. The indicator will automatically handle the switch between EST (winter) and EDT (summer).
Once configured, your session timings will remain perfectly accurate forever. No more manual adjustments. No more confusion. Just precise, reliable session data, day in and day out.
Here is the complete user guide with the newly emphasized section integrated for your convenience.
Rapid Ultimate Trading Zones - User Guide
Created by Rapid Lodgements
1. Introduction: Your All-in-One Session & Levels Tool
Tired of manually marking out trading sessions and key levels every day? The Rapid Ultimate Trading Zones indicator is a comprehensive, institutional-grade tool designed to automatically visualize the most important price and time levels on your chart.
From London Killzone highs and lows to multiple, flexible Opening Ranges, this indicator provides a clean, automated, and fully customizable solution to help you focus on what matters most: your trading.
2. CRITICAL: The "Set It and Forget It" Timezone System
Have you ever had your session indicators become misaligned when London or New York changes clocks for Daylight Saving Time (DST)? This is a universal problem for traders, forcing you to manually adjust settings twice a year to avoid missing key trading windows. It’s confusing, frustrating, and can lead to costly mistakes.
The Rapid Ultimate Trading Zones indicator permanently solves this issue. We have engineered it with a powerful 'Set It and Forget It' timezone system that provides unmatched accuracy and peace of mind.
How It Works: Automatic DST Adjustment
Each Killzone and each Opening Range in this indicator has its own independent timezone setting. You simply match each session to its real-world location one time. From that moment on, the indicator handles everything automatically.
For the London Session: Set its timezone to Europe/London. The indicator will automatically handle the switch between GMT (winter) and BST (summer). You do not need to do anything.
For the New York Session: Set its timezone to America/New_York. The indicator will automatically handle the switch between EST (winter) and EDT (summer).
Once configured, your session timings will remain perfectly accurate forever. No more manual adjustments. No more confusion. Just precise, reliable session data, day in and day out.
3. Feature Breakdown
Killzones & Killzone Pivots
This is the core feature of the indicator. Killzones are specific, high-volume time windows for the major market sessions. The indicator will automatically draw a box around these times and mark their high and low price pivots.
Killzones Settings:
Enable/disable each session (Asia, London, NY AM, NY Lunch, NY PM) with the checkbox.
Customize the Session start and end times.
Crucially, set the Timezone for each session to its local market time.
Killzone Pivots Settings:
Labels & Colors: Customize the text label and color for each Killzone's high and low pivot lines. The color you choose here controls the color for the pivots and the session box.
Extend Pivots: Choose if the pivot lines should disappear after being touched (Until Mitigated) or continue to extend.
Alert Broken Pivots: Enable this to receive a TradingView alert whenever price breaks a recent Killzone high or low.
Show Midpoints: Optionally display the 50% level between a Killzone's high and low.
Flexible Opening Ranges (Up to 3 Instances)
This powerful feature allows you to track the initial price range of up to three different sessions independently.
Use Cases:
Track the first 15 minutes of the New York session with Opening Range 1.
Track the first hour of the London session with Opening Range 2.
Track the Asian session range with Opening Range 3.
Configuration (for each OR):
Enable OR: Toggle the specific range on or off.
Session Start-End: Defines the main session you are analyzing.
Timezone: Set the correct local timezone for the session you are tracking.
Range Minutes: The most important setting. Defines how long the opening range lasts (e.g., 15 for the first 15 minutes).
Extend OR lines right: Extends the high and low lines into the future.
Custom Lines & Timestamps
For marking your own specific levels and times that are independent of the Killzones.
Dedicated Timezone : This entire section is controlled by one separate timezone menu, which is set to GMT+0 by default. All times you enter here will be interpreted based on this setting.
Horizontal Lines (H-Line): Draws a horizontal line at the open price of the candle that occurs at your specified time. You get two independent lines.
Vertical Lines (V-Line): Draws a vertical line at the time you specify. You get two independent lines.
Daily, Weekly, Monthly (DWM) Levels
For a higher-timeframe perspective, this feature automatically plots:
Daily, Weekly, and Monthly Opening Prices.
Previous Day, Week, and Month Highs and Lows.
Vertical line separators for the start of each Day, Week, or Month.
4. General Settings
Session Drawing Limit: This is your master history control. It sets how many past days of drawings (for Killzones, Opening Ranges, etc.) will be kept on your chart. A lower number improves performance.
Timeframe Limit: To keep your chart clean, drawings will not appear on timeframes greater than or equal to the one you select here.
Label Size / Text Color: Controls the appearance of all text and labels drawn by the indicator.
TradeCrafted - Previous 10 Highs and LowsUnlock the power of historical price action with the 10-Day Highs & Lows Indicator! This innovative tool analyzes the highest and lowest price levels of the past 10 trading days and projects them as fixed lines onto the current session. By plotting these crucial support and resistance levels, traders gain a clear visual edge to anticipate market reactions, trend reversals, and breakout opportunities.
🔥 Key Features:
✅ Precision Levels – Automatically plots the previous 10 days' highs and lows for accurate decision-making.
✅ Fixed Lines for Clarity – Levels remain unchanged throughout the session, providing a stable reference.
✅ Enhanced Market Structure Analysis – Identify key zones where price is likely to react.
✅ Ideal for All Traders – Whether you're a scalper, swing trader, or intraday enthusiast, these levels offer a strong foundation for your strategy.
🚀 Why Use This Indicator?
Markets move in cycles, and historical highs and lows act as magnets for price action. By integrating this tool into your trading arsenal, you can spot potential breakouts, retests, and reversals with greater confidence!
Elevate your technical analysis and trade smarter with the 10-Day Highs & Lows Indicator! 🔥
How to use : Trader Can take Buy entry if price is near line and taking reversal from it so it will be very good for trader to manage the stop loss. Simply if it goes below the line, just cut the trade to avoid unnecessary and huge loss. This Indicator will help Trader to take correct entry and exit.
Hope my effort will help trader to stay in profit.
QQQ NQ NDX SPY SPX ES Price Convert Overlay
_____________________________________________________________________
QQQ NQ NDX SPY SPX ES Price Convert Overlay Indicator
____________________
This 'Prices Overlay' indicator is a minimalist tool for traders who want to track and compare Nasdaq and S&P 500 instruments quickly and clearly, boosting efficiency and decision-making with minimal distraction.
How to Use It
____________________
Add the indicator onto your TradingView chart.
Adjust your Right Margin in TradingView Settings > Canvas to show as much or as little of the line as you want, based on the "Price Buffer" indicator setting.
Select which instruments to overlay (e.g., QQQ, SPX).
Adjust levels, buffer, font, transparency, and update interval.
Features and Functions
____________________
1. Automatic Ticker Detection:
The indicator identifies the ticker of your current chart (e.g., NQ, ES, SPY).
It then shows price levels for related instruments, eg:
On an NQ or MNQ chart, it can display QQQ or NDX levels.
On an ES or MES chart, it can display SPY or SPX levels.
...and vice versa
2. Adjustable Number of Levels
You can choose how many price levels to show, from 10 to 100.
This lets you decide how much detail you want based on your trading needs.
3. Visual Customization
Price Buffer: Move the lines and labels horizontally closer/further price action.
Font Size: Pick from "Tiny," "Small," or "Normal" for label text size.
Line Transparency: Adjust the opacity of the lines (0% = solid, 100% = invisible) to blend them with your chart.
4. Support for Micro Futures
Works with both regular futures (NQ, ES) and micro futures (MNQ, MES), perfect for traders using smaller contract sizes.
5. Update Frequency
Set how often the price levels refresh, from every 5 seconds to every 60 seconds.
This keeps the data current without slowing down your chart.
6. Accurate Price Conversion
Uses specific multipliers for each instrument (e.g., 100.0 for NDX and SPX, 1.0 for QQQ and SPY) to calculate and display price levels correctly.
Fetches real-time prices and converts them to match your chart’s scale.
Price conversions courtesy of PtGambler.
Benefits
____________________
Easier Analysis: See how prices from different instruments line up on one chart—no need for multiple screens or math.
Customizable: Turn on/off instruments and tweak visuals to fit your trading style.
Time-Saving: Automates price conversions, letting you focus on trading decisions.
Thanks!
____________________
Thank you for your interest in my work. This is something I use every day for my trading and wanted to share it with the public. If you have any comments, bugs, or suggestions, please leave them here, or you can find me on Twitter or Discord.
@ ContrarianIRL
Open-source developer for over 25 years
Long/Short/Exit/Risk management Strategy # LongShortExit Strategy Documentation
## Overview
The LongShortExit strategy is a versatile trading system for TradingView that provides complete control over entry, exit, and risk management parameters. It features a sophisticated framework for managing long and short positions with customizable profit targets, stop-loss mechanisms, partial profit-taking, and trailing stops. The strategy can be enhanced with continuous position signals for visual feedback on the current trading state.
## Key Features
### General Settings
- **Trading Direction**: Choose to trade long positions only, short positions only, or both.
- **Max Trades Per Day**: Limit the number of trades per day to prevent overtrading.
- **Bars Between Trades**: Enforce a minimum number of bars between consecutive trades.
### Session Management
- **Session Control**: Restrict trading to specific times of the day.
- **Time Zone**: Specify the time zone for session calculations.
- **Expiration**: Optionally set a date when the strategy should stop executing.
### Contract Settings
- **Contract Type**: Select from common futures contracts (MNQ, MES, NQ, ES) or custom values.
- **Point Value**: Define the dollar value per point movement.
- **Tick Size**: Set the minimum price movement for accurate calculations.
### Visual Signals
- **Continuous Position Signals**: Implement 0 to 1 visual signals to track position states.
- **Signal Plotting**: Customize color and appearance of position signals.
- **Clear Visual Feedback**: Instantly see when entry conditions are triggered.
### Risk Management
#### Stop Loss and Take Profit
- **Risk Type**: Choose between percentage-based, ATR-based, or points-based risk management.
- **Percentage Mode**: Set SL/TP as a percentage of entry price.
- **ATR Mode**: Set SL/TP as a multiple of the Average True Range.
- **Points Mode**: Set SL/TP as a fixed number of points from entry.
#### Advanced Exit Features
- **Break-Even**: Automatically move stop-loss to break-even after reaching specified profit threshold.
- **Trailing Stop**: Implement a trailing stop-loss that follows price movement at a defined distance.
- **Partial Profit Taking**: Take partial profits at predetermined price levels:
- Set first partial exit point and percentage of position to close
- Set second partial exit point and percentage of position to close
- **Time-Based Exit**: Automatically exit a position after a specified number of bars.
#### Win/Loss Streak Management
- **Streak Cutoff**: Automatically pause trading after a series of consecutive wins or losses.
- **Daily Reset**: Option to reset streak counters at the start of each day.
### Entry Conditions
- **Source and Value**: Define the exact price source and value that triggers entries.
- **Equals Condition**: Entry signals occur when the source exactly matches the specified value.
### Performance Analytics
- **Real-Time Stats**: Track important performance metrics like win rate, P&L, and largest wins/losses.
- **Visual Feedback**: On-chart markers for entries, exits, and important events.
### External Integration
- **Webhook Support**: Compatible with TradingView's webhook alerts for automated trading.
- **Cross-Platform**: Connect to external trading systems and notification platforms.
- **Custom Order Execution**: Implement advanced order flows through external services.
## How to Use
### Setup Instructions
1. Add the script to your TradingView chart.
2. Configure the general settings based on your trading preferences.
3. Set session trading hours if you only want to trade specific times.
4. Select your contract specifications or customize for your instrument.
5. Configure risk parameters:
- Choose your preferred risk management approach
- Set appropriate stop-loss and take-profit levels
- Enable advanced features like break-even, trailing stops, or partial profit taking as needed
6. Define entry conditions:
- Select the price source (such as close, open, high, or an indicator)
- Set the specific value that should trigger entries
### Entry Condition Examples
- **Example 1**: To enter when price closes exactly at a whole number:
- Long Source: close
- Long Value: 4200 (for instance, to enter when price closes exactly at 4200)
- **Example 2**: To enter when an indicator reaches a specific value:
- Long Source: ta.rsi(close, 14)
- Long Value: 30 (triggers when RSI equals exactly 30)
### Best Practices
1. **Always backtest thoroughly** before using in live trading.
2. **Start with conservative risk settings**:
- Small position sizes
- Reasonable stop-loss distances
- Limited trades per day
3. **Monitor and adjust**:
- Use the performance table to track results
- Adjust parameters based on how the strategy performs
4. **Consider market volatility**:
- Use ATR-based stops during volatile periods
- Use fixed points during stable markets
## Continuous Position Signals Implementation
The LongShortExit strategy can be enhanced with continuous position signals to provide visual feedback about the current position state. These signals can help you track when the strategy is in a long or short position.
### Adding Continuous Position Signals
Add the following code to implement continuous position signals (0 to 1):
```pine
// Continuous position signals (0 to 1)
var float longSignal = 0.0
var float shortSignal = 0.0
// Update position signals based on your indicator's conditions
longSignal := longCondition ? 1.0 : 0.0
shortSignal := shortCondition ? 1.0 : 0.0
// Plot continuous signals
plot(longSignal, title="Long Signal", color=#00FF00, linewidth=2, transp=0, style=plot.style_line)
plot(shortSignal, title="Short Signal", color=#FF0000, linewidth=2, transp=0, style=plot.style_line)
```
### Benefits of Continuous Position Signals
- Provides clear visual feedback of current position state (long/short)
- Signal values stay consistent (0 or 1) until condition changes
- Can be used for additional calculations or alert conditions
- Makes it easier to track when entry conditions are triggered
### Using with Custom Indicators
You can adapt the continuous position signals to work with any custom indicator by replacing the condition with your indicator's logic:
```pine
// Example with moving average crossover
longSignal := fastMA > slowMA ? 1.0 : 0.0
shortSignal := fastMA < slowMA ? 1.0 : 0.0
```
## Webhook Integration
The LongShortExit strategy is fully compatible with TradingView's webhook alerts, allowing you to connect your strategy to external trading platforms, brokers, or custom applications for automated trading execution.
### Setting Up Webhooks
1. Create an alert on your chart with the LongShortExit strategy
2. Enable the "Webhook URL" option in the alert dialog
3. Enter your webhook endpoint URL (from your broker or custom trading system)
4. Customize the alert message with relevant information using TradingView variables
### Webhook Message Format Example
```json
{
"strategy": "LongShortExit",
"action": "{{strategy.order.action}}",
"price": "{{strategy.order.price}}",
"quantity": "{{strategy.position_size}}",
"time": "{{time}}",
"ticker": "{{ticker}}",
"position_size": "{{strategy.position_size}}",
"position_value": "{{strategy.position_value}}",
"order_id": "{{strategy.order.id}}",
"order_comment": "{{strategy.order.comment}}"
}
```
### TradingView Alert Condition Examples
For effective webhook automation, set up these alert conditions:
#### Entry Alert
```
{{strategy.position_size}} != {{strategy.position_size}}
```
#### Exit Alert
```
{{strategy.position_size}} < {{strategy.position_size}} or {{strategy.position_size}} > {{strategy.position_size}}
```
#### Partial Take Profit Alert
```
strategy.order.comment contains "Partial TP"
```
### Benefits of Webhook Integration
- **Automated Trading**: Execute trades automatically through supported brokers
- **Cross-Platform**: Connect to custom trading bots and applications
- **Real-Time Notifications**: Receive trade signals on external platforms
- **Data Collection**: Log trade data for further analysis
- **Custom Order Management**: Implement advanced order types not available in TradingView
### Compatible External Applications
- Trading bots and algorithmic trading software
- Custom order execution systems
- Discord, Telegram, or Slack notification systems
- Trade journaling applications
- Risk management platforms
### Implementation Recommendations
- Test webhook delivery using a free service like webhook.site before connecting to your actual trading system
- Include authentication tokens or API keys in your webhook URL or payload when required by your external service
- Consider implementing confirmation mechanisms to verify trade execution
- Log all webhook activities for troubleshooting and performance tracking
## Strategy Customization Tips
### For Scalping
- Set smaller profit targets (1-3 points)
- Use tighter stop-losses
- Enable break-even feature after small profit
- Set higher max trades per day
### For Day Trading
- Use moderate profit targets
- Implement partial profit taking
- Enable trailing stops
- Set reasonable session trading hours
### For Swing Trading
- Use longer-term charts
- Set wider stops (ATR-based often works well)
- Use higher profit targets
- Disable daily streak reset
## Common Troubleshooting
### Low Win Rate
- Consider widening stop-losses
- Verify that entry conditions aren't triggering too frequently
- Check if the equals condition is too restrictive; consider small tolerances
### Missing Obvious Trades
- The equals condition is extremely precise. Price must exactly match the specified value.
- Consider using floating-point precision for more reliable triggers
### Frequent Stop-Outs
- Try ATR-based stops instead of fixed points
- Increase the stop-loss distance
- Enable break-even feature to protect profits
## Important Notes
- The exact equals condition is strict and may result in fewer trade signals compared to other conditions.
- For instruments with decimal prices, exact equality might be rare. Consider the precision of your value.
- Break-even and trailing stop calculations are based on points, not percentage.
- Partial take-profit levels are defined in points distance from entry.
- The continuous position signals (0 to 1) provide valuable visual feedback but don't affect the strategy's trading logic directly.
- When implementing continuous signals, ensure they're aligned with the actual entry conditions used by the strategy.
---
*This strategy is for educational and informational purposes only. Always test thoroughly before using with real funds.*
M2 Liquidity Divergence ModelM2 Liquidity Divergence Model
The M2 Liquidity Divergence Model is a macro-aware visualization tool designed to compare shifts in global liquidity (M2) against the performance of a benchmark asset (default: Bitcoin). This script captures liquidity flows across major global economies and highlights whether price action is aligned ("Agreement") or diverging ("Divergence") from macro trends.
🔍 Core Features
M2 Global Liquidity Index (GLI):
Aggregates M2 money supply from major global economies, FX-adjusted, including extended contributors like India, Brazil, and South Africa. The slope of this composite is used to infer macro liquidity trends.
Lag Offset Control:
Allows the M2 signal to lead benchmark asset price by a configurable number of days (Lag Offset), useful for modeling the forward-looking nature of macro flows.
Gradient Macro Context (Background):
Displays a color-gradient background—aqua for expansionary liquidity, fuchsia for contraction—based on the slope and volatility of M2. This contextual backdrop helps users visually anchor price action within macro shifts.
Divergence Histogram (Optional):
Plots a histogram showing dynamic correlation or divergence between the liquidity index and the selected benchmark.
Agreement Mode: M2 and asset are moving together.
Divergence Mode: Highlights break in expected macro-asset alignment.
Adaptive Transparency Scaling:
Histogram and background gradients scale their visual intensity based on statistical deviation to emphasize stronger signals.
Toggle Options:
Show/hide the M2 Liquidity Index line.
Show/hide divergence histogram.
Enable/disable visual offset of M2 to benchmark.
🧠 Suggested Usage
Macro Positioning: Use the background context to align directional trades with macro liquidity flows.
Disagreement as Signal: Use divergence plots to identify when price moves against macro expectations—potential reversal or exhaustion zones.
Time-Based Alignment: Adjust Lag Offset to synchronize M2 signals with asset price behavior across different market conditions.
⚠️ Disclaimer
This indicator is designed for educational and analytical purposes only. It does not constitute financial advice or an investment recommendation. Always conduct your own research and consult a licensed financial advisor before making trading decisions.
LMAsLibrary "LMAs"
Credits
Thank you to @QuantraSystems for dynamic calculations.
Introduction
This lightweight library offers dynamic implementations of popular moving averages that adapt their length automatically as new bars are added to the chart.
Each function is built on a dynamic length formula:
len = math.min(maxLength, bar_index + 1)
This approach ensures that calculations begin as early as the first bar, allowing for smoother initialization and more consistent behavior across all timeframes. It’s especially useful in custom scripts that run from bar 0 or when historical data is limited.
Usage
You can use this library as a drop-in replacement for standard moving averages. It provides more flexibility and stability in live or backtesting environments where fixed-length indicators may delay or fail to initialize properly.
Why Use This?
• Works from the very first bar
• Avoids na values during early bars
• Great for real-time indicators, strategies, and bar-replay
• Clean and efficient code with dynamic behavior
How to Use
Import the library into your script and call any of the included functions just like you would with their native counterparts.
Summary
A lightweight Pine Script™ library offering dynamic moving averages that work seamlessly from the very first bar. Ideal for strategies and indicators requiring robust initialization and adaptive behavior.
SMA(sourceData, maxLength)
Dynamic SMA
Parameters:
sourceData (float)
maxLength (int)
EMA(src, length)
Dynamic EMA
Parameters:
src (float)
length (int)
DEMA(src, length)
Dynamic DEMA
Parameters:
src (float)
length (int)
TEMA(src, length)
Dynamic TEMA
Parameters:
src (float)
length (int)
WMA(src, length)
Dynamic WMA
Parameters:
src (float)
length (int)
HMA(src, length)
Dynamic HMA
Parameters:
src (float)
length (int)
VWMA(src, volsrc, length)
Dynamic VWMA
Parameters:
src (float)
volsrc (float)
length (int)
SMMA(src, length)
Dynamic SMMA
Parameters:
src (float)
length (int)
LSMA(src, length, offset)
Dynamic LSMA
Parameters:
src (float)
length (int)
offset (int)
RMA(src, length)
Dynamic RMA
Parameters:
src (float)
length (int)
ALMA(src, length, offset_sigma, sigma)
Dynamic ALMA
Parameters:
src (float)
length (int)
offset_sigma (float)
sigma (float)
ZLSMA(src, length)
Dynamic ZLSMA
Parameters:
src (float)
length (int)
FRAMA(src, length)
Parameters:
src (float)
length (int)
KAMA(src, length)
Dynamic KAMA
Parameters:
src (float)
length (int)
JMA(src, length, phase)
Dynamic JMA
Parameters:
src (float)
length (int)
phase (float)
T3(src, length, volumeFactor)
Dynamic T3
Parameters:
src (float)
length (int)
volumeFactor (float)
Hidden Markov Model [Extension] | FractalystWhat's the indicator's purpose and functionality?
The Hidden Markov Model is specifically designed to integrate with the Quantify Trading Model framework, serving as a probabilistic market regime identification system for institutional trading analysis.
Hidden Markov Models are particularly well-suited for market regime detection because they can model the unobservable (hidden) state of the market, capture probabilistic transitions between different states, and account for observable market data that each state generates.
The indicator uses Hidden Markov Model mathematics to automatically detect distinct market regimes such as low-volatility bull markets, high-volatility bear markets, or range-bound consolidation periods.
This approach provides real-time regime probabilities without requiring optimization periods that can lead to overfitting, enabling systematic trading based on genuine probabilistic market structure.
How does this extension work with the Quantify Trading Model?
The Hidden Markov Model | Fractalyst serves as a probabilistic state estimation engine for systematic market analysis.
Instead of relying on traditional technical indicators, this system automatically identifies market regimes using forward algorithm implementation with three-state probability calculation (bullish/neutral/bearish), Viterbi decoding process for determining most likely regime sequence without repainting, online parameter learning with adaptive emission probabilities based on market observations, and multi-feature analysis combining normalized returns, volatility comprehensive regime assessment.
The indicator outputs regime probabilities and confidence levels that can be used for systematic trading decisions, portfolio allocation, or risk management protocols.
Why doesn't this use optimization periods like other indicators?
The Hidden Markov Model | Fractalyst deliberately avoids optimization periods to prevent overfitting bias that destroys out-of-sample performance.
The system uses a fixed mathematical framework based on Hidden Markov Model theory rather than optimized parameters, probabilistic state estimation using forward algorithm calculations that work across all market conditions, online learning methodology with adaptive parameter updates based on real-time market observations, and regime persistence modeling using fixed transition probabilities with 70% diagonal bias for realistic regime behavior.
This approach ensures the regime detection signals remain robust across different market cycles without the performance degradation typical of over-optimized traditional indicators.
Can this extension be used independently for discretionary trading?
No, the Hidden Markov Model | Fractalyst is specifically engineered for systematic implementation within institutional trading frameworks.
The indicator is designed to provide regime filtering for systematic trading algorithms and risk management systems, enable automated backtesting through mathematical regime identification without subjective interpretation, and support institutional-level analysis when combined with systematic entry/exit models.
Using this indicator independently would miss the primary value proposition of systematic regime-based strategy optimization that institutional frameworks provide.
How do I integrate this with the Quantify Trading Model?
Integration enables institutional-grade systematic trading through advanced machine learning and statistical validation:
- Add both HMM Extension and Quantify Trading Model to your chart
- Select HMM Extension as the bias source using input.source()
- Quantify automatically uses the extension's bias signals for entry/exit analysis
- The built-in machine learning algorithms score optimal entry and exit levels based on trend intensity, and market structure patterns identified by the extension
The extension handles all bias detection complexity while Quantify focuses on optimal trade timing, position sizing, and risk management along with PineConnector automation
What markets and assets does the indicator Extension work best on?
The Hidden Markov Model | Fractalyst performs optimally on markets with sufficient price movement since the system relies on statistical analysis of returns, volatility, and momentum patterns for regime identification.
Recommended asset classes include major forex pairs (EURUSD, GBPUSD, USDJPY) with high liquidity and clear regime transitions, stock index futures (ES, NQ, YM) providing consistent regime behavior patterns, individual equities (large-cap stocks with sufficient volatility for regime detection), cryptocurrency markets (BTC, ETH with pronounced regime characteristics), and commodity futures (GC, CL showing distinct market cycles and regime transitions).
These markets provide sufficient statistical variation in returns and volatility patterns, ensuring the HMM system's mathematical framework can effectively distinguish between bullish, neutral, and bearish regime states.
Any timeframe from 15-minute to daily charts provides sufficient data points for regime calculation, with higher timeframes (4H, Daily) typically showing more stable regime identification with fewer false transitions, while lower timeframes (30m, 1H) provide more responsive regime detection but may show increased noise.
Acceptable Timeframes and Portfolio Integration:
- Any timeframe that can be evaluated within Quantify Trading Model's backtesting engine is acceptable for live trading implementation.
Legal Disclaimers and Risk Acknowledgments
Trading Risk Disclosure
The HMM Extension is provided for informational, educational, and systematic bias detection purposes only and should not be construed as financial, investment, or trading advice. The extension provides institutional analysis but does not guarantee profitable outcomes, accurate bias predictions, or positive investment returns.
Trading systems utilizing bias detection algorithms carry substantial risks including but not limited to total capital loss, incorrect bias identification, market regime changes, and adverse conditions that may invalidate analysis. The extension's performance depends on accurate data, TradingView infrastructure stability, and proper integration with Quantify Trading Model, any of which may experience data errors, technical failures, or service interruptions that could affect bias detection accuracy.
System Dependency Acknowledgment
The extension requires continuous operation of multiple interconnected systems: TradingView charts and real-time data feeds, accurate reporting from exchanges, Quantify Trading Model integration, and stable platform connectivity. Any interruption or malfunction in these systems may result in incorrect bias signals, missed transitions, or unexpected analytical behavior.
Users acknowledge that neither Fractalyst nor the creator has control over third-party data providers, exchange reporting accuracy, or TradingView platform stability, and cannot guarantee data accuracy, service availability, or analytical performance. Market microstructure changes, reporting delays, exchange outages, and technical factors may significantly affect bias detection accuracy compared to theoretical or backtested performance.
Intellectual Property Protection
The HMM Extension, including all proprietary algorithms, classification methodologies, three-state bias detection systems, and integration protocols, constitutes the exclusive intellectual property of Fractalyst. Unauthorized reproduction, reverse engineering, modification, or commercial exploitation of these proprietary technologies is strictly prohibited and may result in legal action.
Liability Limitation
By utilizing this extension, users acknowledge and agree that they assume full responsibility and liability for all trading decisions, financial outcomes, and potential losses resulting from reliance on the extension's bias detection signals. Fractalyst shall not be liable for any unfavorable outcomes, financial losses, missed opportunities, or damages resulting from the development, use, malfunction, or performance of this extension.
Past performance of bias detection accuracy, classification effectiveness, or integration with Quantify Trading Model does not guarantee future results. Trading outcomes depend on numerous factors including market regime changes, pattern evolution, institutional behavior shifts, and proper system configuration, all of which are beyond the control of Fractalyst.
User Responsibility Statement
Users are solely responsible for understanding the risks associated with algorithmic bias detection, properly configuring system parameters, maintaining appropriate risk management protocols, and regularly monitoring extension performance. Users should thoroughly validate the extension's bias signals through comprehensive backtesting before live implementation and should never base trading decisions solely on automated bias detection.
This extension is designed to provide systematic institutional flow analysis but does not replace the need for proper market understanding, risk management discipline, and comprehensive trading methodology. Users should maintain active oversight of bias detection accuracy and be prepared to implement manual overrides when market conditions invalidate analysis assumptions.
Terms of Service Acceptance
Continued use of the HMM Extension constitutes acceptance of these terms, acknowledgment of associated risks, and agreement to respect all intellectual property protections. Users assume full responsibility for compliance with applicable laws and regulations governing automated trading system usage in their jurisdiction.
VWAP/VOL [Extension] | FractalystWhat's the indicator's purpose and functionality?
The VWAP/VOL Extension is designed specifically as a bias identification system for the Quantify Trading Model.
This extension uses volume-weighted average price analysis combined with institutional volume classification to automatically detect market bias without requiring optimization periods that lead to overfitting.
The system provides real-time bias signals (bullish/bearish/neutral) that integrate directly with Quantify's machine learning algorithms, enabling institutional-level backtesting and automated entry/exit identification based on genuine market structure rather than curve-fitted parameters.
How does this extension work with the Quantify Trading Model?
The VWAP/VOL Extension serves as the bias detection engine for Quantify's automated trading system.
Instead of manually selecting bias direction, this extension automatically identifies market bias using:
- Volume-weighted VWAP analysis with three-state detection (bullish/bearish/neutral)
- Institutional volume classification using relative volume thresholds without optimization
- Non-repainting architecture ensuring consistent bias signals for Quantify's machine learning
The extension outputs bias signals that Quantify uses as input through the `input.source()` function, allowing the Trading Model to focus on optimal entry/exit timing while the extension handles bias identification.
Why doesn't this use optimization periods like other indicators?
The VWAP/VOL Extension deliberately avoids optimization periods to prevent overfitting bias that destroys out-of-sample performance. The system uses:
- Fixed mathematical thresholds based on market structure principles rather than optimized parameters
- Relative volume analysis using standard 2.0x/0.5x ratios that work across all market conditions
- VWAP distance calculations based on percentage thresholds without curve-fitting
- Gap enforcement using fixed 5-bar minimums for disciplined bias detection
This approach ensures the bias signals remain robust across different market regimes without the performance degradation typical of over-optimized systems.
Can this extension be used independently for discretionary trading?
No, the VWAP/VOL Extension is specifically engineered to work as a component within the Quantify ecosystem. The extension is designed to:
- Provide bias input for Quantify's machine learning algorithms
- Enable automated backtesting through systematic bias identification
- Support institutional-level analysis when combined with Quantify's ML entry model
Using this extension independently would miss the primary value proposition of systematic entry/exit optimization that Quantify provides.
The extension handles bias detection so Quantify can focus on probability-based trade timing and risk management.
How does this enable institutional-level backtesting?
The extension transforms discretionary bias identification into systematic institutional analysis by:
- Eliminating subjective bias selection through automated VWAP/volume analysis
- Providing consistent historical signals with non-repainting architecture for accurate backtesting
- Integrating with Quantify's algorithms to identify optimal entry patterns based on objective bias states
- Enabling performance analysis across multiple market regimes without optimization bias
This combination allows Quantify to run institutional-grade backtests with consistent bias identification, generating reliable performance statistics and risk metrics that reflect genuine market edge rather than curve-fitted results.
How do I integrate this with the Quantify Trading Model?
Integration enables institutional-grade systematic trading through advanced machine learning and statistical validation:
- Add both VWAP/VOL Extension and Quantify Trading Model to your chart
- Select VWAP/VOL Extension as the bias source using input.source()
- Quantify automatically uses the extension's bias signals for entry/exit analysis
- The built-in machine learning algorithms score optimal entry and exit levels based on trend intensity, volume conviction, and market structure patterns identified by the extension
The extension handles all bias detection complexity while Quantify focuses on optimal trade timing, position sizing, and risk management along with PineConnector automation
What markets and assets does the VWAP/VOL Extension work best on?
The VWAP/VOL Extension performs optimally on markets with consistent, high-volume participation since the system relies on institutional volume analysis for bias detection. Futures markets provide the most reliable performance due to their centralized volume data and continuous institutional participation.
Recommended Futures Markets:
- ES (S&P 500 E-mini) - Over 2 million contracts daily volume, excellent liquidity depth
- NQ (NASDAQ-100 E-mini) - Around 600,000 contracts daily, strong tech sector representation
- YM (Dow Jones E-mini) - Consistent institutional flow and volume patterns
- RTY (Russell 2000 E-mini) - Small-cap exposure with reliable volume data
- GC (Gold Futures) - High volume commodity with institutional participation
- CL (Crude Oil Futures) - Energy sector representation with strong volume consistency
Why Futures Markets Excel:
- Futures markets provide centralized volume reporting, ensuring the extension's volume classification system receives accurate institutional participation data. The standardized contract specifications and continuous trading hours create consistent volume patterns that the extension's algorithms can analyze effectively.
Acceptable Timeframes and Portfolio Integration:
- Any timeframe that can be evaluated within Quantify Trading Model's backtesting engine is acceptable for live trading implementation.
The extension is specifically designed to integrate with Quantify's portfolio management system, allowing multiple strategies across different timeframes and assets to operate simultaneously while maintaining consistent bias identification methodology across the entire automated trading portfolio.
Legal Disclaimers and Risk Acknowledgments
Trading Risk Disclosure
The VWAP/VOL Extension is provided for informational, educational, and systematic bias detection purposes only and should not be construed as financial, investment, or trading advice. The extension provides volume-weighted institutional analysis but does not guarantee profitable outcomes, accurate bias predictions, or positive investment returns.
Trading systems utilizing bias detection algorithms carry substantial risks including but not limited to total capital loss, incorrect bias identification, market regime changes, and adverse conditions that may invalidate volume-based analysis. The extension's performance depends on accurate volume data, TradingView infrastructure stability, and proper integration with Quantify Trading Model, any of which may experience data errors, technical failures, or service interruptions that could affect bias detection accuracy.
System Dependency Acknowledgment
The extension requires continuous operation of multiple interconnected systems: TradingView charts and real-time data feeds, accurate volume reporting from exchanges, Quantify Trading Model integration, and stable platform connectivity. Any interruption or malfunction in these systems may result in incorrect bias signals, missed transitions, or unexpected analytical behavior.
Users acknowledge that neither Fractalyst nor the creator has control over third-party data providers, exchange volume reporting accuracy, or TradingView platform stability, and cannot guarantee data accuracy, service availability, or analytical performance. Market microstructure changes, volume reporting delays, exchange outages, and technical factors may significantly affect bias detection accuracy compared to theoretical or backtested performance.
Intellectual Property Protection
The VWAP/VOL Extension, including all proprietary algorithms, volume classification methodologies, three-state bias detection systems, and integration protocols, constitutes the exclusive intellectual property of Fractalyst. Unauthorized reproduction, reverse engineering, modification, or commercial exploitation of these proprietary technologies is strictly prohibited and may result in legal action.
Liability Limitation
By utilizing this extension, users acknowledge and agree that they assume full responsibility and liability for all trading decisions, financial outcomes, and potential losses resulting from reliance on the extension's bias detection signals. Fractalyst shall not be liable for any unfavorable outcomes, financial losses, missed opportunities, or damages resulting from the development, use, malfunction, or performance of this extension.
Past performance of bias detection accuracy, volume classification effectiveness, or integration with Quantify Trading Model does not guarantee future results. Trading outcomes depend on numerous factors including market regime changes, volume pattern evolution, institutional behavior shifts, and proper system configuration, all of which are beyond the control of Fractalyst.
User Responsibility Statement
Users are solely responsible for understanding the risks associated with algorithmic bias detection, properly configuring system parameters, maintaining appropriate risk management protocols, and regularly monitoring extension performance. Users should thoroughly validate the extension's bias signals through comprehensive backtesting before live implementation and should never base trading decisions solely on automated bias detection.
This extension is designed to provide systematic institutional flow analysis but does not replace the need for proper market understanding, risk management discipline, and comprehensive trading methodology. Users should maintain active oversight of bias detection accuracy and be prepared to implement manual overrides when market conditions invalidate volume-based analysis assumptions.
Terms of Service Acceptance
Continued use of the VWAP/VOL Extension constitutes acceptance of these terms, acknowledgment of associated risks, and agreement to respect all intellectual property protections. Users assume full responsibility for compliance with applicable laws and regulations governing automated trading system usage in their jurisdiction.
Intraweek Highs & Lows🔎 Track and analyze intraweek price extremes with full flexibility.
The indicator detects weekly highs or lows for any selected weekday and monitors when other days break those levels.
⚙️ Inputs
Select day
Pick which weekday’s extreme you want to monitor.
Find Low/High
Select whether you want to track Lows or Highs.
Use candle Wick/Body
Choose if extremes are calculated by full wick or candle body.
Cutoff date
Toggle the date-based filter and choose the starting date for event display.
MC Geopolitical Tension Events📌 Script Title: Geopolitical Tension Events
📖 Description:
This script highlights key geopolitical and military tension events from 1914 to 2024 that have historically impacted global markets.
It automatically plots vertical dashed lines and labels on the chart at the time of each major event. This allows traders and analysts to visually assess how markets have responded to global crises, wars, and significant political instability over time.
🧠 Use Cases:
Historical backtesting: Understand how market responded to past geopolitical shocks.
Contextual analysis: Add macro context to technical setups.
🗓️ List of Geopolitical Tension Events in the Script
Date Event Title Description
1914-07-28 WWI Begins Outbreak of World War I following the assassination of Archduke Franz Ferdinand.
1929-10-24 Wall Street Crash Black Thursday, the start of the 1929 stock market crash.
1939-09-01 WWII Begins Germany invades Poland, starting World War II.
1941-12-07 Pearl Harbor Japanese attack on Pearl Harbor; U.S. enters WWII.
1945-08-06 Hiroshima Bombing First atomic bomb dropped on Hiroshima by the U.S.
1950-06-25 Korean War Begins North Korea invades South Korea.
1962-10-16 Cuban Missile Crisis 13-day standoff between the U.S. and USSR over missiles in Cuba.
1973-10-06 Yom Kippur War Egypt and Syria launch surprise attack on Israel.
1979-11-04 Iran Hostage Crisis U.S. Embassy in Tehran seized; 52 hostages taken.
1990-08-02 Gulf War Begins Iraq invades Kuwait, triggering U.S. intervention.
2001-09-11 9/11 Attacks Coordinated terrorist attacks on the U.S.
2003-03-20 Iraq War Begins U.S.-led invasion of Iraq to remove Saddam Hussein.
2008-09-15 Lehman Collapse Bankruptcy of Lehman Brothers; peak of global financial crisis.
2014-03-01 Crimea Crisis Russia annexes Crimea from Ukraine.
2020-01-03 Soleimani Strike U.S. drone strike kills Iranian General Qasem Soleimani.
2022-02-24 Ukraine Invasion Russia launches full-scale invasion of Ukraine.
2023-10-07 Hamas-Israel War Hamas launches attack on Israel, sparking war in Gaza.
2024-01-12 Red Sea Crisis Houthis attack ships in Red Sea, prompting Western naval response.
Volume Profile Delta & DOM @MaxMaserati 2.0Volume Profile Delta & DOM @Maxserati 2.0- Real Order Flow Analysis
What this indicator actually does!!!
Most volume indicators just show you total volume - which honestly doesn't tell you much. This one breaks down WHO is driving that volume. Big difference between 1000 shares of balanced buying/selling versus 800 buy + 200 sell. This tool shows you exactly that breakdown at every price level.
Trading without this kind of data means you're basically trading blind. Price action is important, but without knowing if smart money is buying or selling, you're mostly guessing. This gives you the same view that institutional traders have.
The main components
**DOM Display**: Shows real-time order flow with separate columns for buying and selling volume at each price level. You can toggle any column on/off depending on what you actually use.
**Volume Delta**: This is the key part - it shows net buying pressure (buy volume minus sell volume) at each price. When you see heavy buying at a support level, that's usually a good sign. When you see heavy selling at resistance, different story.
**Understanding the key columns:**
- **VPS (Volume Profile Sell)**: Shows selling volume (bid volume) at each price level - how much selling pressure exists
- **VPB (Volume Profile Buy)**: Shows buying volume (ask volume) at each price level - how much buying pressure exists
- **VPD (Volume Profile Delta)**: The difference between VPB and VPS (buy volume minus sell volume) - this tells you who's winning the battle at each price
**Time & Sales**: Live trade data with timestamps. There are filters so you can ignore the small retail trades and focus on the size that actually moves markets.
**Recent Activity**: Tracks momentum by showing cumulative buying/selling above and below current price. Useful for seeing if institutions are accumulating or distributing.
Why volume analysis works
Professional traders don't just look at price. They look at volume because volume precedes price movement. When smart money starts accumulating a position, you'll see it in the volume before you see it in price.
Think about it - if a stock is at $100 and someone wants to buy 100,000 shares, they can't just market buy it all at once without moving the price. They'll spread it out, but you can still see the accumulation pattern if you know where to look.
Real trading applications
**For day trading**: This works well for timing entries. If you see price breaking a level but volume delta is negative, that's usually a fake breakout. If volume confirms the move, much higher probability trade.
**For swing positions**: Great for finding accumulation zones. When you see consistent buying volume at certain levels over multiple days, institutions are likely building positions there.
**Risk management**: Volume shifts often happen before price reversals. If you're long and suddenly see heavy selling volume while price is still going up, that's a good exit signal.
Multi-market setup
Works on stocks, futures, forex, and crypto. The indicator automatically detects what type of market you're trading and adjusts accordingly. For forex it uses tick volume since real volume isn't available. For crypto it handles the decimal precision properly.
Customization options
You can show or hide any column depending on your trading style. If you're just scalping, maybe you only need price and delta. If you're doing deeper analysis, turn on all the columns.
There's color customization since everyone has their preferences, and text sizing because not everyone trades on huge monitors.
The indicator has both real-time and backtesting modes. Real-time for live trading, backtesting for developing strategies with historical volume data.
Learning curve
Fair warning - this isn't a simple moving average. There's a learning curve to reading order flow properly. Start by watching how volume patterns develop around known support and resistance levels.
Pay attention to volume divergences. If price makes a new high but volume delta is weaker, that's often a warning sign. If price breaks down but there's no real selling volume, it might be a false breakdown.
Performance notes
This processes a lot of data in real-time, so disable any columns you don't actually use. The more features you enable, the more processing power it needs.
Works best on lower timeframes (1-15 minutes) where you can see the tick-by-tick order flow. Still useful on higher timeframes but less granular.
## Bottom line
If you're serious about trading and want to see what institutional money is doing instead of just guessing from price action alone, this will help. It's not magic - you still need to understand market structure and have a trading plan. But it gives you information that most retail traders don't have access to.
The goal is to stop trading against smart money and start trading with them. Volume tells you where they're active.
---
*Works on all markets. Real volume for stocks/futures, tick volume for forex. Compatible with TradingView's replay feature for backtesting.*
TradingIQ - OrderFlow IQIntroducing “OrderFlow IQ”
OrderFlow IQ is an all-in-one order-flow and volume-profiling suite crafted to bring true market microstructure to your TradingView charts. It bundles footprints, per-bar and intra-bar delta analytics, class-based delta tracking, adaptive volume profiles, bubble-style trade tapes, live time-and-sales feeds, cumulative-volume fight meters, iceberg detection, and more—all driven by a single, user-friendly interface.
Features
The list below details an ever=expanding list of the indicators capabilities; more to come in the future!
Tick-based Footprints
Imbalance and stacked imbalance detection
Tick-based chronicled volume profile
Delta classification (small order, medium order, and block order delta)
Tick-based order flow bubble tape
Live order feed with total buying volume against total selling volume
Tick-based CVD
Iceberg order detection
Delta class lines
Tick-based bar statistics
Key Components and Their Functions
Data Granularity
• 1-Tick / 1-Second / 1-Minute modes let you choose the resolution of every calculation. On true tick charts you get genuine tick-by-tick precision; on second charts you see every intra-second print; on anything else it falls back to minute bars.
Footprint Engine
Bid vs Ask Volume Columns – Each candle is sliced into tick-level price rows showing buy-volume, sell-volume, total volume, delta and delta%.
CVD-Level Columns – Optionally color each row by net cumulative delta instead of raw volume to spotlight buying or selling pressure trends.
Imbalance Detection – Highlight rows where one side exceeds your % threshold, with “stacked” imbalances calling out multi-row alignment ahead of potential breaks.
Value Area & POC – Automatically compute and draw the 70% value area (VAH/VAL) and mark the Point of Control per session or any chosen timeframe.
Footprint
The image above shows the volume profiling data calculated for each row across the footprint engine.
Delta: Shows the net difference between buying and selling
Delta Percentage: Calculates delta as a percentage of total volume
Total Volume: The total volume at the price block
Buy Volume: The total buying volume at the price block
Sell Volume: The total selling volume at the price block
Additionally, you can select to only show buying volume and selling volume at each price block, as shown in the image above.
POC
The image above shows the visuals used to mark the POC of the footprint. The POC is marked yellow by default; the color can be changed in the settings.
Value Area
The image above shows the visuals used to mark the value area of the footprint.
Imbalance Detection
The image above shows the Footprint Engine detecting and marking buying/selling imbalances.
Stacked Imbalances
The image above shows the Footprint Engine detecting and marking stacked imbalances. Stacked imbalances are shown as consecutive, small blocks to the right of the footprint.
CVD Levels
The image above shows the footprint engine calculating CVD across the footprint, rather than net delta that resets bar by bar. Traders can enable the "Use CVD Levels" setting to have net delta persist across price bars, allowing traders to see the net CVD across various price blocks as the footprint develops.
Delta Class Statistics
With the inclusion of tick volume, The Delta Class Statistics component of the indicator classifies volume delta by order size to give traders detailed insights into whether small players are buying/selling and whether big players are buying/selling.
The image above shows a full view of the Delta Class Statistics feature.
The image above further explains the Delta Class Statistics view.
Orders are distributed (classified) across various order size amounts. From here, a rolling CVD is calculated across each order size. This feature gives traders detailed insights into whether big money is buying/selling (big player sentiment) and whether small money is buying/selling (small player sentiment).
Analysis
The image above shows a net-negative CVD for the session for both small orders (small money) and big orders (big money), while "medium" sized orders are currently at a net-positive CVD.
Consequently, sentiment for big players is bearish.
Additionally, small triangles are printed alongside each Delta Class box for each bar. You can hover over these labels with your cursor to see the net delta for the bar for each order size.
Bar Delta Statistics
With the inclusion of tick data, OrderFlow IQ is designed to generate detailed tick-based bar statistics for each candlestick.
The image above shows the feature in action.
Metrics
Volume: Total volume for the bar
Bar VWAP: The individual bar's VWAP
Delta: Net delta for the bar
Delta %: Delta % of the bar
Max Delta: The maximum positive delta achieved during the bar
Min Delta: The lowest negative delta achieved during the bar
CVD: Cumulative volume delta measurement by the bar
Buy Volume: Total buying volume for the bar
Sell Volume: Total selling volume for the bar
Iceberg Detection (Tick-Data Only)
An Iceberg Order is a type of large trading order that is broken up into much smaller visible portions. Only a small part of the order is displayed in the public order book at any given time, while the rest is hidden (like an iceberg where only the tip is above water).
Why are Iceberg Orders Important?
Minimizing Market Impact
If a trader were to post a 10,000-share sell order openly, the market would immediately react:
Buyers might panic, thinking there's a rush to sell.
Sellers could undercut the price aggressively.
This would likely drive the price down before the large order even finishes executing.
By revealing only a small portion at a time, Iceberg orders help avoid spooking the market and allow the trader to sell closer to the original price.
Hiding Trading Intentions
Markets are highly sensitive to order flow — the balance of buying and selling pressure.
If competitors, market makers, or algorithmic traders see a massive order, they might:
Front-run it (selling before it completes to profit from the expected price drop).
Reassess their own models about supply/demand imbalances.
Iceberg orders protect against this by masking true supply or demand.
Our Iceberg Detection Model
Using a proprietary iceberg order detection algorithm, OrderFlow IQ is capable of detecting/alerting iceberg orders when they occur.
The image above shows the Iceberg Detector in action.
When an iceberg order is identified, the size of the order in the quote currency, price of execution, and number of executions will be displayed.
It's important to set alerts for this feature, as iceberg orders aren't frequent and are easy to miss when away from the chart.
IQ Volume Profile (Chronicled Volume Profile)
OrderFlow IQ generates a Chronicled Volume Profile to give traders detailed insights into net delta by price level, but also historical net delta by price level.
The image above shows the feature in action. While the chronicled volume profile is seemingly a normal volume profile, the narrow-lines across the chronicle profile show historical min/max delta at each price level.
The image above exemplifies the feature.
The wide price blocks show the current net delta at each price area, while the small lines (with a circle at the end) show historical min/max delta at the price level.
This tool allows traders to see if buying/selling always dominated a price level, or if control of the price level changed hands between buyers/sellers throughout development of the profile.
Additionally, traders can hover over the small circles on the profile with their cursor to see the detailed delta statistics at each price area. The statistics will show the minimum delta at the price area, maximum delta, and the live change in delta.
Order Feed
OrderFlow IQ is capable of generating a live order feed with various metrics to assist real time orderflow traders in their analysis.
The image above exemplifies the feature.
Bid/Ask: The bid price and ask price of the current bar
Buys | Price: The size of a buy order and price of execution
Sells | Price: The size of a sell order and price of execution
▴ Vol: Cumulative buying volume (in quote currency) for the feed
▾ Vol: Cumulative selling volume (in quote currency) for the feed
Speed of tape: The average speed between each order fill
OrderFlow Bubble Tape
OrderFlow IQ also displays a traditional orderflow indicator, also known as OrderFlow Bubble Tape.
The image above shows the feature in action.
Orderflow Bubble Tape is a visual tool that shows recent market trades ("tape") as bubbles, where each bubble represents a trade.
The size of each bubble indicates the trade size (volume), and the color shows whether the trade was a buy (aggressive at the ask) or sell (aggressive at the bid).
Instead of showing trades as plain text (like a traditional tape), the bubble format makes it easier to spot bursts of aggressive buying or selling visually.
Clusters of large, fast bubbles in one color suggest momentum or imbalances in order flow, often signaling short-term price pressure.
Traders use Bubble Tape to quickly read supply/demand dynamics, identify hidden buyers/sellers (like iceberg orders), and anticipate short-term price moves.
Blue Bubble = Buy
Red Bubble = Sell
The larger the bubble, the larger the order. Traders can hover over each bubble with their cursor to see the exact size of the order.
Delta Class Lines
OrderFlow IQ shows Live Delta Class Lines grouped by order size buckets:
The blue line shows delta coming only from very large orders (100K–10B in size).
The red line shows delta coming from medium-large orders (50K–100K size).
The green line shows delta from small to medium orders (0–50K size).
Each line is the cumulative net delta for its class — meaning it is adding the buy and sell imbalances only from trades of that size class, live as trades occur.
For example, when a 30K-sized aggressive buy hits, it adds to the green line; if a 70K-sized sell hits, it subtracts from the red line.
The number next to each label is the current net delta value for that class, telling you whether buyers or sellers are dominating at that order size.
• Three Custom Dollar Brackets – Define “small,” “mid,” and “block” trade-size ranges (e.g., 0–50 K, 50 K–100 K, > 100 K).
• Live Streaming Lines – While a bar is forming, watch real-time totals for each bracket plotted as vertical columns or stair-step lines on the chart edge.
CVD
OrderFlow IQ also displays CVD as either candles or a line.
The image above shows the candles visualization for CVD. CVD can be calculated using tick data, 1-second bars, or 1-minute bars. The higher the granularity the more accurate the measurement.
More Features To Come
New features and calculations will be added to OrderFlow IQ based on community feedback, so feel free to share any requests you might have!
Summary
OrderFlow IQ brings a full suite of order-flow analytics into one Pine Script: footprints, delta analytics, dollar-bracket classes, adaptive profiles, bubble tapes, live feeds, CVD meters, and iceberg scans. Its unified Data Granularity switch and Preset System let you toggle entire dashboards with a click—scalpers, intraday traders, and long-term analysts alike can dial in the exact microstructure view they need without switching scripts. Publish once, share your preset layouts, and your TradingView community gains plug-and-play access to professional-grade order-flow tools—no extra installations or feeds required.
TAIndicatorsThis library offers a comprehensive suite of enhanced technical indicator functions, building upon TradingView's built-in indicators. The primary advantage of this library is its expanded flexibility, allowing you to select from a wider range of moving average types for calculations and smoothing across various indicators.
The core difference between these functions and TradingView's standard ones is the ability to specify different moving average types beyond the default. While a standard ta.rsi() is fixed, the rsi() in this library, for example, can be smoothed by an 'SMMA (RMA)', 'WMA', 'VWMA', or others, giving you greater control over your analysis.
█ FEATURES
This library provides enhanced versions of the following popular indicators:
Moving Average (ma): A versatile MA function that includes optional secondary smoothing and Bollinger Bands.
RSI (rsi): Calculate RSI with an optional smoothed signal line using various MA types, plus built-in divergence detection.
MACD (macd): A MACD function where you can define the MA type for both the main calculation and the signal line.
ATR (atr): An ATR function that allows for different smoothing types.
VWAP (vwap): A comprehensive anchored VWAP with multiple configurable bands.
ADX (adx): A standard ADX calculation.
Cumulative Volume Delta (cvd): Provides CVD data based on a lower timeframe.
Bollinger Bands (bb): Create Bollinger Bands with a customizable MA type for the basis line.
Keltner Channels (kc): Keltner Channels with selectable MA types and band styles.
On-Balance Volume (obv): An OBV indicator with an optional smoothed signal line using various MA types.
... and more to come! This library will be actively maintained, with new useful indicator functions added over time.
█ HOW TO USE
To use this library in your scripts, import it using its publishing link. You can then call the functions directly.
For example, to calculate a Weighted Moving Average (WMA) and then smooth it with a Simple Moving Average (SMA) :
import ActiveQuants/TAIndicators/1 as tai
// Calculate a 20-period WMA of the close
// Then, smooth the result with a 10-period SMA
= tai.ma("WMA", close, 20, "SMA", 10)
plot(myWma, color = color.blue)
plot(smoothedWma, color = color.orange)
█ Why Choose This Library?
If you're looking for more control and customization than what's offered by the standard built-in functions, this library is for you. By allowing for a variety of smoothing methods across multiple indicators, it enables a more nuanced and personalized approach to technical analysis. Fine-tune your indicators to better fit your trading style and strategies.