SMU Quantum Thermo BallsThis script is the enhanced version of Market Thermometer with one difference. This one has Quantum Thermo balls shooting out of the thermometer tube when overheated. Quantum psychology, Quantum observation, call it what you like
My scripts are designed to beat ALGO, so the behavior of indicators is not like traditional indicators. Don't try to overthink it and compare it to other established functions.
If you knew ALGo as much as I do, then you would also ditch old indicators and design your own weird scripts to match the ALGO's personality. Oh yes, each AlGo for each stock has its own programming personality. Most my scripts are tuned to beat SPX ALGO meniac
Enjoy and think outside the box, the only way to beat the ALGO
在脚本中搜索"algo"
BERLIN Renegade - Baseline & RangeThis is the baseline and range candles part of a larger algorithm called the "BERLIN Renegade". It is based on the NNFX way of trading, with some modifications.
The baseline is used for price crossover signals, and consists of the LSMA. When price is below the baseline, the background turns red, and when it is above the baseline, the background turns green.
It also includes a modified version of the Range Identifier by LazyBear. This version calculates the same, but draws differently. It remove the baseline signal color if the Range Identifier signals there is a possible trading range forming.
The main way of identifying ranges is using the BERLIN Range Index. A panel version of this indicator is included in another part of the algorithm, but the bar color version is included here, to make the ranges even more visible and easier to avoid.
Low Frequency Fourier TransformThis Study uses the Real Discrete Fourier Transform algorithm to generate 3 sinusoids possibly indicative of future price.
I got information about this RDFT algorithm from "The Scientist and Engineer's Guide to Digital Signal Processing" By Steven W. Smith, Ph.D.
It has not been tested thoroughly yet, but it seems that that the RDFT isn't suited for predicting prices as the Frequency Domain Representation shows that the signal is similar to white noise, showing no significant peaks, indicative of very low periodicity of price movements.
Correlation MATRIX (Flexible version)Hey folks
A quick unrelated but interesting foreword
Hope you're all good and well and tanned
Me? I'm preparing the opening of my website where we're going to offer the Algorithm Builder Single Trend, Multiple Trends, Multi-Timeframe and plenty of others across many platforms (TradingView, FXCM, MT4, PRT). While others are at the beach and tanning (Yes I'm jealous, so what !?!), we're working our a** off to deliver an amazing looking website and great indicators and strategies for you guys.
Today I worked in including the Trade Manager Pro version and the Risk/Reward Pro version into all our Algorithm Builders. Here's a teaser
We're going to have a few indicators/strategies packages and subscriptions will open very soon.
The website should open in a few weeks and we still have loads to do ... (#no #summer #holidays #for #dave)
I see every message asking me to allow access to my Algorithm Builders but with the website opening shortly, it will be better for me to manage the trials from there - otherwise, it's duplicated and I can't follow all those requests
As you can probably all understand, it becomes very challenging to publish once a day with all that workload so I'll probably slow down (just a bit) and maybe posting once every 2/3 days until the website will be over (please forgive me for failing you). But once it will open, the daily publishing will resume again :) (here's when you're supposed to be clapping guys....)
While I'm so honored by all the likes, private messages and comments encouraging me, you have to realize that a script always takes me about 2/3 hours of work (with research, coding, debugging) but I'm doing it because I like it. Only pushing the brake a bit because of other constraints
INDICATOR OF THE DAY
I made a more flexible version of my Correlation Matrix .
You can now select the symbols you want and the matrix will update automatically !!! Let me repeat it once more because this is very cool... You can now select the symbols you want and the matrix will update automatically :)
Actually, I have nothing more to say about it... that's all :) Ah yes, I added a condition to detect negative correlation and they're being flagged with a black dot
Definition : Negative correlation or inverse correlation is a relationship between two variables whereby they move in opposite directions.
A negative correlation is a key concept in portfolio construction, as it enables the creation of diversified portfolios that can better withstand portfolio volatility and smooth out returns.
Correlation between two variables can vary widely over time. Stocks and bonds generally have a negative correlation, but in the decade to 2018, their correlation has ranged from -0.8 to 0.2. (Source : www.investopedia.com
See you maybe tomorrow or in a few days for another script/idea.
Be sure to hit the thumbs up to cheer me up as your likes will be the only sunlight I'll get for the next weeks.... because working on building a great offer for you guys.
Dave
____________________________________________________________
- I'm an officially approved PineEditor/LUA/MT4 approved mentor on codementor. You can request a coaching with me if you want and I'll teach you how to build kick-ass indicators and strategies
Jump on a 1 to 1 coaching with me
- You can also hire for a custom dev of your indicator/strategy/bot/chrome extension/python
SMA/pivot/Bollinger/MACD/RSI en pantalla gráficoMulti-indicador con los indicadores que empleo más pero sin añadir ventanas abajo.
Contiene:
Cruce de 3 medias móviles
La idea es no tenerlas en pantalla, pero están dibujadas también. Yo las dejo ocultas salvo que las quiera mirar para algo.
Lo que presento en pantalla es la media lenta con verde si el cruce de las 3 marca alcista, amarillo si no está claro y rojo si marca bajista.
Pivot
Normalmente los tengo ocultos pero los muestro cuando me interesa. Están todos aunque aparezcan 2 seguidos.
Bandas de Bollinger
No dibujo la línea central porque empleo la media como tal.
Parabollic SAR
Lo empleo para dibujar las ondas de Elliott como postula Matías Menéndez Larre en el capítulo 11 de su libro "Las ondas de Elliott". Así que, aunque se puede mostrar, lo mantengo oculto y lo que muestro es dónde cambia (SAR cambio).
MACD
No está dibujado porque necesitaría sacarlo del gráfico.
Marco en la parte superior cuándo la señal sobrepasa al MACD hacia arriba o hacia abajo con un flecha indicando el sentido de esta señal.
RSI
Similar al MACD pero en la parte inferior.
Probablemente, programe otro indicador para visualizar en una ventanita MACD, RSI y volumen todo junto. El volumen en la principal hay veces que no te permite ver bien alguna sombra y los otros 2 te quitan mucho espacio para graficar si los tienes permanentemente en 2 ventanas separadas.
DFT - Dominant Cycle Period 8-50 bars - John EhlerThis is the translation of discret cosine tranform (DCT) usage by John Ehler for finding dominant cycle period (DC).
The price is first filtered to remove aliasing noise(bellow 8 bars) and trend informations(above 50 bars), then the power is computed.
The trick here is to use a normalisation against the maximum power in order to get a good frequency resolution.
Current limitation in tradingview does not allow to display all of the periods, still the DC period is plot after beeing computed based on the center of gravity algo.
The DC period can be used to tune all of the indicators based on the cycles of the markets. For instance one can use this (DC period)/2 as an input for RSI.
Hope you find this of some interrest.
[naoligo] Simple ADXI'm publishing this indicator just for study purposes, because the result is exactly the same as DMI without the smoothing factor. It is exactly the same as ADX Wilder from MT5.
I was looking for the algorithm all over and it was a pain to find the right formula, meaning: one that would match with the built-in ones. After several study and comparison, I still didn't find the algorithm that match with the MT5's built-in simple ADX ...
Enjoy!
Patrones de entrada/salida V.1.0 -BETA-Este algoritmo intenta identificar patrones o fractales dentro de los movimientos de precios para dar señales de compra o venta de activos.
Zero Lag MACD Enhanced - Version 1.1ENHANCED ZERO LAG MACD
Version 1.1
Based on ZeroLag EMA - see Technical Analysis of Stocks and Commodities, April 2000
Original version by user Glaz. Thanks !
Ideas and code from @yassotreyo version.
Tweaked by Albert Callisto (AC)
New features:
Added original signal line formula
Added optional EMA on MACD
Added filling between the MACD and signal line
I looked at other versions of the zero lag and noticed that the histogram was slightly different. After looking at other zero lags on TV, I noticed that the algorithm implementation of Glanz generated a modified signal line. I decided to add the old version to be compliant with the original algorithm that you will find in other platforms like MT4, FXCM, etc.
So now you can choose if you want the original algorithm or Glanz version. It's up to you then to choose which one you prefer. I also added an extra EMA applied on the MACD. This is used in a system I am currently studying and can be of some interest to filter out false signals.
Acc/Dist. Cloud with Fractal Deviation Bands by @XeL_ArjonaACCUMULATION / DISTRIBUTION CLOUD with MORPHIC DEVIATION BANDS
Ver. 2.0.beta.23:08:2015
by Ricardo M. Arjona @XeL_Arjona
DISCLAIMER
The Following indicator/code IS NOT intended to be a formal investment advice or recommendation by the author, nor should be construed as such. Users will be fully responsible by their use regarding their own trading vehicles/assets.
The embedded code and ideas within this work are FREELY AND PUBLICLY available on the Web for NON LUCRATIVE ACTIVITIES and must remain as is.
Pine Script code MOD's and adaptations by @XeL_Arjona with special mention in regard of:
Buy (Bull) and Sell (Bear) "Power Balance Algorithm by Vadim Gimelfarb published at Stocks & Commodities V. 21:10 (68-72).
Custom Weighting Coefficient for Exponential Moving Average (nEMA) adaptation work by @XeL_Arjona with contribution help from @RicardoSantos at TradingView @pinescript chat room.
Morphic Numbers (PHI & Plastic) Pine Script adaptation from it's algebraic generation formulas by @XeL_Arjona
Fractal Deviation Bands idea by @XeL_Arjona
CHANGE LOG:
ACCUMULATION / DISTRIBUTION CLOUD: I decided to change it's name from the Buy to Sell Pressure. The code is essentially the same as older versions and they are the center core (VORTEX?) of all derived New stuff which are:
MORPHIC NUMBERS: The "Golden Ratio" expressed by the result of the constant "PHI" and the newer and same in characteristics "Plastic Number" expressed as "PN". For more information about this regard take a look at: HERE!
CUSTOM(K) EXPONENTIAL MOVING AVERAGE: Some code has cleaned from last version to include as custom function the nEMA , which use an additional input (K) to customise the way the "exponentially" is weighted from the custom array. For the purpose of this indicator, I implement a volatility algorithm using the Average True Range of last 9 periods multiplied by the morphic number used in the fractal study. (Golden Ratio as default) The result is very similar in response to classic EMA but tend to accelerate or decelerate much more responsive with wider bars presented in trending average.
FRACTAL DEVIATION BANDS: The main idea is based on the so useful Standard Deviation process to create Bands in favor of a multiplier (As John Bollinger used in it's own bands) from a custom array, in which for this case is the "Volume Pressure Moving Average" as the main Vortex for the "Fractallitly", so then apply as many "Child bands" using the older one as the new calculation array using the same morphic constant as multiplier (Like Fibonacci but with other approach rather than %ratios). Results are AWSOME! Market tend to accelerate or decelerate their Trend in favor of a Fractal approach. This bands try to catch them, so please experiment and feedback me your own observations.
EXTERNAL TICKER FOR VOLUME DATA: I Added a way to input volume data for this kind of study from external tickers. This is just a quicky-hack given that currently TradingView is not adding Volume to their Indexes so; maybe this is temporary by now. It seems that this part of the code is conflicting with intraday timeframes, so You are advised.
This CODE is versioned as BETA FOR TESTING PROPOSES. By now TradingView Admins are changing lot's of things internally, so maybe this could conflict with correct rendering of this study with special tickers or timeframes. I will try to code by itself just the core parts of this study in order to use them at discretion in other areas. ALL NEW IDEAS OR MODIFICATIONS to these indicator(s) are Welcome in favor to deploy a better and more accurate readings. I will be very glad to be notified at Twitter or TradingView accounts at: @XeL_Arjona
neeson vegas proIndicator Name: neeson vegas pro
Overview:
neeson vegas pro is an advanced multi-timeframe trend analysis tool that provides clear trend direction and entry signals through a unique moving average system combined with volume analysis.
Core Mechanism:
Trend Detection System: Uses 140/165 period EMAs as fast lines and 580/670 period EMAs as slow lines. Trend is confirmed when the fast line group completely breaks through the slow line group.
Volume Confirmation: Detects abnormal volume activity, triggering visual alerts when volume exceeds 3.5 standard deviations of the 55-period average, with differentiation between bullish and bearish volume strength.
Signal Filtering: Combines 14-period EMA and SMA as short-term filters, with VWAP as dynamic support/resistance reference.
Technical Implementation:
Employs state tracking algorithm to avoid frequent signal switching near trend boundaries
Uses dynamic percentage calculation to display volume anomaly degree
Implements multi-layer confirmation mechanism to reduce false signals
Provides comprehensive visual feedback system
Usage Instructions:
Trend Identification: Blue bars indicate bullish trend, orange bars indicate bearish trend
Entry Signals: BUY/SELL labels show major moving average crossover points
Volume Confirmation: Blue boxes indicate bullish volume anomalies, orange boxes indicate bearish volume anomalies
Parameter Adjustment: All period parameters can be adjusted based on trading instrument and timeframe
Unique Value:
Compared to traditional Vegas tunnel indicators, neeson vegas pro introduces volume confirmation mechanism, multi-timeframe filters, and intelligent trend state tracking, significantly improving signal accuracy and reliability.
VWAP Kalman FilterOverview
This indicator applies Kalman filtering techniques to Volume Weighted Average Price (VWAP) calculations, providing a statistically optimized approach to VWAP analysis. The Kalman filter reduces noise while maintaining responsiveness to genuine price movements, addressing common VWAP limitations in volatile or low-volume conditions.
Technical Implementation
Kalman Filter Mathematics
The indicator implements a state-space model for VWAP estimation:
- Prediction Step: x̂(k|k-1) = x̂(k-1|k-1) + v(k-1)
- Update Step: x̂(k|k) = x̂(k|k-1) + K(k)
- Kalman Gain: K(k) = P(k|k-1) / (P(k|k-1) + R)
Where:
- x̂ = estimated VWAP state
- K = Kalman gain (adaptive weighting factor)
- P = error covariance
- R = measurement noise
- Q = process noise
- v = optional velocity component
Core Components
Dual VWAP System
- Standard VWAP: Traditional volume-weighted calculation
- Kalman-filtered VWAP: Noise-reduced estimation with optional velocity tracking
- Real-time divergence measurement between filtered and unfiltered values
Adaptive Filtering
- Process Noise (Q): Controls adaptation to price changes (0.001-1.0)
- Measurement Noise (R): Determines smoothing intensity (0.01-5.0)
- Optional velocity tracking for momentum-based filtering
Multi-Timeframe Anchoring
- Session, Weekly, Monthly, Quarterly, and Yearly anchor periods
- Automatic Kalman state reset on anchor changes
- Maintains VWAP integrity across timeframes
Features
Visual Components
- Dual VWAP Lines: Compare filtered vs. unfiltered in real-time
- Dynamic Bands: Three-level deviation bands (1σ, 2σ, 3σ)
- Trend Coloring: Automatic color adaptation based on price position
- Cloud Visualization: Highlights divergence between standard and Kalman VWAP
- Signal Markers: Crossover and band-touch indicators
Trading Signals
- VWAP crossover detection with Kalman filtering
- Band touch alerts at multiple standard deviation levels
- Velocity-based momentum confirmation (optional)
- Divergence warnings when filtered/unfiltered values separate
Information Display
- Real-time VWAP values (both standard and filtered)
- Trend direction indicator
- Velocity/momentum reading (when enabled)
- Divergence percentage calculation
- Anchor period display
Input Parameters
VWAP Settings
- Anchor Period: Choose calculation reset period
- Band Multipliers: Customize deviation band distances
- Display Options: Toggle standard VWAP and bands
Kalman Parameters
- Length: Base period for calculations (5-200)
- Process Noise (Q: Higher values increase responsiveness
- Measurement Noise (R): Higher values increase smoothing
- Velocity Tracking: Enable momentum-based filtering
Visual Controls
- Toggle filtered/unfiltered VWAP display
- Band visibility options
- Signal markers on/off
- Cloud fill between VWAPs
- Bar coloring by trend
Use Cases
Noise Reduction
Particularly effective during:
- Low volume periods (pre-market, lunch hours)
- Volatile market conditions
- Fast-moving markets where standard VWAP whipsaws
Trend Identification
- Cleaner trend signals with reduced false crosses
- Earlier trend detection through velocity component
- Confirmation through divergence analysis
Support/Resistance
- Filtered VWAP provides more stable S/R levels
- Bands adapt to filtered values for better zone identification
- Reduced false breakout signals
Technical Advantages
1. Optimal Estimation: Mathematically optimal under Gaussian noise assumptions
2. Adaptive Response: Self-adjusting to market conditions
3. Predictive Element: Velocity component provides forward-looking insight
4. Noise Immunity: Superior noise rejection vs. simple moving average smoothing
Limitations
- Assumes linear price dynamics
- Requires parameter optimization for different instruments
- May lag during sudden volatility regime changes
- Not suitable as standalone trading system
Mathematical Background
Based on control systems theory, the Kalman filter provides recursive Bayesian estimation originally developed for aerospace applications. This implementation adapts the algorithm specifically for financial time series, maintaining VWAP's volume-weighted properties while adding statistical filtering.
Comparison with Standard VWAP
Standard VWAP Issues Addressed:
- Choppy behavior in low volume
- Whipsaws around VWAP line
- Lag in trend identification
- Noise in deviation bands
Kalman VWAP Benefits:
- Smooth yet responsive line
- Fewer false signals
- Optional momentum tracking
- Statistically optimized filtering
Alert Conditions
The indicator includes several pre-configured alert conditions:
- Bullish/Bearish VWAP crosses
- Upper/Lower band touches
- High divergence warnings
- Velocity shifts (if enabled)
---
This open-source indicator is provided as-is for educational and trading purposes. No guarantees are made regarding trading performance. Users should conduct their own testing and validation before using in live trading.
Quantura - Session High/LowIntroduction
“Quantura – Session High/Low” is a professional-grade session mapping indicator that automatically identifies and visualizes the highs, lows, and ranges of key global trading sessions — London, New York, and Asia. It helps traders understand when and where liquidity tends to accumulate, allowing for better market structure analysis and session-based strategy alignment.
Originality & Value
This indicator unifies the three most influential global sessions into a single, adaptive visualization tool. Unlike typical session indicators, it dynamically updates live session highs and lows in real time while marking session boundaries and transitions. Its multi-session management system allows for immediate recognition of overlapping liquidity zones — a crucial feature for institutional and intraday traders.
The value and originality come from:
Real-time tracking of session highs, lows, and developing ranges.
Simultaneous visualization of multiple global sessions.
Optional vertical range lines for clearer visual segmentation.
Customizable session times, colors, and time zone offset for global accuracy.
Automatically extending and updating lines as each session progresses.
Functionality & Core Logic
Detects the start and end of each trading session (London, New York, Asia) using built-in time logic and user-defined UTC offsets.
Initializes session-specific high and low variables at the start of each new session.
Continuously updates session high/low levels as new candles form.
Draws color-coded horizontal lines for each session’s high and low.
Optionally adds vertical dotted lines to visually connect session range extremes.
Locks each session’s range once it ends, preserving historical structure for review.
Parameters & Customization
New York Session: Enable/disable, customize time (default 15:30–21:30), and set color.
London Session: Enable/disable, customize time (default 09:00–16:30), and set color.
Asia Session: Enable/disable, customize time (default 02:30–08:00), and set color.
Vertical Line: Toggle dotted vertical lines connecting session high and low levels.
UTC Offset: Adjust session timing to align with your chart’s local time zone.
Visualization & Display
Each session is color-coded for quick identification (default: blue for London, red for New York, green for Asia).
Horizontal lines track evolving session highs and lows in real time.
Once a session closes, the lines remain fixed to mark historical range boundaries.
Vertical dotted lines (optional) visually connect the session’s high and low for clarity.
Supports full overlay display without interfering with other technical indicators.
Use Cases
Identify liquidity zones and range extremes formed during active trading sessions.
Observe session overlaps (London–New York) to anticipate volatility spikes.
Combine with volume or market structure tools for session-based confluence.
Track how price interacts with prior session highs/lows to detect potential reversals.
Analyze session-specific performance patterns for algorithmic or discretionary systems.
Limitations & Recommendations
The indicator is designed for intraday analysis and may not provide meaningful output on daily or higher timeframes.
Adjust session times and UTC offset based on your broker’s or exchange’s timezone.
Does not provide trading signals — it visualizes session structure only.
Combine with liquidity and volatility indicators for full contextual understanding.
Markets & Timeframes
Compatible with all asset classes — including crypto, forex, indices, and commodities — and optimized for intraday timeframes (1m–4h). Particularly useful for traders analyzing session overlaps and volatility transitions.
Author & Access
Developed 100% by Quantura. Published as a Open-source script indicator. Access is free.
Compliance Note
This description fully complies with TradingView’s Script Publishing Rules and House Rules . It provides a detailed explanation of functionality, parameters, and realistic use cases without making any performance or predictive claims.
Quantura - Liquidity Sweep & Run LevelsIntroduction
“Quantura – Liquidity Sweep & Run Levels” is a structural price-action indicator designed to automatically detect swing-based liquidity zones and visualize potential sweep and run events. It helps traders identify areas where liquidity has likely been taken (sweep) or released (run), improving precision in market structure analysis and timing of entries or exits.
Originality & Value
This tool translates institutional liquidity concepts into an automated visual framework. Instead of simply marking highs and lows, it dynamically monitors swing points, tracks their breaches, and identifies subsequent reactions. The indicator is built to highlight the liquidity dynamics that often precede reversals or continuations.
Its originality lies in:
Automatic identification and tracking of swing highs and lows.
Real-time detection of broken levels and liquidity sweeps.
Distinction between “Run” and “Sweep” modes for different market behaviors.
Persistent historical visualization of liquidity levels using clean line structures.
Configurable signal markers for bullish and bearish sweep confirmations.
Functionality & Core Logic
Detects swing highs and lows using a user-defined Swing Length parameter.
Stores and updates all swing levels dynamically with arrays for efficient memory handling.
Draws horizontal lines from each detected swing point to visualize potential liquidity zones.
Monitors when price breaks a swing level and marks that event as “broken.”
Generates signals when the market either sweeps above/below or runs away from those levels, depending on the chosen mode.
Provides optional visual signal markers (“▲” for bullish sweeps, “▼” for bearish sweeps).
Parameters & Customization
Mode: Choose between “Sweep” (detects liquidity grabs) or “Run” (detects breakout continuations).
Swing Length: Sets the sensitivity for detecting swing highs/lows. A higher value focuses on larger structures, while smaller values detect micro liquidity points.
Bullish Color / Bearish Color: Customize color themes for sweep/run lines and signal markers.
Signals: Enables or disables visual up/down markers for confirmed events.
Visualization & Display
Horizontal lines represent potential liquidity levels (unbroken swing highs/lows).
Once broken, lines automatically stop extending, marking the moment liquidity is taken.
Depending on the selected mode:
“Sweep” mode identifies false breaks or stop-hunt behavior.
“Run” mode highlights breakouts that continue the trend.
Colored arrows indicate the direction and type of liquidity reaction.
Clean, non-intrusive visualization suitable for overlaying on price charts.
Use Cases
Detect liquidity sweeps before major reversals.
Identify breakout continuations after liquidity runs.
Combine with Supply/Demand or FVG indicators for multi-layered confirmation.
Validate liquidity bias in algorithmic or discretionary strategies.
Analyze market manipulation patterns and institutional stop-hunting behavior.
Limitations & Recommendations
This indicator identifies structural behavior but does not guarantee trade direction or profitability.
Works best on liquid markets with clear swing structures (e.g., crypto, forex, indices).
Signal interpretation should be combined with confluence tools such as volume, order flow, or structure-based filters.
Excessively small swing settings may cause over-signaling in volatile markets.
Markets & Timeframes
Optimized for all major asset classes — including crypto, Forex, indices, and equities — and for intraday to higher-timeframe structural analysis (5-minute up to daily charts).
Author & Access
Developed 100% by Quantura. Published as a Open-source script indicator. Access is free.
Compliance Note
This description fully complies with TradingView’s Script Publishing Rules and House Rules . It avoids performance claims, provides transparency on methodology, and clearly describes indicator behavior and limitations.
Quantura - Fair Value GapIntroduction
“Quantura – Fair Value Gap” is a precision-engineered institutional concept indicator designed to automatically identify, visualize, and manage Fair Value Gaps (FVGs) across any market or timeframe. It enables traders to observe price inefficiencies, potential liquidity voids, and retracement areas that often act as magnets for price rebalancing.
Originality & Value
Unlike many public FVG scripts that only highlight candle gaps, this indicator integrates dynamic filters and adaptive logic to determine the strength and reliability of each gap. It merges overlapping zones intelligently and optionally extends valid imbalances forward for ongoing reference.
Its value lies in:
Dynamic statistical filtering based on gap standard deviation.
Optional volume confirmation for high-confidence FVGs.
Automatic merging of overlapping or adjacent gaps for clean visualization.
Support for both bullish and bearish imbalances.
Signal alerts when gaps are filled or rebalanced by price.
Functionality & Core Logic
Detects Fair Value Gaps by comparing candle-to-candle price displacement.
Applies a Gap Filter (standard deviation-based) to qualify valid gaps.
Optionally validates gaps formed under significant volume conditions.
Draws color-coded boxes to mark bullish (discount) and bearish (premium) inefficiencies.
Monitors each FVG until price fills the gap, at which point the box is visually closed.
Provides optional signal markers (“▲” or “▼”) when rebalancing occurs.
Parameters & Customization
Gap Filter: Sets the minimum statistical deviation required for a valid FVG. Higher values detect fewer, stronger gaps.
Volume Filter: Toggles additional validation using relative volume strength.
Volume Sensitivity: Adjusts how much above-average volume must be present to confirm a gap.
Bullish/Bearish Colors: Customize color schemes for imbalance zones.
Extend Gaps: Optionally extend open gaps forward for better confluence tracking.
Signals: Enables or disables gap-fill signal markers.
Visualization & Display
Bullish FVGs: Appear in blue-tinted boxes, indicating potential demand-side inefficiencies.
Bearish FVGs: Appear in red-tinted boxes, representing potential supply-side inefficiencies.
Overlapping zones are merged automatically to maintain clarity.
Filled gaps remain visible for historical context, allowing for post-event analysis.
Optional signal arrows display when price returns to rebalance an FVG.
Use Cases
Identify institutional inefficiencies and liquidity voids.
Detect premium and discount levels in trending markets.
Combine with market structure or order block indicators for confluence.
Track when price rebalances inefficiencies to refine entry/exit points.
Build FVG-based algorithmic strategies that rely on structural imbalance resolution.
Limitations & Recommendations
The indicator detects structural imbalances but does not predict future direction or guarantee profitability.
Volume filters may behave differently across brokers due to data-source differences.
Use alongside structure or liquidity tools for enhanced decision-making.
Extreme volatility or illiquid assets may generate temporary invalid gaps.
Markets & Timeframes
Compatible with all markets (crypto, forex, equities, indices, futures) and all timeframes. Recommended for multi-timeframe confluence analysis — e.g., detecting higher-timeframe FVGs and refining lower-timeframe entries.
Author & Access
Developed 100% by Quantura. Published as a Open-source script indicator. Access is free.
Compliance Note
This description adheres fully to TradingView’s House Rules and Script Publishing Requirements . It provides a detailed explanation of originality, core logic, limitations, and appropriate use — with no unrealistic or misleading performance claims.
Quantura - Average Intraday Candle VolumeIntroduction
“Quantura – Average Intraday Candle Volume” is a quantitative visualization tool that calculates and displays the average traded volume for each intraday time position based on a user-defined historical lookback period. It allows traders to analyze recurring intraday volume patterns, identify high-activity sessions, and detect liquidity shifts throughout the trading day.
Originality & Value
This indicator goes beyond standard volume averages by normalizing and aligning volume data according to the time of day. Instead of simply smoothing recent bars, it builds an intraday volume profile based on historical daily averages, enabling users to understand when during the day volume typically peaks or drops.
Its originality and usefulness come from:
Converting standard volume data into time-aligned intraday averages.
Visualization of historical intraday liquidity behavior, not just total daily volume.
Dynamic scaling using normalization and transparency to emphasize active and quiet periods.
Optional day-separator lines for precise intraday structure recognition.
Gradient-based coloring for better visual interpretation of volume intensity.
Functionality & Core Logic
The indicator divides each day into discrete intraday time positions (based on chart timeframe).
For each position, it stores and updates historical volume values across the selected number of days.
It calculates an average volume per time position by aggregating all stored values and dividing them by the number of valid days.
The result is plotted as a continuous histogram showing typical intraday volume distribution.
The bar colors and transparency dynamically reflect the relative intensity of volume at each point in the day.
Parameters & Customization
Number of Days for Averaging: Defines how many past days are included in the volume average calculation (default: 365).
UTC Offset: Allows synchronization of intraday cycles with local or exchange time zones.
Base Color: Sets the main color for plotted volume columns.
Color Mode: Choose between “Gradient” (transparency dynamically adjusts by intensity) or “Normal” (fixed opacity).
Day Line: Toggles dashed vertical lines marking the start of each trading day.
Visualization & Display
Volume is plotted as a series of histogram bars, each representing the average volume for a specific intraday time position.
A gradient color mode enhances readability by fading lower-intensity areas and highlighting high-volume regions.
Optional day-separator lines visually segment historical sessions for easy reference.
Works seamlessly across all chart timeframes that divide the 24-hour day into regular bar intervals.
Use Cases
Identify when trading activity typically peaks (e.g., session opens, news windows, or overlapping markets).
Compare current intraday volume to historical averages for early anomaly detection.
Enhance algorithmic or discretionary strategies that depend on volume-timing alignment.
Combine with volatility or price structure indicators to confirm market activity zones.
Evaluate session consistency across different time zones using the UTC offset parameter.
Limitations & Recommendations
The indicator requires intraday data (below 1D resolution) to function properly.
Volume behavior may vary across brokers and assets; adjust averaging period accordingly.
Does not predict price movement — it provides volume-based context for analysis.
Works best when combined with structure or momentum-based indicators.
Markets & Timeframes
Compatible with all intraday markets — including crypto, Forex, equities, and futures — and all intraday timeframes (from 1 minute to 4 hours). It is particularly valuable for analyzing assets with continuous 24-hour trading activity.
Author & Access
Developed 100% by Quantura. Published as a Open-source script indicator. Access is free.
Important
This description complies with TradingView’s Script Publishing and House Rules. It provides a clear explanation of the indicator’s originality, logic, and purpose, without any unrealistic performance or predictive claims.
AG Pro Crypto Screener & Signal Dashboard🚀 OVERVIEW
Welcome to the AG Pro Crypto Screener & Signal Dashboard, an institutional-grade scanner designed to find high-probability buy opportunities in the chaotic crypto market. This powerful tool is being offered completely free as an introduction to the precision and performance of the exclusive AG Pro series.
Tired of manually flipping through dozens of charts? This dashboard is your new command center. It simultaneously scans up to 40 crypto assets against a robust, multi-filter strategy. It filters out the noise and delivers a clean, actionable list of symbols that are showing combined signs of strength, momentum, and a confirmed uptrend.
🧠 THE CORE STRATEGY: A Multi-Filter Confluence
This screener doesn't rely on a single, weak indicator. A symbol only appears on the "Buy List" if it passes a strict, user-configurable set of confluence filters:
Bullish EMA Crossover: Confirms a new, bullish shift in short-term momentum by looking for a recent crossover of a Fast EMA over a Slow EMA (e.g., 20/50). The "Freshness" feature ensures the signal is recent.
RSI Momentum Filter: Ensures the asset has strong buying momentum. The signal is only valid if the RSI is above a specified level (e.g., > 50).
Long-Term Trend Filter: This is the most critical filter. It keeps you on the right side of the market by confirming the price is above a key long-term Moving Average (e.g., SMA 50, 100, 200). You trade with the trend, not against it.
MACD Crossover (Optional): For traders who want an extra layer of confirmation, you can enable a filter to check for a bullish MACD crossover.
Only when all selected conditions are met does the asset appear on your dashboard. This multi-layered approach is designed to find quality over quantity.
✨ KEY FEATURES
Dynamic 40-Symbol Scanner: Monitor your entire watchlist (up to 40 symbols) from a single chart.
Professional Signal Dashboard: A clean, sortable table displaying all active signals, last price, RSI value, and volume.
"Freshness" & "Trend" Icons: Instantly gauge signal quality.
Freshness: See how many bars ago the signal appeared (🔥 Hot / ❇️ Fresh / ⏳ Old).
Trend: A clear visual icon shows if the asset is in a long-term uptrend (🔼) or downtrend (🔽).
NEW Signal Alerts: Don't miss an opportunity. Set an alert to be notified only when a new symbol appears on the list. This non-intrusive system avoids constant, repetitive alerts.
Fully Customizable Strategy: You are in control.
Toggle any of the four main filters (EMA, RSI, Trend, MACD) on or off.
Adjust all indicator lengths (EMAs, RSI, MACD, and Trend MA) to fit your trading style.
Reliable "On-Close" Signaling: Includes an option to generate signals only on bar close, ensuring high-quality, non-repainting signals.
Clean UI: Adjustable table text size ("Tiny", "Small", "Normal", "Large") for perfect visibility on any setup.
💎 THE AG PRO DIFFERENCE
This free screener is just the beginning. It's a demonstration of the stable, high-performance, and results-driven philosophy that defines the AG Pro brand.
We believe in empowering traders with tools that provide a clear, statistical edge. While this screener is powerful, our private, premium AG Pro scripts (such as the AG Pro Trading Suite) offer a complete, institutional-grade solution for serious traders. These advanced tools feature predictive models, proprietary signal algorithms, and comprehensive risk management modules that are the result of years of professional development.
If you find value in this free tool, imagine what our full suite can do for your trading. We invite you to experience the next level of trading precision.
🛠️ HOW TO USE
Add the "🏆 AG Pro Crypto Screener & Signal Dashboard V3" to your chart.
Open the indicator's Settings.
Under the "Symbol List to Scan" tab, replace the default symbols with your own 40 preferred assets (e.g., "BINANCE:BTCUSDT", "BINANCE:ETHUSDT", "COINBASE:SOLUSD").
Under the "Filter Settings" tab, configure your desired strategy. You can start with the defaults or customize them.
(Recommended) Right-click the table and select "Create Alert". Choose the "NEW BUY" condition and "Once Per Bar Close" to be notified of new signals.
⚠️ DISCLAIMER
This script is provided for informational and educational purposes only. It does not constitute financial or investment advice. All trading involves significant risk, and past performance is not indicative of future results. Please conduct your own research and implement your own risk management strategy before making any trading decisions.
LevelsLevels is a powerful technical analysis tool that automatically identifies and displays key support and resistance levels on the chart. The indicator analyzes historical price data, detecting significant price levels where multiple reversals or price stops have occurred.
How the Indicator Works?
1. Identification of Reversal Points:
- The indicator tracks price extremes using an algorithm to identify local highs and lows
- A reversal point is recorded when:
- Uptrend: price reaches a new low for the last 10 bars
- Downtrend: price reaches a new high for the last 10 bars
2. Level Grouping:
- All found reversal points are analyzed and grouped into key levels
- Levels are combined if they fall within the specified percentage tolerance
3. Filtering Significant Levels:
- Only levels that have been tested the minimum number of times (set in settings) are preserved
- This ensures only statistically significant levels are displayed
How to Use the Indicator?
Trading Scenarios:
1. Bounce from Level:
- When price approaches an identified level, a bounce can be expected
- Opening positions on the bounce with protective stop-loss beyond the level
2. Level Breakout:
- Breaking through a key level may signal trend continuation
- Support level becomes resistance and vice versa
3. Consolidation near Level:
- Prolonged price presence near a level indicates its significance
- Strong movement can be expected after exiting consolidation
Advantages:
- Automatic level identification eliminates subjectivity
- Sensitivity customization for different timeframes and instruments
- Visual simplicity - only significant levels
Indicator Settings
Main Parameters:
- Show Key Levels - enable/disable level display
- Level Tolerance (%) - percentage tolerance for level grouping
- Smaller values: more levels, more precise
- Larger values: fewer levels, more significant
- Minimum Touches - minimum number of touches to form a level
Visual Settings:
- Level Color - level display color
- Level Style - line style (solid, dashed, dotted)
Limitations
- Levels are built only on available historical data
- Does not account for trading volumes
- Parameter adjustment may be required during high volatility periods
The indicator is particularly effective when combined with other analysis tools for signal confirmation.
MACD Overlay v1 [JopAlgo]Meet the MACD you can trade directly from the chart.
MACD Overlay v1 doesn’t just plot an oscillator somewhere below—
it puts value, momentum, and participation on your candles, and it refuses to fire inside chop.
When a triangle prints, it’s because energy released (expansion), not because the chart looked cute.
What it is:
An execution-ready MACD overlay with phase gating (Expansion-Only), participation gating (Weakness-Lite), and one-click Classic vs VW-MACD Compare—all adaptive, with minimal inputs.
What’s in v1 (feature set)
Overlay ribbon on price: Fast/Slow MACD value rendered as a price-level ribbon with contextual fill and optional candle tint.
Dual value model: Classic MA-MACD (EMA/SMA) and VW-MACD (Rolling VWAP fast/slow).
Compare mode: A/B Classic vs VW-MACD with a VW ghost ribbon.
Weakness-Lite (1-bar, adaptive): Gates/fades low-participation crosses using
RVOL deficit, Effort-vs-Result failure, and over-extension vs value/ATR (Strict adds wick pressure).
Expansion-Only (Impulse/Squeeze): Triangles print only when a cross coincides with a true-range burst and a histogram-slope ignition out of compression.
Signal hygiene: ±1-bar proximity around crosses, slope awareness, 2-bar debounce.
Explainable filtering: Tiny gray dots show crosses that were intentionally filtered (weak and/or no expansion).
How to use:
Use defaults: Mode Classic, Gate by Weakness ON, Expansion-Only ON, Sensitivity Auto.
Read signals fast:
Solid triangle = cross + expansion confirmed (+ not weak if gate is ON).
Faded triangle = cross + expansion but weak participation (visible only when gate is OFF).
Gray dot = there was a cross, but it was filtered (no genuine expansion or weak & gated).
Validate quickly: Flip Compare to check VW-MACD agreement. Classic + VW alignment usually improves confidence.
Why overlay > sub-pane oscillator
You see where the cross occurs: relative to value, local structure, and S/R, right on price.
The ribbon exposes regime shifts; tint hints expansion vs contraction at a glance.
Execution becomes more context-aware and less “signal-in-a-vacuum.”
Signals & visuals
Triangles (solid): MACD crossed Signal and market showed expansion out of compression; if Gate by Weakness is ON, triangle prints only with acceptable participation.
Triangles (faded): Same as above but weak (shown only when you turn the gate OFF).
Gray dots: Crosses that were filtered (no expansion and/or Weakness gate).
Ribbon: Fast vs Slow value (Classic or VW, according to Mode). Fill and candle tint reflect expansion/contraction.
Inputs
Calculation Mode: Classic | VW | Compare
VW uses Rolling VWAP fast/slow.
Compare: Classic is primary; VW shows as a ghost ribbon for A/B checks.
Gate triangles by Weakness: ON/OFF
Uses RVOL, Effort-vs-Result, extension vs value/ATR (Strict adds wick-pressure).
Sensitivity: Off / Auto / Strict (default Auto).
Expansion-Only (Impulse/Squeeze): ON/OFF
Requires compression → release: tight ribbon + flat momentum, then TR/ATR burst with hist slope flip / cross proximity.
Display: Ribbon / Candle Tint / Weakness Markers.
Advanced (optional): Evaluate Weakness only near signals, Channel (k × |MACD|), Style Preset.
No numeric thresholds to tune—all filters self-calibrate from rolling stats.
Best practices
4H crypto: Defaults are strong—Auto, Gate ON, Expansion-Only ON.
Clean trends: If you feel you miss some tidy resumptions, briefly toggle Expansion-Only OFF.
Choppy regimes: Set Sensitivity → Strict to cut more noise without adding lag.
Confirmation: Use Compare; Classic + VW alignment typically yields better follow-through.
Alerts
MACD Signal Cross Up/Down — execution-grade (use Once per bar close).
Weakness-Lite Flag — optional context alert to help audit filtered crosses.
Attribution & License
Attribution: Based on the algorithmic concept of TradingView’s built-in MACD (fast MA – slow MA, signal, histogram).
No original TradingView source code is redistributed; overlay rendering, VW-MACD, Weakness-Lite, Expansion-Only, gating visuals, and UX are new work.
License: MPL-2.0. Educational purposes only—not financial advice.
Machine Learning Moving Average [BackQuant]Machine Learning Moving Average
A powerful tool combining clustering, pseudo-machine learning, and adaptive prediction, enabling traders to understand and react to price behavior across multiple market regimes (Bullish, Neutral, Bearish). This script uses a dynamic clustering approach based on percentile thresholds and calculates an adaptive moving average, ideal for forecasting price movements with enhanced confidence levels.
What is Percentile Clustering?
Percentile clustering is a method that sorts and categorizes data into distinct groups based on its statistical distribution. In this script, the clustering process relies on the percentile values of a composite feature (based on technical indicators like RSI, CCI, ATR, etc.). By identifying key thresholds (lower and upper percentiles), the script assigns each data point (price movement) to a cluster (Bullish, Neutral, or Bearish), based on its proximity to these thresholds.
This approach mimics aspects of machine learning, where we “train” the model on past price behavior to predict future movements. The key difference is that this is not true machine learning; rather, it uses data-driven statistical techniques to "cluster" the market into patterns.
Why Percentile Clustering is Useful
Clustering price data into meaningful patterns (Bullish, Neutral, Bearish) helps traders visualize how price behavior can be grouped over time.
By leveraging past price behavior and technical indicators, percentile clustering adapts dynamically to evolving market conditions.
It helps you understand whether price behavior today aligns with past bullish or bearish trends, improving market context.
Clusters can be used to predict upcoming market conditions by identifying regimes with high confidence, improving entry/exit timing.
What This Script Does
Clustering Based on Percentiles : The script uses historical price data and various technical features to compute a "composite feature" for each bar. This feature is then sorted and clustered based on predefined percentile thresholds (e.g., 10th percentile for lower, 90th percentile for upper).
Cluster-Based Prediction : Once clustered, the script uses a weighted average, cluster momentum, or regime transition model to predict future price behavior over a specified number of bars.
Dynamic Moving Average : The script calculates a machine-learning-inspired moving average (MLMA) based on the current cluster, adjusting its behavior according to the cluster regime (Bullish, Neutral, Bearish).
Adaptive Confidence Levels : Confidence in the predicted return is calculated based on the distance between the current value and the other clusters. The further it is from the next closest cluster, the higher the confidence.
Visual Cluster Mapping : The script visually highlights different clusters on the chart with distinct colors for Bullish, Neutral, and Bearish regimes, and plots the MLMA line.
Prediction Output : It projects the predicted price based on the selected method and shows both predicted price and confidence percentage for each prediction horizon.
Trend Identification : Using the clustering output, the script colors the bars based on the current cluster to reflect whether the market is trending Bullish (green), Bearish (red), or is Neutral (gray).
How Traders Use It
Predicting Price Movements : The script provides traders with an idea of where prices might go based on past market behavior. Traders can use this forecast for short-term and long-term predictions, guiding their trades.
Clustering for Regime Analysis : Traders can identify whether the market is in a Bullish, Neutral, or Bearish regime, using that information to adjust trading strategies.
Adaptive Moving Average for Trend Following : The adaptive moving average can be used as a trend-following indicator, helping traders stay in the market when it’s aligned with the current trend (Bullish or Bearish).
Entry/Exit Strategy : By understanding the current cluster and its associated trend, traders can time entries and exits with higher precision, taking advantage of favorable conditions when the confidence in the predicted price is high.
Confidence for Risk Management : The confidence level associated with the predicted returns allows traders to manage risk better. Higher confidence levels indicate stronger market conditions, which can lead to higher position sizes.
Pseudo Machine Learning Aspect
While the script does not use conventional machine learning models (e.g., neural networks or decision trees), it mimics certain aspects of machine learning in its approach. By using clustering and the dynamic adjustment of a moving average, the model learns from historical data to adjust predictions for future price behavior. The "learning" comes from how the script uses past price data (and technical indicators) to create patterns (clusters) and predict future market movements based on those patterns.
Why This Is Important for Traders
Understanding market regimes helps to adjust trading strategies in a way that adapts to current market conditions.
Forecasting price behavior provides an additional edge, enabling traders to time entries and exits based on predicted price movements.
By leveraging the clustering technique, traders can separate noise from signal, improving the reliability of trading signals.
The combination of clustering and predictive modeling in one tool reduces the complexity for traders, allowing them to focus on actionable insights rather than manual analysis.
How to Interpret the Output
Bullish (Green) Zone : When the price behavior clusters into the Bullish zone, expect upward price movement. The MLMA line will help confirm if the trend remains upward.
Bearish (Red) Zone : When the price behavior clusters into the Bearish zone, expect downward price movement. The MLMA line will assist in tracking any downward trends.
Neutral (Gray) Zone : A neutral market condition signals indecision or range-bound behavior. The MLMA line can help track any potential breakouts or trend reversals.
Predicted Price : The projected price is shown on the chart, based on the cluster's predicted behavior. This provides a useful reference for where the price might move in the near future.
Prediction Confidence : The confidence percentage helps you gauge the reliability of the predicted price. A higher percentage indicates stronger market confidence in the forecasted move.
Tips for Use
Combining with Other Indicators : Use the output of this indicator in combination with your existing strategy (e.g., RSI, MACD, or moving averages) to enhance signal accuracy.
Position Sizing with Confidence : Increase position size when the prediction confidence is high, and decrease size when it’s low, based on the confidence interval.
Regime-Based Strategy : Consider developing a multi-strategy approach where you use this tool for Bullish or Bearish regimes and a separate strategy for Neutral markets.
Optimization : Adjust the lookback period and percentile settings to optimize the clustering algorithm based on your asset’s characteristics.
Conclusion
The Machine Learning Moving Average offers a novel approach to price prediction by leveraging percentile clustering and a dynamically adapting moving average. While not a traditional machine learning model, this tool mimics the adaptive behavior of machine learning by adjusting to evolving market conditions, helping traders predict price movements and identify trends with improved confidence and accuracy.
SA_EMA Combo + UT BotEMA Combo + UT Bot is an indicator designed to make it easier to track trend direction and momentum reversals on the same chart.
The indicator combines multiple EMA lines (50/100/150/200) with a short- and medium-term EMA cloud. This cloud visually shows whether the market is in a bullish or bearish trend through color changes.
In addition, it uses the UT Bot algorithm to generate buy and sell signals adapted to market volatility. These signals are triggered when the price crosses the ATR-based trailing stop level.
Users can choose to use Heikin Ashi candles and adjust signal sensitivity via the Key Value parameter. This allows traders to follow overall trends and potential reversal zones using a single tool.
Disclaimer: This indicator is for technical analysis purposes only and should not be considered financial advice.
Developed for Future Alpha Club.
COT Index v.2COT Index v.2 Indicator
( fix for extreme values)
📊 Overview
The COT (Commitment of Traders) Index Indicator transforms raw COT data into normalized indices ranging from 0-100, with extensions to 120 and -20 for extreme market conditions. This powerful tool helps traders analyze institutional positioning and market sentiment by tracking the net long positions of three key market participant groups.
🎯 What It Does
This indicator converts weekly CFTC Commitment of Traders data into easy-to-read oscillator format, showing:
Commercial Index (Blue Line) - Smart money/hedgers positioning
NonCommercial Index (Orange Line) - Large speculators/funds positioning
Nonreportable Index (Red Line) - Small traders positioning
📈 Key Features
Smart Scaling Algorithm
0-100 Range: Normal market conditions based on recent price action
120 Level: Extreme bullish positioning (above historical maximum)
-20 Level: Extreme bearish positioning (below historical minimum)
Dual Time Frame Analysis
Short Period (26 weeks default): For current market scaling
Historical Period (156 weeks default): For extreme condition detection
Flexible Data Sources
Futures Only reports
Futures and Options combined reports
Automatic symbol detection with manual overrides for HG and LBR
🔧 Customizable Settings
Data Configuration
Adjustable lookback periods for both current and historical analysis
Report type selection (Futures vs Futures & Options)
Display Options
Toggle individual trader categories on/off
Customizable reference lines (overbought/oversold levels)
Optional 0/100 boundary lines
Adjustable line widths and colors
Reference Levels
Upper Bound: 120 (extreme bullish)
Overbought: 80 (default)
Midline: 50 (neutral)
Oversold: 20 (default)
Lower Bound: -20 (extreme bearish)
💡 Trading Applications
Contrarian Signals
High Commercial Index + Low NonCommercial Index = Potential bullish reversal
Low Commercial Index + High NonCommercial Index = Potential bearish reversal
Market Sentiment Analysis
Track institutional vs retail positioning divergences
Identify extreme market conditions requiring attention
Monitor smart money accumulation/distribution patterns
Confirmation Tool
Use alongside technical analysis for trade confirmation
Validate breakouts with positioning data
Assess market structure changes
📊 Visual Elements
Status Table: Displays current settings and symbol information
Color-Coded Lines: Easy identification of each trader category
Reference Levels: Clear overbought/oversold boundaries
Extreme Indicators: Visual cues for unusual market conditions
⚠️ Important Notes
COT data is released weekly on Fridays (Tuesday data)
Best suited for weekly and daily timeframes
Requires symbols with available CFTC data
Works automatically for most futures contracts
🎯 Best Practices
Use in conjunction with price action analysis
Look for divergences between price and positioning
Pay special attention to extreme readings (120/-20 levels)
Consider all three indices together for complete market picture
Allow for data lag (3-day delay from CFTC)
This indicator is ideal for swing traders, position traders, and anyone interested in understanding the positioning dynamics of professional vs retail market participants.
LibVPrfLibrary "LibVPrf"
This library provides an object-oriented framework for volume
profile analysis in Pine Script®. It is built around the `VProf`
User-Defined Type (UDT), which encapsulates all data, settings,
and statistical metrics for a single profile, enabling stateful
analysis with on-demand calculations.
Key Features:
1. **Object-Oriented Design (UDT):** The library is built around
the `VProf` UDT. This object encapsulates all profile data
and provides methods for its full lifecycle management,
including creation, cloning, clearing, and merging of profiles.
2. **Volume Allocation (`AllotMode`):** Offers two methods for
allocating a bar's volume:
- **Classic:** Assigns the entire bar's volume to the close
price bucket.
- **PDF:** Distributes volume across the bar's range using a
statistical price distribution model from the `LibBrSt` library.
3. **Buy/Sell Volume Splitting (`SplitMode`):** Provides methods
for classifying volume into buying and selling pressure:
- **Classic:** Classifies volume based on the bar's color (Close vs. Open).
- **Dynamic:** A specific model that analyzes candle structure
(body vs. wicks) and a short-term trend factor to
estimate the buy/sell share at each price level.
4. **Statistical Analysis (On-Demand):** Offers a suite of
statistical metrics calculated using a "Lazy Evaluation"
pattern (computed only when requested via `get...` methods):
- **Central Tendency:** Point of Control (POC), VWAP, and Median.
- **Dispersion:** Value Area (VA) and Population Standard Deviation.
- **Shape:** Skewness and Excess Kurtosis.
- **Delta:** Cumulative Volume Delta, including its
historical high/low watermarks.
5. **Structural Analysis:** Includes a parameter-free method
(`getSegments`) to decompose a profile into its fundamental
unimodal segments, allowing for modality detection (e.g.,
identifying bimodal profiles).
6. **Dynamic Profile Management:**
- **Auto-Fitting:** Profiles set to `dynamic = true` will
automatically expand their price range to fit new data.
- **Manipulation:** The resolution, price range, and Value Area
of a dynamic profile can be changed at any time. This
triggers a resampling process that uses a **linear
interpolation model** to re-bucket existing volume.
- **Assumption:** Non-dynamic profiles are fixed and will throw
a `runtime.error` if `addBar` is called with data
outside their initial range.
7. **Bucket-Level Access:** Provides getter methods for direct
iteration and analysis of the raw buy/sell volume and price
boundaries of each individual price bucket.
---
**DISCLAIMER**
This library is provided "AS IS" and for informational and
educational purposes only. It does not constitute financial,
investment, or trading advice.
The author assumes no liability for any errors, inaccuracies,
or omissions in the code. Using this library to build
trading indicators or strategies is entirely at your own risk.
As a developer using this library, you are solely responsible
for the rigorous testing, validation, and performance of any
scripts you create based on these functions. The author shall
not be held liable for any financial losses incurred directly
or indirectly from the use of this library or any scripts
derived from it.
create(buckets, rangeUp, rangeLo, dynamic, valueArea, allot, estimator, cdfSteps, split, trendLen)
Construct a new `VProf` object with fixed bucket count & range.
Parameters:
buckets (int) : series int number of price buckets ≥ 1
rangeUp (float) : series float upper price bound (absolute)
rangeLo (float) : series float lower price bound (absolute)
dynamic (bool) : series bool Flag for dynamic adaption of profile ranges
valueArea (int) : series int Percentage of total volume to include in the Value Area (1..100)
allot (series AllotMode) : series AllotMode Allocation mode `classic` or `pdf` (default `classic`)
estimator (series PriceEst enum from AustrianTradingMachine/LibBrSt/1) : series LibBrSt.PriceEst PDF model when `model == PDF`. (deflault = 'uniform')
cdfSteps (int) : series int even #sub-intervals for Simpson rule (default 20)
split (series SplitMode) : series SplitMode Buy/Sell determination (default `classic`)
trendLen (int) : series int Look‑back bars for trend factor (default 3)
Returns: VProf freshly initialised profile
method clone(self)
Create a deep copy of the volume profile.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object to copy
Returns: VProf A new, independent copy of the profile
method clear(self)
Reset all bucket tallies while keeping configuration intact.
Namespace types: VProf
Parameters:
self (VProf) : VProf profile object
Returns: VProf cleared profile (chaining)
method merge(self, srcABuy, srcASell, srcRangeUp, srcRangeLo, srcCvd, srcCvdHi, srcCvdLo)
Merges volume data from a source profile into the current profile.
If resizing is needed, it performs a high-fidelity re-bucketing of existing
volume using a linear interpolation model inferred from neighboring buckets,
preventing aliasing artifacts and ensuring accurate volume preservation.
Namespace types: VProf
Parameters:
self (VProf) : VProf The target profile object to merge into.
srcABuy (array) : array The source profile's buy volume bucket array.
srcASell (array) : array The source profile's sell volume bucket array.
srcRangeUp (float) : series float The upper price bound of the source profile.
srcRangeLo (float) : series float The lower price bound of the source profile.
srcCvd (float) : series float The final Cumulative Volume Delta (CVD) value of the source profile.
srcCvdHi (float) : series float The historical high-water mark of the CVD from the source profile.
srcCvdLo (float) : series float The historical low-water mark of the CVD from the source profile.
Returns: VProf `self` (chaining), now containing the merged data.
method addBar(self, offset)
Add current bar’s volume to the profile (call once per realtime bar).
classic mode: allocates all volume to the close bucket and classifies
by `close >= open`. PDF mode: distributes volume across buckets by the
estimator’s CDF mass. For `split = dynamic`, the buy/sell share per
price is computed via context-driven piecewise s(u).
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object
offset (int) : series int To offset the calculated bar
Returns: VProf `self` (method chaining)
method setBuckets(self, buckets)
Sets the number of buckets for the volume profile.
Behavior depends on the `isDynamic` flag.
- If `dynamic = true`: Works on filled profiles by re-bucketing to a new resolution.
- If `dynamic = false`: Only works on empty profiles to prevent accidental changes.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object
buckets (int) : series int The new number of buckets
Returns: VProf `self` (chaining)
method setRanges(self, rangeUp, rangeLo)
Sets the price range for the volume profile.
Behavior depends on the `dynamic` flag.
- If `dynamic = true`: Works on filled profiles by re-bucketing existing volume.
- If `dynamic = false`: Only works on empty profiles to prevent accidental changes.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object
rangeUp (float) : series float The new upper price bound
rangeLo (float) : series float The new lower price bound
Returns: VProf `self` (chaining)
method setValueArea(self, valueArea)
Set the percentage of volume for the Value Area. If the value
changes, the profile is finalized again.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object
valueArea (int) : series int The new Value Area percentage (0..100)
Returns: VProf `self` (chaining)
method getBktBuyVol(self, idx)
Get Buy volume of a bucket.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object
idx (int) : series int Bucket index
Returns: series float Buy volume ≥ 0
method getBktSellVol(self, idx)
Get Sell volume of a bucket.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object
idx (int) : series int Bucket index
Returns: series float Sell volume ≥ 0
method getBktBnds(self, idx)
Get Bounds of a bucket.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object
idx (int) : series int Bucket index
Returns:
up series float The upper price bound of the bucket.
lo series float The lower price bound of the bucket.
method getPoc(self)
Get POC information.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object
Returns:
pocIndex series int The index of the Point of Control (POC) bucket.
pocPrice. series float The mid-price of the Point of Control (POC) bucket.
method getVA(self)
Get Value Area (VA) information.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object
Returns:
vaUpIndex series int The index of the upper bound bucket of the Value Area.
vaUpPrice series float The upper price bound of the Value Area.
vaLoIndex series int The index of the lower bound bucket of the Value Area.
vaLoPrice series float The lower price bound of the Value Area.
method getMedian(self)
Get the profile's median price and its bucket index. Calculates the value on-demand if stale.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object.
Returns:
medianIndex series int The index of the bucket containing the Median.
medianPrice series float The Median price of the profile.
method getVwap(self)
Get the profile's VWAP and its bucket index. Calculates the value on-demand if stale.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object.
Returns:
vwapIndex series int The index of the bucket containing the VWAP.
vwapPrice series float The Volume Weighted Average Price of the profile.
method getStdDev(self)
Get the profile's volume-weighted standard deviation. Calculates the value on-demand if stale.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object.
Returns: series float The Standard deviation of the profile.
method getSkewness(self)
Get the profile's skewness. Calculates the value on-demand if stale.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object.
Returns: series float The Skewness of the profile.
method getKurtosis(self)
Get the profile's excess kurtosis. Calculates the value on-demand if stale.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object.
Returns: series float The Kurtosis of the profile.
method getSegments(self)
Get the profile's fundamental unimodal segments. Calculates on-demand if stale.
Uses a parameter-free, pivot-based recursive algorithm.
Namespace types: VProf
Parameters:
self (VProf) : VProf The profile object.
Returns: matrix A 2-column matrix where each row is an pair.
method getCvd(self)
Cumulative Volume Delta (CVD) like metric over all buckets.
Namespace types: VProf
Parameters:
self (VProf) : VProf Profile object.
Returns:
cvd series float The final Cumulative Volume Delta (Total Buy Vol - Total Sell Vol).
cvdHi series float The running high-water mark of the CVD as volume was added.
cvdLo series float The running low-water mark of the CVD as volume was added.
VProf
VProf Bucketed Buy/Sell volume profile plus meta information.
Fields:
buckets (series int) : int Number of price buckets (granularity ≥1)
rangeUp (series float) : float Upper price range (absolute)
rangeLo (series float) : float Lower price range (absolute)
dynamic (series bool) : bool Flag for dynamic adaption of profile ranges
valueArea (series int) : int Percentage of total volume to include in the Value Area (1..100)
allot (series AllotMode) : AllotMode Allocation mode `classic` or `pdf`
estimator (series PriceEst enum from AustrianTradingMachine/LibBrSt/1) : LibBrSt.PriceEst Price density model when `model == PDF`
cdfSteps (series int) : int Simpson integration resolution (even ≥2)
split (series SplitMode) : SplitMode Buy/Sell split strategy per bar
trendLen (series int) : int Look‑back length for trend factor (≥1)
maxBkt (series int) : int User-defined number of buckets (unclamped)
aBuy (array) : array Buy volume per bucket
aSell (array) : array Sell volume per bucket
cvd (series float) : float Final Cumulative Volume Delta (Total Buy Vol - Total Sell Vol).
cvdHi (series float) : float Running high-water mark of the CVD as volume was added.
cvdLo (series float) : float Running low-water mark of the CVD as volume was added.
poc (series int) : int Index of max‑volume bucket (POC). Is `na` until calculated.
vaUp (series int) : int Index of upper Value‑Area bound. Is `na` until calculated.
vaLo (series int) : int Index of lower value‑Area bound. Is `na` until calculated.
median (series float) : float Median price of the volume distribution. Is `na` until calculated.
vwap (series float) : float Profile VWAP (Volume Weighted Average Price). Is `na` until calculated.
stdDev (series float) : float Standard Deviation of volume around the VWAP. Is `na` until calculated.
skewness (series float) : float Skewness of the volume distribution. Is `na` until calculated.
kurtosis (series float) : float Excess Kurtosis of the volume distribution. Is `na` until calculated.
segments (matrix) : matrix A 2-column matrix where each row is an pair. Is `na` until calculated.






















