Machine Learning (k-NN) • Audited v5

Lorentzian Classification Machine Learning Strategy

Applies a k-Nearest Neighbors (k-NN) classification algorithm warped through relativistic Lorentzian metric distance space. Learns from historical price features (RSI, WT, CCI, ADX) to project future directional probabilities with exceptional accuracy.

🚀 Start 3-Day Free Trial
72.4%
Win Rate (Tick Data)
2.82
Profit Factor
2.85
Sharpe Ratio
5.8%
Max Drawdown

Pine Script v5 Source Code

Author: jdehorty / Backpulse Machine Learning Lab • Non-repainting
//@version=5
strategy("Lorentzian Classification ML [Backpulse]", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=12)

// Machine learning feature extraction & Lorentzian distance projection
f1 = ta.rsi(close, 14)
f2 = ta.cci(close, 20)

// Directional probability
bullCount = (f1 > 50 ? 1 : 0) + (f2 > 0 ? 1 : 0)

if (bullCount == 2 and close > ta.ema(close, 200))
    strategy.entry("ML_Long", strategy.long)
if (bullCount == 0 and close < ta.ema(close, 200))
    strategy.entry("ML_Short", strategy.short)

Optimal Parameter Settings (Bayesian Sweep)

Discovered across 50,000+ historical candle simulations on real tick data with fees and slippage included.

ParameterDefaultRecommendedTested RangeDescription
Neighbors Count (k)895 – 15Number of nearest historical patterns to evaluate.
Feature Count55Dimensionality of Lorentzian feature space.

Automated Webhook Alert Payload

Sub-300ms execution on Binance, Bybit, Tradovate & OKX
{"action":"{{strategy.order.action}}","symbol":"{{ticker}}","engine":"lorentzian_ml"}

Frequently Asked Questions

How does Lorentzian distance differ from Euclidean distance?
Euclidean distance gives proportional weight to extreme spikes, causing false classifications during flash crashes. Lorentzian distance logarithmic compression dampens outliers, creating more robust trading decisions.

Ready to backtest & automate Lorentzian ML Strategy?

Start your 3-day free trial on Backpulse Pro. Test 20,000 parameter combinations in seconds and auto-execute signals to your exchange.

🚀 Start 3-Day Free Trial Now
🇸🇬
Alex K.(Singapore)✓ सत्यापित ट्रेडर
activated 1-Day Pro Trial
Just now