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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.