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が提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。