Attachments forums

Re: Something interesting please post here (Metatrader)

ionone, Thu Mar 26, 2026 8:38 pm

This indicator looks really awesome (statistical-wise)
https://www.tradingview.com/script/DGGZ ... NN-Engine/

Code: Select all

[i]
Chrono-Decay [KNN Engine]

1. What the Script Does

The Chrono-Decay Engine is an advanced "Time-Based" diagnostic tool designed to measure the temporal health of a trend. Rather than focusing on price magnitude or volume, it specifically analyzes Stagnation—measuring exactly how long it takes for a market to produce new highs or lows relative to historical institutional entry points.

Furthermore, it introduces a built-in K-Nearest Neighbors (KNN) Machine Learning Algorithm to calculate the statistical probability of a trend dying of "old age" based on historical market data.

By tracking 24 simultaneous time-horizons, this engine mathematically flags leading divergences—identifying the exact moment a trend begins to run out of "Time-Fuel" even if price is still grinding higher.

2. The Core Innovation: How it Calculates Everything

Standard time-based indicators (like the Aroon oscillator) rely on fixed lookback periods (e.g., 25 bars). This forces the indicator to constantly drop relevant historical data. This script is fundamentally original because it abandons fixed lookbacks in favor of Anomaly Anchoring, Derivative Calculus (
D
D/DX
$), and Predictive Classification.

Anomaly Anchoring: The engine constantly scans volume for statistical deviations. When it detects a volume spike exceeding a 2.5 Z-Score, it drops a mathematical "Anchor." It tracks the last 24 of these institutional liquidity events simultaneously.

The 24-Vector Matrix: From each of the 24 anchor points, the script calculates an independent, expanding Aroon oscillator (measuring the percentage of time since the highest high or lowest low for that specific anchor).

The Chrono-Derivative (
D
D/DX
$): The script calculates the average of these 24 time-cycles to find the "Meta-Mean." Crucially, it then calculates the First Derivative (Rate of Change) of this mean, standardizing it into a Z-Score. This maps the exact velocity of the trend's time-dominance.

The K-Nearest Neighbors (KNN) Engine: When the script detects 100% Temporal Consensus (e.g., all 24 cycles are decaying or expanding simultaneously), it captures the exact numerical fingerprint of the market (Decay Velocity, Decay Acceleration, and Price Velocity). The KNN engine calculates the Euclidean Distance between the current fingerprint and the last 300 historical fingerprints. It finds the 5 nearest neighbors (the 5 times history looked mathematically identical) and checks their win/loss results to generate a live probability score.

3. Justifying the Methodology

Why combine 24 anchored Aroon derivatives with a KNN machine learning model? Because trends often die of stagnation before they die of momentum loss.

If price is grinding to new highs, but it is taking progressively longer and longer to reach those highs relative to the last 24 institutional entry points, the trend is decaying. Standard momentum oscillators miss this entirely. By anchoring 24 separate cycles and calculating their derivative, we map the exact speed of this decay. Passing that data through a KNN algorithm allows us to filter out chop by asking the data: "The last 5 times the trend stagnated at this exact velocity, did price successfully reverse by at least 0.1%?"

4. How to Use the Indicator

Visual Layout:

The Signal Histogram: Represents the standardized velocity of the trend's time-dominance.

Blue (Bullish Structure) / Red (Bearish Structure): The base color represents the direction of the trend's temporal gravity.

Bright vs. Dark: Bright bars indicate that the trend is actively expanding its time-dominance. Dark, highly transparent bars indicate the trend is stagnating and decaying back toward equilibrium.

Chrono-Decay Velocity (White Line): The raw, smoothed derivative mapping the physical acceleration of the decay.

The Structural Fan (Ribbons): 24 individual time-decay cycles. These are dynamically capped in height relative to the histogram to prevent visual clutter while showing the internal agreement of the institutional cluster.

Tactical Trade Execution:

Spot the Leading Divergence: Watch for price to make a new high, but for the Signal Histogram to turn dark and crash toward the Zero Line. This indicates the trend is rapidly taking too long to maintain its trajectory. Do not enter yet.

Wait for the Machine Learning Confirmation: Wait for the background to flash Lime (Bullish Potential) or Red (Bearish Potential) with a printed percentage (e.g., 80%). This means the KNN algorithm has verified that identical historical stagnation setups successfully reversed price.

The Trigger: Look for the Exhaustion Star (✧) on the Chrono-Decay Velocity line, or wait for the white line to roll over and re-envelop the histogram cluster. This confirms the mechanical transition from "Stagnation" into an active mean-reversion pull.[/i]

but i'm not sure how to use it lol

Jeff
All files in topic