OPEN-SOURCE SCRIPT

Flip to Green

68
Purpose:
This indicator applies a Lorentzian-distance–based machine-learning model to classify market conditions and highlight probable momentum shifts.
Where traditional indicators react to price movement, this one uses statistical pattern recognition to predict when momentum is likely to flip direction — the classic “flip to green” signal.

Concept:
Financial markets don’t move linearly; they bend and distort around major catalysts (news, FOMC meetings, earnings, etc.) in a way similar to how gravity warps space-time.
This indicator accounts for that distortion by measuring distance in Lorentzian space instead of the usual Euclidean space.
In simple terms: it adapts to volatility “warping,” allowing the model to detect structural momentum changes that normal math misses.

Core logic:

Imports two custom libraries:

MLExtensions for machine-learning utilities

KernelFunctions for advanced distance calculations

Computes relationships among multiple features (e.g., RSI, ADX, or other inputs).

Uses Lorentzian geometry to weight how recent price-time behavior influences current classification.

Outputs a visual “flip” cue when the probability of trend reversal exceeds threshold confidence.

Why it matters:
Most indicators measure what has already happened.
Lorentzian Classification attempts to capture what’s about to happen by comparing the present market state to a trained historical distribution under warped “price-time” geometry.
It’s particularly useful for spotting early accumulation or exhaustion zones before they become obvious on standard momentum tools.

Recommended use:
Run it as a background trend classifier or color overlay.
Combine it with volume-based confirmation tools (e.g., Dollar Volume Ownership Gauge) and structural analysis.
A “flip to green” suggests buyers are regaining control; a fade or flip to red implies control returning to sellers.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.