OPEN-SOURCE SCRIPT
Time-Price Velocity [QuantAlgo]

๐ข Overview
The Time-Price Velocity indicator uses advanced velocity-based analysis to measure the rate of price change normalized against typical market movement, creating a dynamic momentum oscillator that identifies market acceleration patterns and momentum shifts. Unlike traditional momentum indicators that focus solely on price change magnitude, this indicator incorporates time-weighted displacement calculations and ATR normalization to create a sophisticated velocity measurement system that adapts to varying market volatility conditions.

This indicator displays a velocity signal line that oscillates around zero, with positive values indicating upward price velocity and negative values indicating downward price velocity. The signal incorporates acceleration background columns and statistical normalization to help traders identify momentum shifts and potential reversal or continuation opportunities across different timeframes and asset classes.
๐ข How It Works
The indicator's key insight lies in its time-price velocity calculation system, where velocity is measured using the fundamental physics formula:
Pine Scriptยฎ
The system normalizes this raw velocity against typical price movement using Average True Range (ATR) to create market-adjusted readings:
Pine Scriptยฎ
where "typicalMove = ta.atr(lookback)" provides the baseline for normal price movement over the specified lookback period.
The Time-Price Velocity indicator calculation combines multiple sophisticated components. First, it calculates acceleration as the change in velocity over time:
Pine Scriptยฎ
Then, the signal generation applies EMA smoothing to reduce noise while preserving responsiveness:
Pine Scriptยฎ
This creates a velocity-based momentum indicator that combines price displacement analysis with statistical normalization, providing traders with both directional signals and acceleration insights for enhanced market timing.
๐ข How to Use
1. Signal Interpretation and Threshold Zones
2. Acceleration Analysis and Visual Features
3. Additional Features:
๐ข Examples with Preconfigured Settings
The Time-Price Velocity indicator uses advanced velocity-based analysis to measure the rate of price change normalized against typical market movement, creating a dynamic momentum oscillator that identifies market acceleration patterns and momentum shifts. Unlike traditional momentum indicators that focus solely on price change magnitude, this indicator incorporates time-weighted displacement calculations and ATR normalization to create a sophisticated velocity measurement system that adapts to varying market volatility conditions.
This indicator displays a velocity signal line that oscillates around zero, with positive values indicating upward price velocity and negative values indicating downward price velocity. The signal incorporates acceleration background columns and statistical normalization to help traders identify momentum shifts and potential reversal or continuation opportunities across different timeframes and asset classes.
๐ข How It Works
The indicator's key insight lies in its time-price velocity calculation system, where velocity is measured using the fundamental physics formula:
velocity = priceChange / timeWeight
The system normalizes this raw velocity against typical price movement using Average True Range (ATR) to create market-adjusted readings:
normalizedVelocity = typicalMove > 0 ? velocity / typicalMove : 0
where "typicalMove = ta.atr(lookback)" provides the baseline for normal price movement over the specified lookback period.
The Time-Price Velocity indicator calculation combines multiple sophisticated components. First, it calculates acceleration as the change in velocity over time:
acceleration = normalizedVelocity - normalizedVelocity[1]
Then, the signal generation applies EMA smoothing to reduce noise while preserving responsiveness:
signal = ta.ema(normalizedVelocity, smooth)
This creates a velocity-based momentum indicator that combines price displacement analysis with statistical normalization, providing traders with both directional signals and acceleration insights for enhanced market timing.
๐ข How to Use
1. Signal Interpretation and Threshold Zones
- Positive Values (Above Zero): Time-price velocity indicating bullish momentum with upward price displacement relative to normalized baseline
- Negative Values (Below Zero): Time-price velocity indicating bearish momentum with downward price displacement relative to normalized baseline
- Zero Line Crosses: Velocity transitions between bullish and bearish regimes, indicating potential trend changes or momentum shifts
- Upper Threshold Zone: Area above positive threshold (default 1.0) indicating strong bullish velocity and potential reversal point
- Lower Threshold Zone: Area below negative threshold (default -1.0) indicating strong bearish velocity and potential reversal point
2. Acceleration Analysis and Visual Features
- Acceleration Columns: Background histogram showing velocity acceleration (the rate of change of velocity), with green columns indicating accelerating velocity and red columns indicating decelerating velocity. The interpretation depends on trend context: red columns in downtrends indicate strengthening bearish momentum, while red columns in uptrends indicate weakening bullish momentum
- Acceleration Column Height: The height of each column represents the magnitude of acceleration, with taller columns indicating stronger acceleration or deceleration forces
- Bar Coloring: Optional price bar coloring matches velocity direction for immediate visual trend confirmation
- Info Table: Real-time display of current velocity and acceleration values with trend arrows and change indicators
3. Additional Features:
- Confirmed vs Live Data: Toggle between confirmed (closed) bar analysis for stable signals or current bar inclusion for real-time updates
- Multi-timeframe Adaptability: Velocity normalization ensures consistent readings across different chart timeframes and asset volatilities
- Alert System: Built-in alerts for threshold crossovers and direction changes
๐ข Examples with Preconfigured Settings
- Default: Balanced configuration suitable for most timeframes and general trading applications, providing optimal balance between sensitivity and noise filtering for medium-term analysis.
- Scalping: High sensitivity setup with shorter lookback period and reduced smoothing for ultra-short-term trades on 1-15 minute charts, optimized for capturing rapid momentum shifts and frequent trading opportunities.
- Swing Trading: Extended lookback period with enhanced smoothing and higher threshold for multi-day positions, designed to filter market noise while capturing significant momentum moves on 1-4 hour and daily timeframes.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
๐ Access exclusive tools for trading & investing here (3-day FREE trial): joinquantalgo.com/
๐ฉ DM if you need any custom-built indicators.
๐ฉ DM if you need any custom-built indicators.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
๐ Access exclusive tools for trading & investing here (3-day FREE trial): joinquantalgo.com/
๐ฉ DM if you need any custom-built indicators.
๐ฉ DM if you need any custom-built indicators.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.