OPEN-SOURCE SCRIPT
Uptrick: Price Memory Trend

Introduction
Uptrick: Price Memory Trend is a custom indicator designed to detect directional shifts and volatility changes using a non-traditional price memory approach. Unlike moving average systems, it builds a dynamic memory of price that adapts gradually over time, allowing it to detect significant deviations and trend transitions with reduced noise.
Overview
This script identifies trend changes by comparing the current price to a memory-based baseline. When price deviates significantly from this memory base, it triggers a trend regime shift—either bullish or bearish. Adaptive deviation bands are calculated using absolute deviation from the memory base, not ATR or standard deviation, which allows the indicator to capture volatility uniquely. Visual components include color-coded candles, labeled signals, optional bands, and a live status table summarizing current trend metrics.
Originality
The indicator’s core innovation lies in its use of a decaying memory function to track trend direction, replacing moving averages with a price memory that responds only to significant deviations. This method avoids lag typically associated with smoothing techniques, enabling timely trend detection. Furthermore, deviation is measured directly in price terms, rather than through volatility surrogates like ATR or Bollinger Bands, resulting in a more raw and responsive depiction of price behavior.
Inputs
Core Engine
Customization
Features
Trend Detection
Candle Coloring
Signal Labels
Deviation Bands
Alerts
Info Table
The optional info table displays:
Info Table:

Trade Example:

Logic
Price Memory
Deviation and Bands
Trend Logic
Stretch and Band Analysis
Info Table Metrics
Summary
Uptrick: Price Memory Trend provides an alternative framework for trend identification by replacing traditional smoothing with adaptive memory logic. It measures price deviation without reliance on ATR or standard deviation, instead focusing on distance from a reactive baseline. With regime-based trend tracking, customizable visuals, and a detailed status table, it supports both discretionary and system-driven trading styles.
Uptrick: Price Memory Trend is a custom indicator designed to detect directional shifts and volatility changes using a non-traditional price memory approach. Unlike moving average systems, it builds a dynamic memory of price that adapts gradually over time, allowing it to detect significant deviations and trend transitions with reduced noise.
Overview
This script identifies trend changes by comparing the current price to a memory-based baseline. When price deviates significantly from this memory base, it triggers a trend regime shift—either bullish or bearish. Adaptive deviation bands are calculated using absolute deviation from the memory base, not ATR or standard deviation, which allows the indicator to capture volatility uniquely. Visual components include color-coded candles, labeled signals, optional bands, and a live status table summarizing current trend metrics.
Originality
The indicator’s core innovation lies in its use of a decaying memory function to track trend direction, replacing moving averages with a price memory that responds only to significant deviations. This method avoids lag typically associated with smoothing techniques, enabling timely trend detection. Furthermore, deviation is measured directly in price terms, rather than through volatility surrogates like ATR or Bollinger Bands, resulting in a more raw and responsive depiction of price behavior.
Inputs
Core Engine
- Memory Strength: Sets how strongly the memory responds to price changes. Higher values make the memory base more reactive.
- Memory Decay: Controls how much past memory is retained. Lower values weight new prices more heavily.
- Deviation Length: Length of the EMA used to smooth absolute price deviation. A longer setting results in smoother bands.
- Band Multiplier: Expands or contracts the dynamic bands. Higher values widen the bands, reducing sensitivity.
Customization
- Color Palette: Selects one of six predefined color schemes for bull and bear visuals.
- Show Bands: Enables or disables the display of deviation bands.
- Look: Chooses between 'Bands', 'Trail', or 'Intense' styles, affecting how bands and fills are drawn.
BandsTrail
Intense
- Show Info Table: Toggles display of the real-time trend and volatility status panel.
- Table Position: Determines which corner of the chart the info panel appears in.
- Text Size: Adjusts font size used within the info table.
Features
Trend Detection
- Bullish Shift: Triggered when price crosses above the upper band, entering a new bullish regime.
- Bearish Shift: Triggered when price crosses below the lower band, entering a new bearish regime.
- Trend state is persistent and updated only on confirmed transitions, avoiding repeated entries in the same direction.
Candle Coloring
- Candles are dynamically recolored based on current trend direction: bull, bear, or neutral.
Signal Labels
- Visual labels marked "Up" or "Down" are placed on the chart when a regime shift occurs, helping to mark turning points.
Deviation Bands
- Dynamic upper and lower bands are drawn based on smoothed absolute deviation from the memory base.
- Additional outer bands based on ATR may be drawn to highlight zone intensity when the 'Intense' or 'Trail' styles are selected.
- Bands visually indicate overextension and help frame price context relative to memory.
Alerts
- Built-in alert conditions trigger on bullish or bearish trend shifts, useful for automation or notifications.
Info Table
The optional info table displays:
- Current trend direction
- Band state (calm, hot, or cool)
- Price stretch from base
- Trend age in bars
- Confidence level based on deviation
- Memory slope and acceleration
- Band width and compression state
- Reversion risk based on stretch level
Info Table:
Trade Example:
Logic
Price Memory
- A recursive formula updates a memory variable based on the current price.
- The memory adjusts only when the price deviates meaningfully from its previous value.
- The formula uses a combination of delta-weighting and exponential decay:
> memory := previous_memory + delta × memory_strength
> memory := memory × memory_decay + price × (1 - memory_decay) - This produces a smooth, adaptive base that responds gradually to directional price moves.
Deviation and Bands
- Absolute deviation between price and the memory base is calculated and smoothed using an EMA.
- The upper and lower bands are then calculated as:
> Upper Band = memory base + (smoothed deviation × band multiplier)
> Lower Band = memory base - (smoothed deviation × band multiplier) - ATR-based extensions can optionally be drawn around these bands for added visual structure.
Trend Logic
- Bullish and bearish states are tracked using crossovers and crossunders of price against the upper and lower bands.
- The indicator maintains a persistent trend state variable that updates only when a confirmed regime change occurs.
- This prevents multiple signals within the same trend direction (non-pyramiding behavior).
Stretch and Band Analysis
- Stretch is measured as the deviation of price from memory, normalized by smoothed deviation.
- Band width is tracked over time and used to detect compression or expansion.
- Band position is calculated to identify where price sits between the upper and lower bands.
Info Table Metrics
- Memory Slope and Acceleration: Show first and second derivative of the memory base to capture trend speed and change.
- Confidence Level: Based on stretch intensity, indicating trend strength.
- Reversion Risk: Inferred from how extended price is beyond the band.
- Compression: Evaluated by comparing current band width to its recent average.
Summary
Uptrick: Price Memory Trend provides an alternative framework for trend identification by replacing traditional smoothing with adaptive memory logic. It measures price deviation without reliance on ATR or standard deviation, instead focusing on distance from a reactive baseline. With regime-based trend tracking, customizable visuals, and a detailed status table, it supports both discretionary and system-driven trading styles.
Disclaimer
This script is for informational and educational purposes only. It does not provide financial advice or guarantees. Trading involves risk, and past performance is not indicative of future results. Always perform your own research before making trading decisions.
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.
💎 Free Discord: discord.gg/Def47ueyuD
💎 Website: uptrick.io
Nothing is financial advice. Always do your own research.
💎 Website: uptrick.io
Nothing is financial advice. Always do your own research.
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.
💎 Free Discord: discord.gg/Def47ueyuD
💎 Website: uptrick.io
Nothing is financial advice. Always do your own research.
💎 Website: uptrick.io
Nothing is financial advice. Always do your own research.
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.