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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。