INVITE-ONLY SCRIPT

eFkolos Tech Indicator

23
Machine learning-enhanced SuperTrend indicator that uses k-means clustering to adaptively optimize SuperTrend parameters based on historical performance. Let me break down what makes this unique:
Key Innovation
Instead of using a single fixed SuperTrend factor, this indicator:

Calculates multiple SuperTrends simultaneously (with factors from 1 to 5 by default, stepped at 0.5)
Tracks performance of each variant using exponential smoothing
Clusters them into 3 groups (Best/Average/Worst) using k-means algorithm
Adapts by selecting the average factor from your chosen cluster

Clever Technical Aspects
Performance Metric: Uses a smart approach where performance = EMA of (price_change × signal_direction), giving positive values when the SuperTrend correctly predicts direction.
K-means Implementation: Properly initializes centroids using quartiles and iterates until convergence - this is solid unsupervised learning.
Adaptive MA Layer: The perf_ama that adapts faster when the performance index is high (more confidence) and slower when low.
Memory Management: Uses UDTs (User Defined Types) efficiently with arrays to handle multiple SuperTrend instances.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.