OPEN-SOURCE SCRIPT
EDUVEST Lorentzian Classification

EDUVEST Lorentzian Classification - Machine Learning Signal Detection
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ ORIGINALITY
This indicator enhances the original Lorentzian Classification concept by jdehorty with EduVest's visual modifications and alert system integration. The core innovation is using Lorentzian distance instead of Euclidean distance for k-NN classification, providing more robust pattern recognition in financial markets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ WHAT IT DOES
- Generates BUY/SELL signals using machine learning classification
- Displays kernel regression estimate for trend visualization
- Shows prediction values on each bar
- Provides trade statistics (Win Rate, W/L Ratio)
- Includes multiple filter options (Volatility, Regime, ADX, EMA, SMA)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ HOW IT WORKS
【Lorentzian Distance Calculation】
Unlike Euclidean distance, Lorentzian distance uses logarithmic transformation:
d = Σ log(1 + |xi - yi|)
This provides:
- Better handling of outliers
- More stable distance measurements
- Reduced sensitivity to extreme values
【Feature Engineering】
The classifier uses up to 5 configurable features:
- RSI (Relative Strength Index)
- WT (WaveTrend)
- CCI (Commodity Channel Index)
- ADX (Average Directional Index)
Each feature is normalized using the n_rsi, n_wt, n_cci, or n_adx functions.
【k-Nearest Neighbors Classification】
1. Calculate Lorentzian distance between current bar and historical bars
2. Find k nearest neighbors (default: 8)
3. Sum predictions from neighbors
4. Generate signal based on prediction sum (>0 = Long, <0 = Short)
【Kernel Regression】
Uses Rational Quadratic kernel for smooth trend estimation:
- Lookback Window: 8
- Relative Weighting: 8
- Regression Level: 25
【Filters】
- Volatility Filter: Filters signals during extreme volatility
- Regime Filter: Identifies market regime using threshold
- ADX Filter: Confirms trend strength
- EMA/SMA Filter: Trend direction confirmation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ HOW TO USE
【Recommended Settings】
- Timeframe: 15M, 1H, 4H, Daily
- Neighbors Count: 8 (default)
- Feature Count: 5 for comprehensive analysis
【Signal Interpretation】
- Green BUY label: Long entry signal
- Red SELL label: Short entry signal
- Bar colors: Green (bullish) / Red (bearish) prediction strength
【Trade Statistics Panel】
- Winrate: Historical win percentage
- Trades: Total (Wins|Losses)
- WL Ratio: Win/Loss ratio
- Early Signal Flips: Premature signal changes
【Filter Recommendations】
- Enable Volatility Filter for ranging markets
- Enable Regime Filter for trend confirmation
- Use EMA Filter (200) for higher timeframes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ CREDITS
Original Lorentzian Classification concept and MLExtensions library by jdehorty.
Enhanced with visual modifications and alert integration by EduVest.
License: Mozilla Public License 2.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ ORIGINALITY
This indicator enhances the original Lorentzian Classification concept by jdehorty with EduVest's visual modifications and alert system integration. The core innovation is using Lorentzian distance instead of Euclidean distance for k-NN classification, providing more robust pattern recognition in financial markets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ WHAT IT DOES
- Generates BUY/SELL signals using machine learning classification
- Displays kernel regression estimate for trend visualization
- Shows prediction values on each bar
- Provides trade statistics (Win Rate, W/L Ratio)
- Includes multiple filter options (Volatility, Regime, ADX, EMA, SMA)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ HOW IT WORKS
【Lorentzian Distance Calculation】
Unlike Euclidean distance, Lorentzian distance uses logarithmic transformation:
d = Σ log(1 + |xi - yi|)
This provides:
- Better handling of outliers
- More stable distance measurements
- Reduced sensitivity to extreme values
【Feature Engineering】
The classifier uses up to 5 configurable features:
- RSI (Relative Strength Index)
- WT (WaveTrend)
- CCI (Commodity Channel Index)
- ADX (Average Directional Index)
Each feature is normalized using the n_rsi, n_wt, n_cci, or n_adx functions.
【k-Nearest Neighbors Classification】
1. Calculate Lorentzian distance between current bar and historical bars
2. Find k nearest neighbors (default: 8)
3. Sum predictions from neighbors
4. Generate signal based on prediction sum (>0 = Long, <0 = Short)
【Kernel Regression】
Uses Rational Quadratic kernel for smooth trend estimation:
- Lookback Window: 8
- Relative Weighting: 8
- Regression Level: 25
【Filters】
- Volatility Filter: Filters signals during extreme volatility
- Regime Filter: Identifies market regime using threshold
- ADX Filter: Confirms trend strength
- EMA/SMA Filter: Trend direction confirmation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ HOW TO USE
【Recommended Settings】
- Timeframe: 15M, 1H, 4H, Daily
- Neighbors Count: 8 (default)
- Feature Count: 5 for comprehensive analysis
【Signal Interpretation】
- Green BUY label: Long entry signal
- Red SELL label: Short entry signal
- Bar colors: Green (bullish) / Red (bearish) prediction strength
【Trade Statistics Panel】
- Winrate: Historical win percentage
- Trades: Total (Wins|Losses)
- WL Ratio: Win/Loss ratio
- Early Signal Flips: Premature signal changes
【Filter Recommendations】
- Enable Volatility Filter for ranging markets
- Enable Regime Filter for trend confirmation
- Use EMA Filter (200) for higher timeframes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ CREDITS
Original Lorentzian Classification concept and MLExtensions library by jdehorty.
Enhanced with visual modifications and alert integration by EduVest.
License: Mozilla Public License 2.0
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Custom Pine Script Development → fiverr.com/eduvest | 30 Years STEM Education × AI-Powered Trading Tools
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Custom Pine Script Development → fiverr.com/eduvest | 30 Years STEM Education × AI-Powered Trading Tools
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.