OPEN-SOURCE SCRIPT
LogTrend Retest Engine

LogTrend Retest Engine (LTRE)
LogTrend Retest Engine (LTRE) is an advanced trend-continuation overlay designed to identify high-probability breakout retests using logarithmic regression, volatility-adjusted deviation bands, and market regime filtering.
Unlike traditional channels or moving averages, LTRE models price behavior in log space, allowing it to adapt naturally to exponential market moves common in crypto, indices, and long-term trends.
🔹 How It Works
Logarithmic Regression Core
Volatility-Adjusted Deviation Bands
Adaptive Lookback (Optional)
🔹 Market Regime Detection
LTRE actively filters conditions using:
Signals are disabled during ranging or low-quality conditions.
🔹 Breakout → Retest Signal Logic
LTRE does not chase breakouts.
Signals trigger only when:
1. Price breaks cleanly outside the deviation band
2. Market regime is confirmed as trending
3. Price performs a controlled retest within a user-defined tolerance
BUY
SELL
This structure is designed to reduce false breakouts and late entries.
🔹 Visual & Projection Tools
🔹 Best Use Cases
⚠️ Disclaimer
LTRE is a decision-support tool, not a complete trading system. Always use proper risk management and confirm signals with additional structure, volume, or higher-timeframe context.
Built for traders who wait for structure — not noise.
LogTrend Retest Engine (LTRE) is an advanced trend-continuation overlay designed to identify high-probability breakout retests using logarithmic regression, volatility-adjusted deviation bands, and market regime filtering.
Unlike traditional channels or moving averages, LTRE models price behavior in log space, allowing it to adapt naturally to exponential market moves common in crypto, indices, and long-term trends.
🔹 How It Works
Logarithmic Regression Core
- Performs linear regression on log-transformed price and time
- Produces a structurally accurate trend midline that scales with price growth
Volatility-Adjusted Deviation Bands
- Dynamic upper and lower zones based on statistical deviation
- ATR weighting expands or contracts bands as volatility changes
Adaptive Lookback (Optional)
- Automatically adjusts regression length using volatility pressure
- Faster response in high-volatility environments, smoother in consolidation
🔹 Market Regime Detection
LTRE actively filters conditions using:
- R² trend strength (trend quality, not just slope)
- Volatility compression vs expansion
- User-defined minimum trend strength threshold
Signals are disabled during ranging or low-quality conditions.
🔹 Breakout → Retest Signal Logic
LTRE does not chase breakouts.
Signals trigger only when:
1. Price breaks cleanly outside the deviation band
2. Market regime is confirmed as trending
3. Price performs a controlled retest within a user-defined tolerance
BUY
- Break above upper band → retest → trend confirmed
SELL
- Break below lower band → retest → trend confirmed
This structure is designed to reduce false breakouts and late entries.
🔹 Visual & Projection Tools
- Clean midline and deviation bands
- Optional filled zones
- Optional future trend projection for forward structure planning
- On-chart statistics for trend strength and volatility compression
🔹 Best Use Cases
- Trend continuation & pullback strategies
- Crypto, Forex, Indices, and equities
- Works best on 15m and higher timeframes
⚠️ Disclaimer
LTRE is a decision-support tool, not a complete trading system. Always use proper risk management and confirm signals with additional structure, volume, or higher-timeframe context.
Built for traders who wait for structure — not noise.
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.
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.
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.