Alım-satım robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Twitter üzerinde bulun!
Fan sayfamıza katılın
Kodu ilginç mi buldunuz?
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
Kodu beğendiniz mi? MetaTrader 5 terminalinde deneyin
Göstergeler

Adaptive SuperTrend K-Means - MetaTrader 5 için gösterge

AlgoAlpha
Yayınlayan:
Thanh Trung Tran
Görüntülemeler:
123
Derecelendirme:
(1)
Yayınlandı:
Güncellendi:
MQL5 Freelance Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git

Adaptive SuperTrend KMeans is a MetaTrader 5 port of the open-source TradingView indicator "Machine Learning Adaptive SuperTrend" by AlgoAlpha (Mozilla Public License 2.0). All credit for the idea and the original code goes to AlgoAlpha.

At a glance

  • What it is: a SuperTrend whose band width adapts to the current volatility level
  • Volatility levels: K-means sorts recent ATR values into high, medium and low clusters
  • Faithful port: same math and the same defaults as the original Pine Script code
  • No repainting: arrows and cluster numbers are drawn only on closed bars
  • Price: free and open source

How it works

  1. Volatility: ATR with Wilder's smoothing, exactly like TradingView's ta.atr.
  2. Clusters: K-means groups the last 100 ATR values into high, medium and low volatility (strict assignment, as in the original).
  3. Band: the SuperTrend uses (high + low) / 2 plus or minus factor x the centroid of the current cluster, so the band widens in volatile markets and tightens in quiet ones.


On the chart

  • Trend line that breaks when the trend flips (green up, red down)
  • Gradient fill between the line and the candles, drawn with native MetaTrader 5 fills (fast, no chart objects)
  • Arrows at each trend flip, cluster numbers 3 / 2 / 1 on recent bars
  • Statistics table: cluster centroids, cluster sizes and the current volatility level. Click its title to fold it; put it in any corner; its colors follow your chart, dark or light.

Made for MetaTrader 5

  • Alerts on a trend shift and/or a change of volatility level: popup, sound only, push notification to the MetaTrader 5 mobile app, or e-mail. Once per bar, on the closed bar.
  • Tested bar by bar against an independent reference calculation on gold H1 and M15 and on EURUSD M5 and H4: every value matches, and no value changes after its bar has closed.
  • Readable numbers on any symbol: values below 1 show all price digits (the original rounds to 2 decimals).

Parameters (defaults = original)

  • ATR Length 10, SuperTrend Factor 3.0
  • Training Data Length 100; initial high / medium / low percentile guesses 0.75 / 0.5 / 0.25
  • Transparency 70 (near the line) and 95 (near the candle); bullish and bearish colors
  • Chart options: bars to calculate, closed-bar-only signals, line width, fill, arrows, cluster numbers, table position, alerts


For EA developers (iCustom): buffers 0 = up trend line, 1 = down trend line, 2 = bullish flip, 3 = bearish flip, 4 = SuperTrend, 5 = direction (-1 up, +1 down, as in Pine), 6 = cluster (0 high, 1 medium, 2 low), 7 = centroid used for the band, 8 = ATR. EMPTY_VALUE means no value. Simplest call with the default inputs: iCustom(_Symbol, _Period, "Adaptive_SuperTrend_KMeans") . If you pass inputs, each input group heading counts as one parameter (pass an empty string for it); set Draw_Objects = false when an EA calls it.

Values match TradingView when both use the same price feed. Different brokers give slightly different ATR values.

Source code and license: free and open source under the Mozilla Public License 2.0 (MPL-2.0), the same as the original.

This is a visual tool. It does not place trades and does not predict prices. Test any rule built on it before you trade with it.

Tester vs Live Trade Matcher Tester vs Live Trade Matcher

A free, read-only MetaTrader 5 utility: it reads a Strategy Tester report (MT5 or MT4 .htm) and matches every backtest trade with your account history or with a second report. It shows the match rate, missed and extra trades, slippage, delay, real costs and how much of the backtest edge survives live.

Range Filter Buy and Sell Range Filter Buy and Sell

A faithful MetaTrader 5 port of the TradingView "Range Filter Buy and Sell 5min" (DonovanWall / guikroth / tvenn): range filter line, target bands, Buy/Sell arrows and bar colors, no repainting, alerts (popup, sound, push, e-mail) and a signal statistics panel.

RSI Top and Bottom Scalper RSI Top and Bottom Scalper

RSI Top and Bottom Scalper is an MT5 indicator designed to identify potential reversal entries using RSI top and bottom retests together with price confirmation

MTF Trend Dashboard — trend, position and volatility on six timeframes at a glance MTF Trend Dashboard — trend, position and volatility on six timeframes at a glance

One on-chart table for M15, H1, H4, D1, W1 and MN1: EMA slope, price vs EMA, Donchian position, ATR percentile and a combined UP / DOWN / RANGE regime. Completed bars only. Any symbol.