SuperTrend

SuperTrend is a free indicator by DinexSpace for MT5 and TradingView. A trend line built from an ATR band around price: below price in an uptrend, above it in a downtrend. The signal version (v2) adds buy/sell arrows on closed bars with suggested SL and TP levels.

What SuperTrend does

SuperTrend is a free indicator by DinexSpace for MT5 and TradingView. A trend line built from an ATR band around price: below price in an uptrend, above it in a downtrend. The signal version (v2) adds buy/sell arrows on closed bars with suggested SL and TP levels.

Enable JavaScript to see the chart.

Chart powered by TradingView Lightweight Charts™ (Apache-2.0 license). tradingview.com

The candles, indicator lines and arrows above come straight from the MT5 version running in the Strategy Tester; nothing is recalculated in the browser. Press ▶ to replay bar by bar and hover an arrow to see the reason, entry, SL and TP.

Video walkthrough

A SuperTrend line built from an ATR band around the median price. It sits below price in an uptrend, above price in a downtrend, and flips when a bar closes through it.

When to use it

Use it to follow the trend and trail your stop.

Features and modes

A SuperTrend line built from an ATR band around the median price: below price in an uptrend, above price in a downtrend, flipping when a bar closes through it.

Parameters

SuperTrend has 50 inputs in the MT5 version and 24 in the TradingView version; every input and its default is listed below.

SuperTrend inputs
GroupInputDefaultMeaning
SuperTrendInpATRPeriod10ATR period
SuperTrendInpMultiplier3.0ATR multiplier
SuperTrendInpRMAtrueATR smoothing: true = Wilder (RMA), false = simple average
SignalsInpSigArrowstrueDraw buy/sell arrows (closed bars only)
SignalsInpSigLabelstrueShort reason label next to each arrow
SignalsInpSigLevelsfalseDraw entry / SL / TP lines for each signal
SignalsInpSigSLATR1.5Suggested SL = ATR × this value
SignalsInpSigRR2.0Suggested TP = SL distance × this value (reward:risk)
SignalsInpSigATRLen14ATR period (used for SL/TP and the volatility filter)
SignalsInpSigLevelBars10Length of the entry/SL/TP lines, in bars
SignalsInpSigObjBars1500Labels and lines only for signals in the last N bars
Confluence (score x/7, a signal shows when score >= minimum)InpConfMin4Minimum confluence score 0–7 for a signal to show (0 = every raw signal)
Confluence (score x/7, a signal shows when score >= minimum)InpCfMTFtrueFactor 1, trend: close above (buy) / below (sell) the EMA of the trend timeframe
Confluence (score x/7, a signal shows when score >= minimum)InpCfMTFTFPERIOD_H4Trend timeframe (closed bars only)
Confluence (score x/7, a signal shows when score >= minimum)InpCfMTFLen200Trend EMA period
Confluence (score x/7, a signal shows when score >= minimum)InpCfMomtrueFactor 2, momentum: RSI(14) above 50 (buy) / below 50 (sell)
Confluence (score x/7, a signal shows when score >= minimum)InpCfVolattrueFactor 3, volatility: ATR percentile over 100 bars between 20 and 90
Confluence (score x/7, a signal shows when score >= minimum)InpCfRVoltrueFactor 4, volume: tick volume at or above its same-hour average of 20 days
Confluence (score x/7, a signal shows when score >= minimum)InpCfSessiontrueFactor 5, session: signal bar inside the session hours (server time)
Confluence (score x/7, a signal shows when score >= minimum)InpCfHourFrom7Session start hour (0–23)
Confluence (score x/7, a signal shows when score >= minimum)InpCfHourTo21Session end hour (0–23, exclusive; may wrap past midnight)
Confluence (score x/7, a signal shows when score >= minimum)InpCfNewstrueFactor 6, news: no high-impact MT5 calendar event around the signal bar
Confluence (score x/7, a signal shows when score >= minimum)InpCfNewsMin30News window, minutes before and after
Confluence (score x/7, a signal shows when score >= minimum)InpCfSpreadtrueFactor 7, spread: spread at most 1.5 × the 100-bar median
Confluence (score x/7, a signal shows when score >= minimum)InpFltGapBars0Minimum bars between two signals (0 = off)
Win rate (history of the signal's group)InpMinWin51Highlight signals whose group win rate is at least this %
Win rate (history of the signal's group)InpHideWeakfalseHide signals below that rate (off = drawn faint)
Win rate (history of the signal's group)InpShowBEfalsePanel: show the break-even win rate of the R:R in use
Bar odds (every closed bar as a hypothetical trade, design-period history)InpPbModeDNX_ODDS_BOTHBar odds: both sides / stronger side only / off
Bar odds (every closed bar as a hypothetical trade, design-period history)InpPbBars150Bars with odds (0 = all bars, slower)
Bar odds (every closed bar as a hypothetical trade, design-period history)InpPbSLATR1.5Bar odds: SL = TP distance = ATR × this
Bar odds (every closed bar as a hypothetical trade, design-period history)InpPbRR1.0Bar odds: TP distance = SL distance × this
Bar odds (every closed bar as a hypothetical trade, design-period history)InpPbD1-5Colour: red below break-even + this (points of %)
Bar odds (every closed bar as a hypothetical trade, design-period history)InpPbD20Colour: orange below break-even + this
Bar odds (every closed bar as a hypothetical trade, design-period history)InpPbD35Colour: yellow below break-even + this
Bar odds (every closed bar as a hypothetical trade, design-period history)InpPbD410Colour: green below break-even + this, the chart's up-candle colour above
Bar odds (every closed bar as a hypothetical trade, design-period history)InpPbFont7Bar odds font size
Alerts (once per closed signal bar)InpAlPopupfalsePopup alert
Alerts (once per closed signal bar)InpAlPushfalsePush notification to your phone (Tools → Options → Notifications)
Alerts (once per closed signal bar)InpAlMailfalseEmail (Tools → Options → Email)
Alerts (once per closed signal bar)InpAlSoundfalseSound
Alerts (once per closed signal bar)InpAlSoundFile"alert.wav"Sound file (MT5 Sounds folder)
PanelInpPaneltrueShow the last-signal panel
PanelInpPanelCornerCORNER_LEFT_UPPERPanel corner
PanelInpPanelX10Panel horizontal offset, px
PanelInpPanelY25Panel vertical offset, px
PanelInpPanelFont9Panel font size

Signals

SuperTrend gives a Buy signal when the bar that just closed flips the SuperTrend line from above price to below price (label "ST flipped up") and a Sell signal when the bar that just closed flips the line from below price to above price (label "ST flipped down"). It does not repaint: signals are confirmed only on bar close.

  • Buy ▲: the bar that just closed flips the SuperTrend line from above price to below price (label "ST flipped up").
  • Sell ▼: the bar that just closed flips the line from below price to above price (label "ST flipped down").
  • Only on a closed bar. The bar that is still forming never carries an arrow, so a signal, once drawn, does not move or disappear (no repainting).
  • The arrow sits on the signal bar. If you act on it, the entry is the open of the next bar.
  • Each arrow has a short reason label. Optional lines show the entry (close of the signal bar), a suggested SL (ATR(14) × 1.5) and a suggested TP (2R).
  • Confluence: every signal gets a 0–7 score (higher-timeframe trend, momentum, volatility, volume, session, news, spread); by default only signals scoring 4/7 or more are shown (MT5 version).
  • Bar odds (MT5 version): ▲ buy % under and ▼ sell % over each bar, every bar treated as a hypothetical 1:1 trade, coloured against the real break-even (spread included); numbers exist only for XAUUSD H1 at default inputs, elsewhere "–".
  • MT5 alerts (popup, push, email, sound; each one switchable) fire once per signal bar. The Pine version has an alertcondition for Buy and one for Sell.
  • A small corner panel shows the last signal, its price, SL, TP, time and how many bars ago it fired.

Suggested SL = ATR(14) × 1.5; suggested TP = 2 × the SL distance (1:2 risk-reward). The trend, volatility, session and signal-spacing filters are all off by default.

Chart labels and the info panel default to Vietnamese; set InpSigLang to English in the inputs.

Alerts

Yes. SuperTrend has built-in alerts: MT5 – pop-up, push notification, email, sound; TradingView – alert conditions for Create Alert.

Buffers for Expert Advisors

Yes. The MT5 version of SuperTrend exposes its plots as indicator buffers that an EA can read with iCustom and CopyBuffer: SuperTrend, Buy, Sell, Signal SL, Signal TP, Signal entry, Signal filter, Confluence score, Win rate %, Sample size, Bar buy odds %, Bar buy samples, Bar sell odds %, Bar sell samples, Lean, Bar buy score, Bar sell score.

SuperTrend – Buffers for Expert Advisors
BufferContent
0Buy: anything other than EMPTY_VALUE means a buy signal on that bar (the value is where the arrow is drawn)
1Sell: anything other than EMPTY_VALUE means a sell signal on that bar
2Suggested SL (price)
3Suggested TP (price)
4Entry: close of the signal bar
5Filter: 1 = do not trade / stop trading, 0 = allowed
6Confluence score 0–7 on the signal bar
7Win rate % of the signal's group (design period)
8Sample size of that group (EMPTY under 30)
9 / 11Buy % / sell % of the bar (hypothetical 1:1 trade)
10 / 12Samples behind the buy % / sell %
13Lean: +1 / −1 = side of the latest raw signal
14 / 15Confluence score of the buy / sell side on that bar
16SuperTrend line
17Line colour (0 up, 1 down)

Read shift 1 (the bar that just closed) when a new bar opens. Every input group takes one parameter slot in iCustom; calling it with no parameters uses the defaults.

int h = iCustom(_Symbol, _Period, "DinexSuperTrendSig");
double buy[1], sell[1], sl[1], tp[1];
CopyBuffer(h, 0, 1, 1, buy); CopyBuffer(h, 1, 1, 1, sell);
CopyBuffer(h, 2, 1, 1, sl);  CopyBuffer(h, 3, 1, 1, tp);
if(buy[0] != EMPTY_VALUE) { /* buy, SL = sl[0], TP = tp[0] */ }

Pine: hidden plots Buy signal, Sell signal (1/0), Signal SL, Signal TP, Signal entry (Data Window), for strategies or webhooks.

Timeframes and markets

SuperTrend runs on any chart timeframe. Its calculation reads the chart timeframe or a fixed timeframe (for example D1 or a higher timeframe), as described under Features.

Limitations

SuperTrend is an analysis tool, not a trading system. Its documented limitations are listed below.

  • SL/TP are ATR-based suggestions only; they ignore spread, fees, slippage and news.

Technical signals, not pre-registered/validated; not investment advice.

Pine Script code

Paste the whole script into the Pine Editor on TradingView.

DinexSuperTrendSig.pine · 1,117 lines
//@version=6
// DinexSpace | SuperTrend Signals v2.0 (2026-11-14)
// ATR band trend line around the median price. Buy arrow when a closed bar flips the line up, sell arrow when it
// flips down. Signals only on confirmed bars (no repaint). Suggested SL = ATR x 1.5, TP = 2R.
// Open source. License: MIT. (c) 2026 DinexSpace
indicator("DinexSpace | SuperTrend Signals", shorttitle = "DNX ST", overlay = true, max_labels_count = 500, max_lines_count = 500)

const string DNX_NAME = "SuperTrend"
grpI = "SuperTrend"
stLen  = input.int(10, "ATR period", minval = 1, group = grpI)
stMult = input.float(3.0, "ATR multiplier", minval = 0.1, step = 0.1, group = grpI)
stRma  = input.bool(true, "ATR smoothing: Wilder (RMA); off = simple average", group = grpI)
// ---- DinexSpace signal layer v2.1 (2026-11-17, GII code + GII filter): inputs ----
grpS = "Signals"
sigArrows = input.bool(true, "Buy/sell arrows (closed bars only)", group = grpS)
sigLabels = input.bool(true, "Short reason label next to each arrow", group = grpS)
sigLevels = input.bool(false, "Entry / SL / TP lines for each signal", group = grpS)
sigSlAtr  = input.float(1.5, "Suggested SL = ATR x", minval = 0.1, step = 0.1, group = grpS)
sigRR     = input.float(2.0, "Suggested TP = SL distance x (reward:risk)", minval = 0.1, step = 0.1, group = grpS)
sigAtrLen = input.int(14, "ATR period (SL/TP and volatility filter)", minval = 1, group = grpS)
sigLvlLen = input.int(10, "Length of the entry/SL/TP lines, bars", minval = 1, group = grpS)
grpF = "Filters (all off by default)"
fltTrend   = input.bool(false, "Trend filter: buy only above the EMA, sell only below", group = grpF)
fltTrendLn = input.int(200, "Trend EMA period", minval = 1, group = grpF)
fltTrendTf = input.timeframe("", "Trend EMA timeframe (empty = chart)", group = grpF)
fltAtr     = input.bool(false, "Volatility filter: skip signals when ATR is too small", group = grpF)
fltAtrMin  = input.float(0.0, "Minimum ATR, in price units", minval = 0, group = grpF)
fltSes     = input.bool(false, "Session filter", group = grpF)
fltSesion  = input.session("0800-2000", "Session (exchange time zone)", group = grpF)
fltGap     = input.int(0, "Minimum bars between two signals (0 = off)", minval = 0, group = grpF)
grpP = "Panel"
pnlShow = input.bool(true, "Show the last-signal panel", group = grpP)
pnlPos  = input.string("top_right", "Panel position", options = ["top_left", "top_right", "bottom_left", "bottom_right"], group = grpP)
grpG = "GII (DinexSpace gold index; reference, not validated)"
giiShow   = input.bool(true, "GII rows in the panel (gold charts only)", group = grpG)
giiCode   = input.string("", "GII code (copy today's code from the DinexSpace GII page)", group = grpG)
giiFilter = input.bool(false, "Keep only signals on the GII side (buy: zone >= +1, sell: zone <= -1)", group = grpG)
giiMaxAge = input.int(4, "GII older than this many days is stale: the filter then ignores it", minval = 1, group = grpG)
// ---- end of signal inputs ----

stAtr = stRma ? ta.rma(ta.tr(true), stLen) : ta.sma(ta.tr(true), stLen)
mid = hl2
up = mid - stMult * stAtr
dn = mid + stMult * stAtr
var float stLine = na
var int stDir = 1
prevLine = stLine
prevDir = stDir
if na(prevLine)
    stLine := stDir > 0 ? up : dn
else if stDir > 0
    ln = math.max(up, prevLine)
    if close < ln
        stDir := -1
        ln := dn
    stLine := ln
else
    ln = math.min(dn, prevLine)
    if close > ln
        stDir := 1
        ln := up
    stLine := ln
plot(stLine, "SuperTrend", stDir > 0 ? color.new(#1E90FF, 0) : color.new(#FF4500, 0), 2)

flip = not na(prevLine) and stDir != prevDir
rawBuy = flip and stDir > 0
rawSell = flip and stDir < 0
whyBuy ="ST flipped up"
whySell ="ST flipped down"
// ---- DinexSpace signal layer v2.1 (2026-11-17, GII code + GII filter) ----
// Needs, defined above: rawBuy, rawSell (bool), whyBuy, whySell (string), const string DNX_NAME.
// A signal is kept only on a confirmed (closed) bar, so it is never redrawn. The higher timeframe EMA
// uses the previous closed higher bar (lookahead on + [1]), which does not repaint either.
sigAtr  = ta.atr(sigAtrLen)
// Match context.py's ATR14 seed: running mean through bar 13, then Wilder smoothing.
arrowTr = bar_index == 0 ? high - low : math.max(high, close[1]) - math.min(low, close[1])
var float arrowAtr = na
arrowAtr := bar_index < 14 ? (nz(arrowAtr[1]) * bar_index + arrowTr) / (bar_index + 1) : (arrowAtr[1] * 13 + arrowTr) / 14
emaChart = ta.ema(close, fltTrendLn)
emaHtf   = request.security(syminfo.tickerid, fltTrendTf, ta.ema(close, fltTrendLn)[1], lookahead = barmerge.lookahead_on)
arrowEmaH4Prev = request.security(syminfo.tickerid, "240", ta.ema(close, 200)[1], lookahead = barmerge.lookahead_on)
arrowEmaH4Current = request.security(syminfo.tickerid, "240", ta.ema(close, 200), lookahead = barmerge.lookahead_off)
// At an H4 boundary the signal bar has closed that H4 bar, so use its finished EMA.
arrowEmaH4 = timeframe.in_seconds() < 14400 and time_close != time_close("240") ? arrowEmaH4Prev : arrowEmaH4Current
DNX_ARROW_ALL = false   // true: one rate for every market (context table not better)
// Measured selected-context rate. Pine can check only these three signal inputs:
// sigSlAtr=1.5, sigRR=2.0, sigAtrLen=14; other defaults cannot be verified.
// ATR rank counts strictly lower values among 100 bars including the signal bar.
// Session hour in UTC: the MT5 server of the measurement runs on UTC without DST (gold reopens Sun 23:00 winter / 22:00 summer).
dnxArrowRate(int dir, int offset) =>
    float rate = na
    int n = na
    if sigSlAtr == 1.5 and sigRR == 2.0 and sigAtrLen == 14
        string ticker = str.upper(syminfo.ticker)
        if str.startswith(ticker, "AUDUSD") and timeframe.period == "D" and dir == 1
            rate := 51
            n := 49
        else if str.startswith(ticker, "AUDUSD") and timeframe.period == "D" and dir == -1
            rate := 46
            n := 49
        else if str.startswith(ticker, "AUDUSD") and timeframe.period == "60" and dir == 1
            rate := 49
            n := 963
        else if str.startswith(ticker, "AUDUSD") and timeframe.period == "60" and dir == -1
            rate := 52
            n := 972
        else if str.startswith(ticker, "AUDUSD") and timeframe.period == "240" and dir == 1
            rate := 49
            n := 257
        else if str.startswith(ticker, "AUDUSD") and timeframe.period == "240" and dir == -1
            rate := 53
            n := 261
        else if str.startswith(ticker, "AUDUSD") and timeframe.period == "15" and dir == 1
            rate := 49
            n := 326
        else if str.startswith(ticker, "AUDUSD") and timeframe.period == "15" and dir == -1
            rate := 42
            n := 333
        else if str.startswith(ticker, "AUS200") and timeframe.period == "D" and dir == 1
            rate := 58
            n := 65
        else if str.startswith(ticker, "ASX200") and timeframe.period == "D" and dir == 1
            rate := 58
            n := 65
        else if str.startswith(ticker, "AUS200") and timeframe.period == "D" and dir == -1
            rate := 49
            n := 65
        else if str.startswith(ticker, "ASX200") and timeframe.period == "D" and dir == -1
            rate := 49
            n := 65
        else if str.startswith(ticker, "AUS200") and timeframe.period == "60" and dir == 1
            rate := 48
            n := 298
        else if str.startswith(ticker, "ASX200") and timeframe.period == "60" and dir == 1
            rate := 48
            n := 298
        else if str.startswith(ticker, "AUS200") and timeframe.period == "60" and dir == -1
            rate := 47
            n := 282
        else if str.startswith(ticker, "ASX200") and timeframe.period == "60" and dir == -1
            rate := 47
            n := 282
        else if str.startswith(ticker, "AUS200") and timeframe.period == "240" and dir == 1
            rate := 53
            n := 147
        else if str.startswith(ticker, "ASX200") and timeframe.period == "240" and dir == 1
            rate := 53
            n := 147
        else if str.startswith(ticker, "AUS200") and timeframe.period == "240" and dir == -1
            rate := 41
            n := 143
        else if str.startswith(ticker, "ASX200") and timeframe.period == "240" and dir == -1
            rate := 41
            n := 143
        else if str.startswith(ticker, "AUS200") and timeframe.period == "15" and dir == 1
            rate := 49
            n := 640
        else if str.startswith(ticker, "ASX200") and timeframe.period == "15" and dir == 1
            rate := 49
            n := 640
        else if str.startswith(ticker, "AUS200") and timeframe.period == "15" and dir == -1
            rate := 44
            n := 610
        else if str.startswith(ticker, "ASX200") and timeframe.period == "15" and dir == -1
            rate := 44
            n := 610
        else if str.startswith(ticker, "BNBUSD") and timeframe.period == "60" and dir == 1
            rate := 50
            n := 550
        else if str.startswith(ticker, "BNBUSD") and timeframe.period == "60" and dir == -1
            rate := 46
            n := 551
        else if str.startswith(ticker, "BNBUSD") and timeframe.period == "240" and dir == 1
            rate := 54
            n := 143
        else if str.startswith(ticker, "BNBUSD") and timeframe.period == "240" and dir == -1
            rate := 52
            n := 150
        else if str.startswith(ticker, "BTCUSD") and timeframe.period == "60" and dir == 1
            rate := 47
            n := 129
        else if str.startswith(ticker, "BTCUSD") and timeframe.period == "60" and dir == -1
            rate := 42
            n := 128
        else if str.startswith(ticker, "BTCUSD") and timeframe.period == "240" and dir == 1
            rate := 48
            n := 35
        else if str.startswith(ticker, "BTCUSD") and timeframe.period == "240" and dir == -1
            rate := 42
            n := 35
        else if str.startswith(ticker, "ETHUSD") and timeframe.period == "60" and dir == 1
            rate := 48
            n := 131
        else if str.startswith(ticker, "ETHUSD") and timeframe.period == "60" and dir == -1
            rate := 48
            n := 133
        else if str.startswith(ticker, "ETHUSD") and timeframe.period == "240" and dir == 1
            rate := 45
            n := 37
        else if str.startswith(ticker, "ETHUSD") and timeframe.period == "240" and dir == -1
            rate := 47
            n := 36
        else if str.startswith(ticker, "EURUSD") and timeframe.period == "D" and dir == 1
            rate := 42
            n := 54
        else if str.startswith(ticker, "EURUSD") and timeframe.period == "D" and dir == -1
            rate := 51
            n := 54
        else if str.startswith(ticker, "EURUSD") and timeframe.period == "60" and dir == 1
            rate := 51
            n := 983
        else if str.startswith(ticker, "EURUSD") and timeframe.period == "60" and dir == -1
            rate := 51
            n := 1003
        else if str.startswith(ticker, "EURUSD") and timeframe.period == "240" and dir == 1
            rate := 48
            n := 282
        else if str.startswith(ticker, "EURUSD") and timeframe.period == "240" and dir == -1
            rate := 49
            n := 273
        else if str.startswith(ticker, "EURUSD") and timeframe.period == "15" and dir == 1
            rate := 53
            n := 335
        else if str.startswith(ticker, "EURUSD") and timeframe.period == "15" and dir == -1
            rate := 33
            n := 332
        else if str.startswith(ticker, "GBPUSD") and timeframe.period == "D" and dir == 1
            rate := 42
            n := 61
        else if str.startswith(ticker, "GBPUSD") and timeframe.period == "D" and dir == -1
            rate := 53
            n := 62
        else if str.startswith(ticker, "GBPUSD") and timeframe.period == "60" and dir == 1
            rate := 49
            n := 1007
        else if str.startswith(ticker, "GBPUSD") and timeframe.period == "60" and dir == -1
            rate := 50
            n := 1012
        else if str.startswith(ticker, "GBPUSD") and timeframe.period == "240" and dir == 1
            rate := 49
            n := 281
        else if str.startswith(ticker, "GBPUSD") and timeframe.period == "240" and dir == -1
            rate := 48
            n := 276
        else if str.startswith(ticker, "GBPUSD") and timeframe.period == "15" and dir == 1
            rate := 50
            n := 338
        else if str.startswith(ticker, "GBPUSD") and timeframe.period == "15" and dir == -1
            rate := 41
            n := 325
        else if str.startswith(ticker, "NAS100") and timeframe.period == "D" and dir == 1
            rate := 59
            n := 74
        else if str.startswith(ticker, "NAS100") and timeframe.period == "D" and dir == -1
            rate := 42
            n := 75
        else if str.startswith(ticker, "NAS100") and timeframe.period == "60" and dir == 1
            rate := 52
            n := 597
        else if str.startswith(ticker, "NAS100") and timeframe.period == "60" and dir == -1
            rate := 48
            n := 599
        else if str.startswith(ticker, "NAS100") and timeframe.period == "240" and dir == 1
            rate := 58
            n := 217
        else if str.startswith(ticker, "NAS100") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 214
        else if str.startswith(ticker, "NAS100") and timeframe.period == "15" and dir == 1
            rate := 46
            n := 414
        else if str.startswith(ticker, "NAS100") and timeframe.period == "15" and dir == -1
            rate := 47
            n := 410
        else if str.startswith(ticker, "NZDUSD") and timeframe.period == "D" and dir == 1
            rate := 59
            n := 54
        else if str.startswith(ticker, "NZDUSD") and timeframe.period == "D" and dir == -1
            rate := 52
            n := 55
        else if str.startswith(ticker, "NZDUSD") and timeframe.period == "60" and dir == 1
            rate := 51
            n := 946
        else if str.startswith(ticker, "NZDUSD") and timeframe.period == "60" and dir == -1
            rate := 50
            n := 950
        else if str.startswith(ticker, "NZDUSD") and timeframe.period == "240" and dir == 1
            rate := 49
            n := 260
        else if str.startswith(ticker, "NZDUSD") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 260
        else if str.startswith(ticker, "NZDUSD") and timeframe.period == "15" and dir == 1
            rate := 42
            n := 340
        else if str.startswith(ticker, "NZDUSD") and timeframe.period == "15" and dir == -1
            rate := 34
            n := 339
        else if str.startswith(ticker, "SOLUSD") and timeframe.period == "60" and dir == 1
            rate := 49
            n := 125
        else if str.startswith(ticker, "SOLUSD") and timeframe.period == "60" and dir == -1
            rate := 52
            n := 131
        else if str.startswith(ticker, "SOLUSD") and timeframe.period == "240" and dir == 1
            rate := 50
            n := 34
        else if str.startswith(ticker, "SOLUSD") and timeframe.period == "240" and dir == -1
            rate := 55
            n := 36
        else if str.startswith(ticker, "USDCAD") and timeframe.period == "D" and dir == 1
            rate := 54
            n := 55
        else if str.startswith(ticker, "USDCAD") and timeframe.period == "D" and dir == -1
            rate := 45
            n := 55
        else if str.startswith(ticker, "USDCAD") and timeframe.period == "60" and dir == 1
            rate := 48
            n := 1014
        else if str.startswith(ticker, "USDCAD") and timeframe.period == "60" and dir == -1
            rate := 46
            n := 1016
        else if str.startswith(ticker, "USDCAD") and timeframe.period == "240" and dir == 1
            rate := 53
            n := 261
        else if str.startswith(ticker, "USDCAD") and timeframe.period == "240" and dir == -1
            rate := 51
            n := 258
        else if str.startswith(ticker, "USDCAD") and timeframe.period == "15" and dir == 1
            rate := 44
            n := 348
        else if str.startswith(ticker, "USDCAD") and timeframe.period == "15" and dir == -1
            rate := 38
            n := 345
        else if str.startswith(ticker, "USDCHF") and timeframe.period == "D" and dir == 1
            rate := 56
            n := 60
        else if str.startswith(ticker, "USDCHF") and timeframe.period == "D" and dir == -1
            rate := 57
            n := 61
        else if str.startswith(ticker, "USDCHF") and timeframe.period == "60" and dir == 1
            rate := 48
            n := 966
        else if str.startswith(ticker, "USDCHF") and timeframe.period == "60" and dir == -1
            rate := 46
            n := 963
        else if str.startswith(ticker, "USDCHF") and timeframe.period == "240" and dir == 1
            rate := 48
            n := 246
        else if str.startswith(ticker, "USDCHF") and timeframe.period == "240" and dir == -1
            rate := 56
            n := 246
        else if str.startswith(ticker, "USDCHF") and timeframe.period == "15" and dir == 1
            rate := 39
            n := 357
        else if str.startswith(ticker, "USDCHF") and timeframe.period == "15" and dir == -1
            rate := 34
            n := 358
        else if str.startswith(ticker, "USDJPY") and timeframe.period == "D" and dir == 1
            rate := 43
            n := 57
        else if str.startswith(ticker, "USDJPY") and timeframe.period == "D" and dir == -1
            rate := 56
            n := 55
        else if str.startswith(ticker, "USDJPY") and timeframe.period == "60" and dir == 1
            rate := 48
            n := 947
        else if str.startswith(ticker, "USDJPY") and timeframe.period == "60" and dir == -1
            rate := 48
            n := 960
        else if str.startswith(ticker, "USDJPY") and timeframe.period == "240" and dir == 1
            rate := 54
            n := 274
        else if str.startswith(ticker, "USDJPY") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 270
        else if str.startswith(ticker, "USDJPY") and timeframe.period == "15" and dir == 1
            rate := 45
            n := 345
        else if str.startswith(ticker, "USDJPY") and timeframe.period == "15" and dir == -1
            rate := 43
            n := 324
        else if str.startswith(ticker, "XAGUSD") and timeframe.period == "D" and dir == 1
            rate := 65
            n := 52
        else if str.startswith(ticker, "SILVER") and timeframe.period == "D" and dir == 1
            rate := 65
            n := 52
        else if str.startswith(ticker, "XAGUSD") and timeframe.period == "D" and dir == -1
            rate := 54
            n := 55
        else if str.startswith(ticker, "SILVER") and timeframe.period == "D" and dir == -1
            rate := 54
            n := 55
        else if str.startswith(ticker, "XAGUSD") and timeframe.period == "60" and dir == 1
            rate := 47
            n := 898
        else if str.startswith(ticker, "SILVER") and timeframe.period == "60" and dir == 1
            rate := 47
            n := 898
        else if str.startswith(ticker, "XAGUSD") and timeframe.period == "60" and dir == -1
            rate := 38
            n := 910
        else if str.startswith(ticker, "SILVER") and timeframe.period == "60" and dir == -1
            rate := 38
            n := 910
        else if str.startswith(ticker, "XAGUSD") and timeframe.period == "240" and dir == 1
            rate := 49
            n := 259
        else if str.startswith(ticker, "SILVER") and timeframe.period == "240" and dir == 1
            rate := 49
            n := 259
        else if str.startswith(ticker, "XAGUSD") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 265
        else if str.startswith(ticker, "SILVER") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 265
        else if str.startswith(ticker, "XAGUSD") and timeframe.period == "15" and dir == 1
            rate := 51
            n := 404
        else if str.startswith(ticker, "SILVER") and timeframe.period == "15" and dir == 1
            rate := 51
            n := 404
        else if str.startswith(ticker, "XAGUSD") and timeframe.period == "15" and dir == -1
            rate := 39
            n := 394
        else if str.startswith(ticker, "SILVER") and timeframe.period == "15" and dir == -1
            rate := 39
            n := 394
        else if str.startswith(ticker, "XAUUSD") and timeframe.period == "D" and dir == 1
            rate := 53
            n := 54
        else if str.startswith(ticker, "XAUUSD") and timeframe.period == "D" and dir == -1
            rate := 53
            n := 56
        else if str.startswith(ticker, "XAUUSD") and timeframe.period == "60" and dir == 1
            rate := 50
            n := 966
        else if str.startswith(ticker, "XAUUSD") and timeframe.period == "60" and dir == -1
            rate := 48
            n := 970
        else if str.startswith(ticker, "XAUUSD") and timeframe.period == "240" and dir == 1
            rate := 53
            n := 273
        else if str.startswith(ticker, "XAUUSD") and timeframe.period == "240" and dir == -1
            rate := 50
            n := 273
        else if str.startswith(ticker, "XAUUSD") and timeframe.period == "15" and dir == 1
            rate := 48
            n := 391
        else if str.startswith(ticker, "XAUUSD") and timeframe.period == "15" and dir == -1
            rate := 45
            n := 393
        else if str.startswith(ticker, "GER40") and timeframe.period == "D" and dir == 1
            rate := 56
            n := 85
        else if str.startswith(ticker, "GER40") and timeframe.period == "D" and dir == -1
            rate := 48
            n := 87
        else if str.startswith(ticker, "GER40") and timeframe.period == "60" and dir == 1
            rate := 50
            n := 341
        else if str.startswith(ticker, "GER40") and timeframe.period == "60" and dir == -1
            rate := 49
            n := 346
        else if str.startswith(ticker, "GER40") and timeframe.period == "240" and dir == 1
            rate := 52
            n := 142
        else if str.startswith(ticker, "GER40") and timeframe.period == "240" and dir == -1
            rate := 46
            n := 145
        else if str.startswith(ticker, "GER40") and timeframe.period == "15" and dir == 1
            rate := 50
            n := 545
        else if str.startswith(ticker, "GER40") and timeframe.period == "15" and dir == -1
            rate := 50
            n := 543
        else if str.startswith(ticker, "JP225") and timeframe.period == "D" and dir == 1
            rate := 56
            n := 71
        else if str.startswith(ticker, "NI225") and timeframe.period == "D" and dir == 1
            rate := 56
            n := 71
        else if str.startswith(ticker, "JP225") and timeframe.period == "D" and dir == -1
            rate := 47
            n := 74
        else if str.startswith(ticker, "NI225") and timeframe.period == "D" and dir == -1
            rate := 47
            n := 74
        else if str.startswith(ticker, "JP225") and timeframe.period == "60" and dir == 1
            rate := 55
            n := 300
        else if str.startswith(ticker, "NI225") and timeframe.period == "60" and dir == 1
            rate := 55
            n := 300
        else if str.startswith(ticker, "JP225") and timeframe.period == "60" and dir == -1
            rate := 45
            n := 298
        else if str.startswith(ticker, "NI225") and timeframe.period == "60" and dir == -1
            rate := 45
            n := 298
        else if str.startswith(ticker, "JP225") and timeframe.period == "240" and dir == 1
            rate := 54
            n := 124
        else if str.startswith(ticker, "NI225") and timeframe.period == "240" and dir == 1
            rate := 54
            n := 124
        else if str.startswith(ticker, "JP225") and timeframe.period == "240" and dir == -1
            rate := 54
            n := 122
        else if str.startswith(ticker, "NI225") and timeframe.period == "240" and dir == -1
            rate := 54
            n := 122
        else if str.startswith(ticker, "JP225") and timeframe.period == "15" and dir == 1
            rate := 52
            n := 581
        else if str.startswith(ticker, "NI225") and timeframe.period == "15" and dir == 1
            rate := 52
            n := 581
        else if str.startswith(ticker, "JP225") and timeframe.period == "15" and dir == -1
            rate := 47
            n := 570
        else if str.startswith(ticker, "NI225") and timeframe.period == "15" and dir == -1
            rate := 47
            n := 570
        else if str.startswith(ticker, "US100") and timeframe.period == "D" and dir == 1
            rate := 59
            n := 74
        else if str.startswith(ticker, "US100") and timeframe.period == "D" and dir == -1
            rate := 42
            n := 75
        else if str.startswith(ticker, "US100") and timeframe.period == "60" and dir == 1
            rate := 52
            n := 597
        else if str.startswith(ticker, "US100") and timeframe.period == "60" and dir == -1
            rate := 48
            n := 599
        else if str.startswith(ticker, "US100") and timeframe.period == "240" and dir == 1
            rate := 58
            n := 217
        else if str.startswith(ticker, "US100") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 214
        else if str.startswith(ticker, "US100") and timeframe.period == "15" and dir == 1
            rate := 46
            n := 414
        else if str.startswith(ticker, "US100") and timeframe.period == "15" and dir == -1
            rate := 47
            n := 410
        else if str.startswith(ticker, "UK100") and timeframe.period == "D" and dir == 1
            rate := 60
            n := 61
        else if str.startswith(ticker, "UK100") and timeframe.period == "D" and dir == -1
            rate := 34
            n := 63
        else if str.startswith(ticker, "UK100") and timeframe.period == "60" and dir == 1
            rate := 50
            n := 487
        else if str.startswith(ticker, "UK100") and timeframe.period == "60" and dir == -1
            rate := 42
            n := 489
        else if str.startswith(ticker, "UK100") and timeframe.period == "240" and dir == 1
            rate := 53
            n := 155
        else if str.startswith(ticker, "UK100") and timeframe.period == "240" and dir == -1
            rate := 43
            n := 156
        else if str.startswith(ticker, "UK100") and timeframe.period == "15" and dir == 1
            rate := 47
            n := 581
        else if str.startswith(ticker, "UK100") and timeframe.period == "15" and dir == -1
            rate := 40
            n := 574
        else if str.startswith(ticker, "US500") and timeframe.period == "D" and dir == 1
            rate := 65
            n := 66
        else if str.startswith(ticker, "US500") and timeframe.period == "D" and dir == -1
            rate := 38
            n := 68
        else if str.startswith(ticker, "US500") and timeframe.period == "60" and dir == 1
            rate := 54
            n := 589
        else if str.startswith(ticker, "US500") and timeframe.period == "60" and dir == -1
            rate := 46
            n := 590
        else if str.startswith(ticker, "US500") and timeframe.period == "240" and dir == 1
            rate := 58
            n := 182
        else if str.startswith(ticker, "US500") and timeframe.period == "240" and dir == -1
            rate := 48
            n := 178
        else if str.startswith(ticker, "US500") and timeframe.period == "15" and dir == 1
            rate := 47
            n := 420
        else if str.startswith(ticker, "US500") and timeframe.period == "15" and dir == -1
            rate := 43
            n := 417
        else if str.startswith(ticker, "USOIL") and timeframe.period == "D" and dir == 1
            rate := 60
            n := 60
        else if str.startswith(ticker, "USOIL") and timeframe.period == "D" and dir == -1
            rate := 53
            n := 58
        else if str.startswith(ticker, "USOIL") and timeframe.period == "60" and dir == 1
            rate := 55
            n := 599
        else if str.startswith(ticker, "USOIL") and timeframe.period == "60" and dir == -1
            rate := 49
            n := 596
        else if str.startswith(ticker, "USOIL") and timeframe.period == "240" and dir == 1
            rate := 58
            n := 187
        else if str.startswith(ticker, "USOIL") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 183
        else if str.startswith(ticker, "USOIL") and timeframe.period == "15" and dir == 1
            rate := 50
            n := 426
        else if str.startswith(ticker, "USOIL") and timeframe.period == "15" and dir == -1
            rate := 44
            n := 428
        else if str.startswith(ticker, "DE40") and timeframe.period == "D" and dir == 1
            rate := 56
            n := 85
        else if str.startswith(ticker, "DE40") and timeframe.period == "D" and dir == -1
            rate := 48
            n := 87
        else if str.startswith(ticker, "DE40") and timeframe.period == "60" and dir == 1
            rate := 50
            n := 341
        else if str.startswith(ticker, "DE40") and timeframe.period == "60" and dir == -1
            rate := 49
            n := 346
        else if str.startswith(ticker, "DE40") and timeframe.period == "240" and dir == 1
            rate := 52
            n := 142
        else if str.startswith(ticker, "DE40") and timeframe.period == "240" and dir == -1
            rate := 46
            n := 145
        else if str.startswith(ticker, "DE40") and timeframe.period == "15" and dir == 1
            rate := 50
            n := 545
        else if str.startswith(ticker, "DE40") and timeframe.period == "15" and dir == -1
            rate := 50
            n := 543
        else if str.startswith(ticker, "FTSE") and timeframe.period == "D" and dir == 1
            rate := 60
            n := 61
        else if str.startswith(ticker, "FTSE") and timeframe.period == "D" and dir == -1
            rate := 34
            n := 63
        else if str.startswith(ticker, "FTSE") and timeframe.period == "60" and dir == 1
            rate := 50
            n := 487
        else if str.startswith(ticker, "FTSE") and timeframe.period == "60" and dir == -1
            rate := 42
            n := 489
        else if str.startswith(ticker, "FTSE") and timeframe.period == "240" and dir == 1
            rate := 53
            n := 155
        else if str.startswith(ticker, "FTSE") and timeframe.period == "240" and dir == -1
            rate := 43
            n := 156
        else if str.startswith(ticker, "FTSE") and timeframe.period == "15" and dir == 1
            rate := 47
            n := 581
        else if str.startswith(ticker, "FTSE") and timeframe.period == "15" and dir == -1
            rate := 40
            n := 574
        else if str.startswith(ticker, "US30") and timeframe.period == "D" and dir == 1
            rate := 67
            n := 67
        else if str.startswith(ticker, "US30") and timeframe.period == "D" and dir == -1
            rate := 47
            n := 68
        else if str.startswith(ticker, "US30") and timeframe.period == "60" and dir == 1
            rate := 53
            n := 603
        else if str.startswith(ticker, "US30") and timeframe.period == "60" and dir == -1
            rate := 49
            n := 596
        else if str.startswith(ticker, "US30") and timeframe.period == "240" and dir == 1
            rate := 61
            n := 180
        else if str.startswith(ticker, "US30") and timeframe.period == "240" and dir == -1
            rate := 51
            n := 176
        else if str.startswith(ticker, "US30") and timeframe.period == "15" and dir == 1
            rate := 52
            n := 421
        else if str.startswith(ticker, "US30") and timeframe.period == "15" and dir == -1
            rate := 43
            n := 419
        else if str.startswith(ticker, "GOLD") and timeframe.period == "D" and dir == 1
            rate := 53
            n := 54
        else if str.startswith(ticker, "GOLD") and timeframe.period == "D" and dir == -1
            rate := 53
            n := 56
        else if str.startswith(ticker, "GOLD") and timeframe.period == "60" and dir == 1
            rate := 50
            n := 966
        else if str.startswith(ticker, "GOLD") and timeframe.period == "60" and dir == -1
            rate := 48
            n := 970
        else if str.startswith(ticker, "GOLD") and timeframe.period == "240" and dir == 1
            rate := 53
            n := 273
        else if str.startswith(ticker, "GOLD") and timeframe.period == "240" and dir == -1
            rate := 50
            n := 273
        else if str.startswith(ticker, "GOLD") and timeframe.period == "15" and dir == 1
            rate := 48
            n := 391
        else if str.startswith(ticker, "GOLD") and timeframe.period == "15" and dir == -1
            rate := 45
            n := 393
        else if str.startswith(ticker, "XJO") and timeframe.period == "D" and dir == 1
            rate := 58
            n := 65
        else if str.startswith(ticker, "XJO") and timeframe.period == "D" and dir == -1
            rate := 49
            n := 65
        else if str.startswith(ticker, "XJO") and timeframe.period == "60" and dir == 1
            rate := 48
            n := 298
        else if str.startswith(ticker, "XJO") and timeframe.period == "60" and dir == -1
            rate := 47
            n := 282
        else if str.startswith(ticker, "XJO") and timeframe.period == "240" and dir == 1
            rate := 53
            n := 147
        else if str.startswith(ticker, "XJO") and timeframe.period == "240" and dir == -1
            rate := 41
            n := 143
        else if str.startswith(ticker, "XJO") and timeframe.period == "15" and dir == 1
            rate := 49
            n := 640
        else if str.startswith(ticker, "XJO") and timeframe.period == "15" and dir == -1
            rate := 44
            n := 610
        else if str.startswith(ticker, "DAX") and timeframe.period == "D" and dir == 1
            rate := 56
            n := 85
        else if str.startswith(ticker, "DAX") and timeframe.period == "D" and dir == -1
            rate := 48
            n := 87
        else if str.startswith(ticker, "DAX") and timeframe.period == "60" and dir == 1
            rate := 50
            n := 341
        else if str.startswith(ticker, "DAX") and timeframe.period == "60" and dir == -1
            rate := 49
            n := 346
        else if str.startswith(ticker, "DAX") and timeframe.period == "240" and dir == 1
            rate := 52
            n := 142
        else if str.startswith(ticker, "DAX") and timeframe.period == "240" and dir == -1
            rate := 46
            n := 145
        else if str.startswith(ticker, "DAX") and timeframe.period == "15" and dir == 1
            rate := 50
            n := 545
        else if str.startswith(ticker, "DAX") and timeframe.period == "15" and dir == -1
            rate := 50
            n := 543
        else if str.startswith(ticker, "NKY") and timeframe.period == "D" and dir == 1
            rate := 56
            n := 71
        else if str.startswith(ticker, "NKY") and timeframe.period == "D" and dir == -1
            rate := 47
            n := 74
        else if str.startswith(ticker, "NKY") and timeframe.period == "60" and dir == 1
            rate := 55
            n := 300
        else if str.startswith(ticker, "NKY") and timeframe.period == "60" and dir == -1
            rate := 45
            n := 298
        else if str.startswith(ticker, "NKY") and timeframe.period == "240" and dir == 1
            rate := 54
            n := 124
        else if str.startswith(ticker, "NKY") and timeframe.period == "240" and dir == -1
            rate := 54
            n := 122
        else if str.startswith(ticker, "NKY") and timeframe.period == "15" and dir == 1
            rate := 52
            n := 581
        else if str.startswith(ticker, "NKY") and timeframe.period == "15" and dir == -1
            rate := 47
            n := 570
        else if str.startswith(ticker, "NDX") and timeframe.period == "D" and dir == 1
            rate := 59
            n := 74
        else if str.startswith(ticker, "NDX") and timeframe.period == "D" and dir == -1
            rate := 42
            n := 75
        else if str.startswith(ticker, "NDX") and timeframe.period == "60" and dir == 1
            rate := 52
            n := 597
        else if str.startswith(ticker, "NDX") and timeframe.period == "60" and dir == -1
            rate := 48
            n := 599
        else if str.startswith(ticker, "NDX") and timeframe.period == "240" and dir == 1
            rate := 58
            n := 217
        else if str.startswith(ticker, "NDX") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 214
        else if str.startswith(ticker, "NDX") and timeframe.period == "15" and dir == 1
            rate := 46
            n := 414
        else if str.startswith(ticker, "NDX") and timeframe.period == "15" and dir == -1
            rate := 47
            n := 410
        else if str.startswith(ticker, "UKX") and timeframe.period == "D" and dir == 1
            rate := 60
            n := 61
        else if str.startswith(ticker, "UKX") and timeframe.period == "D" and dir == -1
            rate := 34
            n := 63
        else if str.startswith(ticker, "UKX") and timeframe.period == "60" and dir == 1
            rate := 50
            n := 487
        else if str.startswith(ticker, "UKX") and timeframe.period == "60" and dir == -1
            rate := 42
            n := 489
        else if str.startswith(ticker, "UKX") and timeframe.period == "240" and dir == 1
            rate := 53
            n := 155
        else if str.startswith(ticker, "UKX") and timeframe.period == "240" and dir == -1
            rate := 43
            n := 156
        else if str.startswith(ticker, "UKX") and timeframe.period == "15" and dir == 1
            rate := 47
            n := 581
        else if str.startswith(ticker, "UKX") and timeframe.period == "15" and dir == -1
            rate := 40
            n := 574
        else if str.startswith(ticker, "DJI") and timeframe.period == "D" and dir == 1
            rate := 67
            n := 67
        else if str.startswith(ticker, "DJI") and timeframe.period == "D" and dir == -1
            rate := 47
            n := 68
        else if str.startswith(ticker, "DJI") and timeframe.period == "60" and dir == 1
            rate := 53
            n := 603
        else if str.startswith(ticker, "DJI") and timeframe.period == "60" and dir == -1
            rate := 49
            n := 596
        else if str.startswith(ticker, "DJI") and timeframe.period == "240" and dir == 1
            rate := 61
            n := 180
        else if str.startswith(ticker, "DJI") and timeframe.period == "240" and dir == -1
            rate := 51
            n := 176
        else if str.startswith(ticker, "DJI") and timeframe.period == "15" and dir == 1
            rate := 52
            n := 421
        else if str.startswith(ticker, "DJI") and timeframe.period == "15" and dir == -1
            rate := 43
            n := 419
        else if str.startswith(ticker, "SPX") and timeframe.period == "D" and dir == 1
            rate := 65
            n := 66
        else if str.startswith(ticker, "SPX") and timeframe.period == "D" and dir == -1
            rate := 38
            n := 68
        else if str.startswith(ticker, "SPX") and timeframe.period == "60" and dir == 1
            rate := 54
            n := 589
        else if str.startswith(ticker, "SPX") and timeframe.period == "60" and dir == -1
            rate := 46
            n := 590
        else if str.startswith(ticker, "SPX") and timeframe.period == "240" and dir == 1
            rate := 58
            n := 182
        else if str.startswith(ticker, "SPX") and timeframe.period == "240" and dir == -1
            rate := 48
            n := 178
        else if str.startswith(ticker, "SPX") and timeframe.period == "15" and dir == 1
            rate := 47
            n := 420
        else if str.startswith(ticker, "SPX") and timeframe.period == "15" and dir == -1
            rate := 43
            n := 417
        else if str.startswith(ticker, "WTI") and timeframe.period == "D" and dir == 1
            rate := 60
            n := 60
        else if str.startswith(ticker, "WTI") and timeframe.period == "D" and dir == -1
            rate := 53
            n := 58
        else if str.startswith(ticker, "WTI") and timeframe.period == "60" and dir == 1
            rate := 55
            n := 599
        else if str.startswith(ticker, "WTI") and timeframe.period == "60" and dir == -1
            rate := 49
            n := 596
        else if str.startswith(ticker, "WTI") and timeframe.period == "240" and dir == 1
            rate := 58
            n := 187
        else if str.startswith(ticker, "WTI") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 183
        else if str.startswith(ticker, "WTI") and timeframe.period == "15" and dir == 1
            rate := 50
            n := 426
        else if str.startswith(ticker, "WTI") and timeframe.period == "15" and dir == -1
            rate := 44
            n := 428
        else if str.startswith(ticker, "NQ") and timeframe.period == "D" and dir == 1
            rate := 59
            n := 74
        else if str.startswith(ticker, "NQ") and timeframe.period == "D" and dir == -1
            rate := 42
            n := 75
        else if str.startswith(ticker, "NQ") and timeframe.period == "60" and dir == 1
            rate := 52
            n := 597
        else if str.startswith(ticker, "NQ") and timeframe.period == "60" and dir == -1
            rate := 48
            n := 599
        else if str.startswith(ticker, "NQ") and timeframe.period == "240" and dir == 1
            rate := 58
            n := 217
        else if str.startswith(ticker, "NQ") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 214
        else if str.startswith(ticker, "NQ") and timeframe.period == "15" and dir == 1
            rate := 46
            n := 414
        else if str.startswith(ticker, "NQ") and timeframe.period == "15" and dir == -1
            rate := 47
            n := 410
        else if str.startswith(ticker, "YM") and timeframe.period == "D" and dir == 1
            rate := 67
            n := 67
        else if str.startswith(ticker, "YM") and timeframe.period == "D" and dir == -1
            rate := 47
            n := 68
        else if str.startswith(ticker, "YM") and timeframe.period == "60" and dir == 1
            rate := 53
            n := 603
        else if str.startswith(ticker, "YM") and timeframe.period == "60" and dir == -1
            rate := 49
            n := 596
        else if str.startswith(ticker, "YM") and timeframe.period == "240" and dir == 1
            rate := 61
            n := 180
        else if str.startswith(ticker, "YM") and timeframe.period == "240" and dir == -1
            rate := 51
            n := 176
        else if str.startswith(ticker, "YM") and timeframe.period == "15" and dir == 1
            rate := 52
            n := 421
        else if str.startswith(ticker, "YM") and timeframe.period == "15" and dir == -1
            rate := 43
            n := 419
        else if str.startswith(ticker, "ES") and timeframe.period == "D" and dir == 1
            rate := 65
            n := 66
        else if str.startswith(ticker, "ES") and timeframe.period == "D" and dir == -1
            rate := 38
            n := 68
        else if str.startswith(ticker, "ES") and timeframe.period == "60" and dir == 1
            rate := 54
            n := 589
        else if str.startswith(ticker, "ES") and timeframe.period == "60" and dir == -1
            rate := 46
            n := 590
        else if str.startswith(ticker, "ES") and timeframe.period == "240" and dir == 1
            rate := 58
            n := 182
        else if str.startswith(ticker, "ES") and timeframe.period == "240" and dir == -1
            rate := 48
            n := 178
        else if str.startswith(ticker, "ES") and timeframe.period == "15" and dir == 1
            rate := 47
            n := 420
        else if str.startswith(ticker, "ES") and timeframe.period == "15" and dir == -1
            rate := 43
            n := 417
        else if str.startswith(ticker, "CL") and timeframe.period == "D" and dir == 1
            rate := 60
            n := 60
        else if str.startswith(ticker, "CL") and timeframe.period == "D" and dir == -1
            rate := 53
            n := 58
        else if str.startswith(ticker, "CL") and timeframe.period == "60" and dir == 1
            rate := 55
            n := 599
        else if str.startswith(ticker, "CL") and timeframe.period == "60" and dir == -1
            rate := 49
            n := 596
        else if str.startswith(ticker, "CL") and timeframe.period == "240" and dir == 1
            rate := 58
            n := 187
        else if str.startswith(ticker, "CL") and timeframe.period == "240" and dir == -1
            rate := 45
            n := 183
        else if str.startswith(ticker, "CL") and timeframe.period == "15" and dir == 1
            rate := 50
            n := 426
        else if str.startswith(ticker, "CL") and timeframe.period == "15" and dir == -1
            rate := 44
            n := 428
    [rate, n]
emaUse   = fltTrendTf == "" ? emaChart : emaHtf
var int sigLastBar = na
inSes  = not fltSes or not na(time(timeframe.period, fltSesion))
gapOk  = fltGap == 0 or na(sigLastBar) or bar_index - sigLastBar >= fltGap
atrOk  = not fltAtr or sigAtr >= fltAtrMin
// GII: Pine cannot read the GII API, so the user pastes the day's code:
//   G1|<as_of yyyy-mm-dd>|<score>|<zone -2..2>|<up %>|<down %>|<base up %>|<horizon sessions>|<check>
// check = sum over the characters before the last "|" of (position in "0123456789-.|G" + 1) x (index + 1), mod 9973.
// The check only catches typing errors; the Ed25519 signature of the API is NOT checked here.
// The data of date d is used from d + 1 day 01:00 UTC; bars before that, or older than giiMaxAge days, ignore GII.
giiCheck(string p) =>
    int giiAcc = 0
    for giiI = 0 to str.length(p) - 1
        int giiK = str.pos("0123456789-.|G", str.substring(p, giiI, giiI + 1))
        giiAcc := (giiAcc + (na(giiK) ? 99 : giiK + 1) * (giiI + 1)) % 9973
    giiAcc
giiGold = str.contains(str.upper(syminfo.ticker), "XAU") or str.contains(str.upper(syminfo.ticker), "GOLD")
giiClean = str.replace_all(giiCode, " ", "")
giiParts = str.split(giiClean, "|")
giiHave  = array.size(giiParts) == 9 and array.get(giiParts, 0) == "G1"
giiChk   = giiHave ? str.tonumber(array.get(giiParts, 8)) : na
giiValid = giiHave and str.length(array.get(giiParts, 1)) == 10 and not na(giiChk) and
           giiCheck(str.substring(giiClean, 0, str.length(giiClean) - str.length(array.get(giiParts, 8)) - 1)) == int(giiChk)
giiAsOf = giiValid ? timestamp("UTC", int(str.tonumber(str.substring(array.get(giiParts, 1), 0, 4))), int(str.tonumber(str.substring(array.get(giiParts, 1), 5, 7))), int(str.tonumber(str.substring(array.get(giiParts, 1), 8, 10))), 0, 0) : na
giiZone  = giiValid ? str.tonumber(array.get(giiParts, 3)) : na
giiUse   = giiValid and giiGold and time >= giiAsOf + 25 * 3600000 and time - giiAsOf <= giiMaxAge * 86400000
giiBuyOk  = not giiFilter or not giiUse or giiZone >= 1
giiSellOk = not giiFilter or not giiUse or giiZone <= -1
common = barstate.isconfirmed and inSes and gapOk and atrOk and not na(sigAtr)
buySig  = common and rawBuy and (not fltTrend or close > emaUse) and giiBuyOk
sellSig = common and rawSell and not buySig and (not fltTrend or close < emaUse) and giiSellOk
sigRisk = sigAtr * sigSlAtr
sigEntry = buySig or sellSig ? close : na
sigSL = buySig ? close - sigRisk : sellSig ? close + sigRisk : na
sigTP = buySig ? close + sigRisk * sigRR : sellSig ? close - sigRisk * sigRR : na

var float lastEntry = na
var float lastSL = na
var float lastTP = na
var int lastDir = 0
var string lastWhy = ""
var int lastTime = na
if buySig or sellSig
    sigLastBar := bar_index
    lastEntry := sigEntry
    lastSL := sigSL
    lastTP := sigTP
    lastDir := buySig ? 1 : -1
    lastWhy := buySig ? whyBuy : whySell
    lastTime := time
    if sigLabels
        [arrowRate, arrowN] = dnxArrowRate(lastDir, 0)
        string arrowText = lastWhy + (na(arrowRate) ? "" : "  " + (lastDir > 0 ? "Buy 1:1 " : "Sell 1:1 ") +
                           str.tostring(arrowRate, "#") + "%" + (DNX_ARROW_ALL ? " all mkts" : "") + " (n=" + str.tostring(arrowN) + ")")
        label.new(bar_index, buySig ? low - sigAtr * 0.9 : high + sigAtr * 0.9, arrowText, style = label.style_none,
                  textcolor = buySig ? color.lime : color.red, size = size.small, force_overlay = true)
    if sigLevels
        line.new(bar_index, sigEntry, bar_index + sigLvlLen, sigEntry, color = color.silver, force_overlay = true)
        line.new(bar_index, sigSL, bar_index + sigLvlLen, sigSL, color = color.red, style = line.style_dashed, force_overlay = true)
        line.new(bar_index, sigTP, bar_index + sigLvlLen, sigTP, color = color.lime, style = line.style_dashed, force_overlay = true)

plotshape(sigArrows and buySig, "Buy arrow", shape.triangleup, location.belowbar, color.lime, size = size.small, force_overlay = true)
plotshape(sigArrows and sellSig, "Sell arrow", shape.triangledown, location.abovebar, color.red, size = size.small, force_overlay = true)
// hidden values for strategies and webhooks (Data Window only)
plot(buySig ? 1 : 0, "Buy signal", display = display.data_window, editable = false)
plot(sellSig ? 1 : 0, "Sell signal", display = display.data_window, editable = false)
plot(sigSL, "Signal SL", display = display.data_window, editable = false)
plot(sigTP, "Signal TP", display = display.data_window, editable = false)
plot(sigEntry, "Signal entry", display = display.data_window, editable = false)
alertcondition(buySig, "DNX " + DNX_NAME + " Buy", "DNX " + DNX_NAME + " BUY {{ticker}} {{interval}} close {{close}}")
alertcondition(sellSig, "DNX " + DNX_NAME + " Sell", "DNX " + DNX_NAME + " SELL {{ticker}} {{interval}} close {{close}}")

pnlWhere = pnlPos == "top_left" ? position.top_left : pnlPos == "bottom_left" ? position.bottom_left :
           pnlPos == "bottom_right" ? position.bottom_right : position.top_right
var table pnl = table.new(pnlWhere, 1, 9, bgcolor = color.new(color.black, 20), border_width = 1, force_overlay = true)
if pnlShow and barstate.islast
    table.cell(pnl, 0, 0, "DinexSpace | " + DNX_NAME, text_color = color.white, text_size = size.small)
    if lastDir == 0
        table.cell(pnl, 0, 1,"No signal yet", text_color = color.silver, text_size = size.small)
    else
        table.cell(pnl, 0, 1, (lastDir > 0 ? ("BUY ▲ ") : ("SELL ▼ ")) + lastWhy,
                   text_color = lastDir > 0 ? color.lime : color.red, text_size = size.small)
        table.cell(pnl, 0, 2, ("Price ") + str.tostring(lastEntry, format.mintick) + "  SL " +
                   str.tostring(lastSL, format.mintick) + "  TP " + str.tostring(lastTP, format.mintick),
                   text_color = color.silver, text_size = size.small)
        table.cell(pnl, 0, 3, str.format_time(lastTime, "yyyy-MM-dd HH:mm", syminfo.timezone) + "  ·  " +
                   str.tostring(bar_index - sigLastBar) + (" bars ago"),
                   text_color = color.silver, text_size = size.small)
        [panelRate, panelN] = dnxArrowRate(lastDir, bar_index - sigLastBar)
        table.cell(pnl, 0, 4, na(panelRate) ? "" : "Win 1:1  " + str.tostring(panelRate, "#") + (DNX_ARROW_ALL ? "% all mkts" : "%") +
                   " (n=" + str.tostring(panelN) + ")", text_color = color.silver, text_size = size.small)
    if giiShow and giiGold
        if not giiValid
            table.cell(pnl, 0, 5, giiCode == "" ? "GII: no code entered (input GII code)" : "GII code invalid: check digits",
                       text_color = color.orange, text_size = size.small)
            table.cell(pnl, 0, 6, "Copy today's code from the DinexSpace GII page", text_color = color.gray, text_size = size.small)
        else
            bool giiStale = timenow - giiAsOf > giiMaxAge * 86400000
            float gUp = str.tonumber(array.get(giiParts, 4))
            float gDn = str.tonumber(array.get(giiParts, 5))
            table.cell(pnl, 0, 5, "Gold potential (" + array.get(giiParts, 7) + " D1 sessions): Up " + str.tostring(gUp, "#") +
                       "% / Down " + str.tostring(gDn, "#") + "%",
                       text_color = giiStale ? color.gray : gUp > gDn ? color.lime : gUp < gDn ? color.red : color.silver, text_size = size.small)
            table.cell(pnl, 0, 6, "Base rate up " + array.get(giiParts, 6) + "%  ·  GII score " + array.get(giiParts, 2) +
                       "  ·  zone " + array.get(giiParts, 3), text_color = color.silver, text_size = size.small)
            table.cell(pnl, 0, 7, "GII data " + array.get(giiParts, 1) + "  ·  pasted code, signature not checked  ·  " +
                       (giiStale ? "STALE: filter ignores GII" : "fresh"), text_color = giiStale ? color.orange : color.silver, text_size = size.small)
        table.cell(pnl, 0, 8, (giiFilter ? "GII filter ON" : "GII filter off") + "  ·  GII not validated, reference only",
                   text_color = color.gray, text_size = size.small)
// ---- end of DinexSpace signal layer ----

SuperTrend FAQ

SuperTrend is free, runs on MT5 and TradingView and does not place trades.

Is SuperTrend free?

Yes. SuperTrend is free to download from this page with no sign-up, and the download includes the full source code.

Which platforms does SuperTrend run on?

SuperTrend is available for MetaTrader 5 (MQL5) and TradingView (Pine Script v6).

Does SuperTrend give buy and sell signals?

SuperTrend gives a Buy signal when the bar that just closed flips the SuperTrend line from above price to below price (label "ST flipped up") and a Sell signal when the bar that just closed flips the line from below price to above price (label "ST flipped down"). It does not repaint: signals are confirmed only on bar close.

Does SuperTrend have alerts?

Yes. SuperTrend has built-in alerts: MT5 – pop-up, push notification, email, sound; TradingView – alert conditions for Create Alert.

Can an EA read SuperTrend?

Yes. The MT5 version of SuperTrend exposes its plots as indicator buffers that an EA can read with iCustom and CopyBuffer: SuperTrend, Buy, Sell, Signal SL, Signal TP, Signal entry, Signal filter, Confluence score, Win rate %, Sample size, Bar buy odds %, Bar buy samples, Bar sell odds %, Bar sell samples, Lean, Bar buy score, Bar sell score.

Which timeframes does SuperTrend work on?

SuperTrend runs on any chart timeframe. Its calculation reads the chart timeframe or a fixed timeframe (for example D1 or a higher timeframe), as described under Features.

Does SuperTrend place trades?

No. It is a read-only indicator: it only reads market data and shows the result on the chart or writes it to a file. The source contains no calls that open, close or modify orders.

How do I install SuperTrend?

Download the .zip and follow the step-by-step installation guide for MT5 and TradingView: https://indicators.dinexspace.com/install-guide/

Does SuperTrend repaint its signals?

No. Signals only print on closed bars. In the XAUUSD H1 check, 797/797 live signals matched a full recalculation of the history.

Measured win rates (backtest)

Measured

Out of sample on H1: 2 of 21 symbols above break-even after costs.

Swipe sideways to see every timeframe.

Out of sample: 2024-01-01 to 2026-11-16
SymbolM15H1H4D1
AUDUSD42.2% (n=1816; break-even 61.4%)46.9% (n=448; break-even 55.2%)51.8% (n=112; break-even 52.5%)–
AUS20044.0% (n=480; break-even 64.3%)42.4% (n=159; break-even 56.3%)51.4% (n=70; break-even 53.8%)–
BNB–47.5% (n=556; break-even 57.8%)52.8% (n=125; break-even 53.6%)–
BTCUSD48.6% (n=2301; break-even 53.9%)50.8% (n=587; break-even 51.7%)57.8% (n=147; break-even 50.8%)–
ETHUSD47.1% (n=2139; break-even 57.6%)46.6% (n=580; break-even 53.5%)48.3% (n=147; break-even 51.5%)–
EURUSD44.8% (n=1743; break-even 58.0%)43.9% (n=447; break-even 53.7%)47.0% (n=115; break-even 51.8%)–
GBPUSD44.0% (n=1776; break-even 58.4%)43.0% (n=458; break-even 53.8%)46.1% (n=128; break-even 51.8%)–
GER4050.2% (n=1386; break-even 53.7%)51.1% (n=368; break-even 51.7%)45.7% (n=105; break-even 50.8%)–
JP22547.3% (n=1512; break-even 57.3%)50.6% (n=415; break-even 53.3%)56.4% (n=94; break-even 51.6%)–
NAS10049.6% (n=1791; break-even 52.0%)51.2% (n=484; break-even 50.8%)50.8% (n=127; break-even 50.4%)–
NZDUSD40.7% (n=1827; break-even 66.0%)41.2% (n=447; break-even 57.3%)53.0% (n=115; break-even 53.4%)–
SOLUSD33.5% (n=2273; break-even 83.8%)42.0% (n=607; break-even 64.7%)39.1% (n=138; break-even 57.3%)–
UK10042.2% (n=1535; break-even 62.3%)48.5% (n=403; break-even 55.5%)47.4% (n=95; break-even 52.9%)–
US3047.6% (n=1782; break-even 52.8%)50.6% (n=476; break-even 51.1%)47.3% (n=132; break-even 50.5%)–
US50047.0% (n=1777; break-even 55.4%)47.5% (n=467; break-even 52.1%)52.8% (n=143; break-even 51.1%)–
USDCAD41.9% (n=1833; break-even 62.5%)45.9% (n=449; break-even 55.5%)56.4% (n=110; break-even 52.6%)–
USDCHF39.9% (n=1795; break-even 63.9%)42.4% (n=425; break-even 55.9%)53.6% (n=125; break-even 52.8%)–
USDJPY45.8% (n=1709; break-even 59.0%)51.7% (n=417; break-even 54.1%)49.5% (n=107; break-even 51.9%)–
WTI47.2% (n=1839; break-even 56.6%)53.0% (n=487; break-even 52.9%)43.8% (n=137; break-even 51.5%)–
XAGUSD44.9% (n=1659; break-even 58.2%)46.5% (n=409; break-even 53.8%)49.1% (n=112; break-even 51.9%)–
XAUUSD49.3% (n=1642; break-even 51.9%)49.6% (n=115; break-even 51.5%)measured up to 2024-10-1656.6% (n=106; break-even 50.5%)–

No data: HK50, KOSPI

Swipe sideways to see every timeframe.

In sample: through 2023-12-31
SymbolM15H1H4D1
AUDUSD45.6% (n=660; break-even 57.1%)50.7% (n=1936; break-even 51.4%)51.3% (n=518; break-even 50.7%)48.9% (n=88; break-even 50.4%)
AUS20047.4% (n=1250; break-even 56.6%)48.3% (n=580; break-even 52.0%)47.6% (n=290; break-even 51.2%)50.4% (n=123; break-even 50.7%)
BNB–48.2% (n=1101; break-even 54.9%)53.6% (n=293; break-even 52.3%)50.0% (n=36; break-even 50.9%)
BTCUSD–44.8% (n=257; break-even 51.1%)45.7% (n=70; break-even 50.5%)–
ETHUSD–48.5% (n=264; break-even 52.3%)46.6% (n=73; break-even 51.1%)–
EURUSD43.6% (n=667; break-even 58.7%)51.4% (n=1986; break-even 51.6%)49.3% (n=556; break-even 50.8%)49.0% (n=102; break-even 50.2%)
GBPUSD45.7% (n=663; break-even 54.9%)50.1% (n=2019; break-even 51.1%)48.9% (n=558; break-even 50.5%)49.1% (n=118; break-even 50.2%)
GER4050.4% (n=1089; break-even 51.6%)49.6% (n=687; break-even 50.2%)49.5% (n=287; break-even 50.1%)53.5% (n=159; break-even 50.0%)
JP22550.2% (n=1151; break-even 52.4%)50.5% (n=598; break-even 50.6%)54.1% (n=246; break-even 50.2%)52.3% (n=132; break-even 50.1%)
NAS10047.1% (n=824; break-even 52.1%)50.8% (n=1196; break-even 50.1%)52.3% (n=432; break-even 50.1%)50.0% (n=142; break-even 50.0%)
NZDUSD38.5% (n=680; break-even 62.2%)50.8% (n=1896; break-even 52.7%)47.5% (n=520; break-even 51.4%)56.0% (n=100; break-even 50.8%)
SOLUSD–51.2% (n=256; break-even 50.2%)52.9% (n=70; break-even 50.1%)–
UK10044.2% (n=1155; break-even 53.6%)46.6% (n=976; break-even 50.5%)48.5% (n=311; break-even 50.2%)48.3% (n=120; break-even 50.1%)
US3048.2% (n=840; break-even 52.5%)51.5% (n=1199; break-even 50.2%)56.5% (n=356; break-even 50.1%)56.1% (n=123; break-even 50.0%)
US50045.4% (n=837; break-even 55.0%)50.2% (n=1179; break-even 50.3%)53.6% (n=360; break-even 50.1%)50.8% (n=118; break-even 50.0%)
USDCAD41.7% (n=693; break-even 57.1%)47.3% (n=2031; break-even 51.1%)52.4% (n=519; break-even 50.6%)50.0% (n=106; break-even 50.3%)
USDCHF36.8% (n=715; break-even 63.6%)47.4% (n=1929; break-even 51.8%)52.6% (n=492; break-even 50.8%)59.5% (n=111; break-even 50.4%)
USDJPY44.5% (n=669; break-even 57.1%)48.8% (n=1908; break-even 51.8%)50.0% (n=544; break-even 50.9%)48.1% (n=104; break-even 50.3%)
WTI47.0% (n=855; break-even 54.0%)52.2% (n=1195; break-even 50.3%)52.2% (n=370; break-even 50.1%)55.6% (n=115; break-even 50.0%)
XAGUSD45.7% (n=799; break-even 58.2%)43.4% (n=1808; break-even 59.5%)47.5% (n=524; break-even 54.7%)59.2% (n=103; break-even 52.3%)
XAUUSD47.2% (n=784; break-even 52.7%)49.4% (n=1936; break-even 51.4%)51.9% (n=547; break-even 50.7%)52.5% (n=101; break-even 50.3%)

No data: HK50, KOSPI

Also measured: 1:2 and 1:3 TP win rates
Also measured: 1:2 and 1:3 TP win rates
Sample · symbol · timeframe1:21:3
Out of sample: 2024-01-01 to 2026-11-16 · AUDUSD · M1528.4%19.6%
Out of sample: 2024-01-01 to 2026-11-16 · AUDUSD · H129.5%22.8%
Out of sample: 2024-01-01 to 2026-11-16 · AUDUSD · H434.8%27.7%
Out of sample: 2024-01-01 to 2026-11-16 · AUS200 · M1531.9%25.0%
Out of sample: 2024-01-01 to 2026-11-16 · AUS200 · H129.1%23.4%
Out of sample: 2024-01-01 to 2026-11-16 · AUS200 · H434.3%24.6%
Out of sample: 2024-01-01 to 2026-11-16 · BNB · H133.7%24.3%
Out of sample: 2024-01-01 to 2026-11-16 · BNB · H435.2%30.4%
Out of sample: 2024-01-01 to 2026-11-16 · BTCUSD · M1532.7%25.2%
Out of sample: 2024-01-01 to 2026-11-16 · BTCUSD · H131.4%25.6%
Out of sample: 2024-01-01 to 2026-11-16 · BTCUSD · H436.7%27.9%
Out of sample: 2024-01-01 to 2026-11-16 · ETHUSD · M1533.4%25.1%
Out of sample: 2024-01-01 to 2026-11-16 · ETHUSD · H131.7%23.6%
Out of sample: 2024-01-01 to 2026-11-16 · ETHUSD · H434.0%28.6%
Out of sample: 2024-01-01 to 2026-11-16 · EURUSD · M1529.1%21.5%
Out of sample: 2024-01-01 to 2026-11-16 · EURUSD · H127.5%22.4%
Out of sample: 2024-01-01 to 2026-11-16 · EURUSD · H433.0%23.5%
Out of sample: 2024-01-01 to 2026-11-16 · GBPUSD · M1529.0%21.4%
Out of sample: 2024-01-01 to 2026-11-16 · GBPUSD · H127.3%20.5%
Out of sample: 2024-01-01 to 2026-11-16 · GBPUSD · H429.7%21.9%
Out of sample: 2024-01-01 to 2026-11-16 · GER40 · M1534.7%27.8%
Out of sample: 2024-01-01 to 2026-11-16 · GER40 · H138.0%28.3%
Out of sample: 2024-01-01 to 2026-11-16 · GER40 · H427.9%20.2%
Out of sample: 2024-01-01 to 2026-11-16 · JP225 · M1533.3%25.5%
Out of sample: 2024-01-01 to 2026-11-16 · JP225 · H134.5%23.1%
Out of sample: 2024-01-01 to 2026-11-16 · JP225 · H444.7%32.3%
Out of sample: 2024-01-01 to 2026-11-16 · NAS100 · M1533.5%26.3%
Out of sample: 2024-01-01 to 2026-11-16 · NAS100 · H133.9%27.1%
Out of sample: 2024-01-01 to 2026-11-16 · NAS100 · H437.3%26.4%
Out of sample: 2024-01-01 to 2026-11-16 · NZDUSD · M1527.4%20.9%
Out of sample: 2024-01-01 to 2026-11-16 · NZDUSD · H128.9%21.2%
Out of sample: 2024-01-01 to 2026-11-16 · NZDUSD · H433.0%21.9%
Out of sample: 2024-01-01 to 2026-11-16 · SOLUSD · M1525.8%21.0%
Out of sample: 2024-01-01 to 2026-11-16 · SOLUSD · H128.2%21.3%
Out of sample: 2024-01-01 to 2026-11-16 · SOLUSD · H430.4%25.6%
Out of sample: 2024-01-01 to 2026-11-16 · UK100 · M1529.1%21.7%
Out of sample: 2024-01-01 to 2026-11-16 · UK100 · H130.9%22.0%
Out of sample: 2024-01-01 to 2026-11-16 · UK100 · H433.0%24.7%
Out of sample: 2024-01-01 to 2026-11-16 · US30 · M1532.7%24.6%
Out of sample: 2024-01-01 to 2026-11-16 · US30 · H134.9%25.6%
Out of sample: 2024-01-01 to 2026-11-16 · US30 · H432.1%26.2%
Out of sample: 2024-01-01 to 2026-11-16 · US500 · M1533.3%24.2%
Out of sample: 2024-01-01 to 2026-11-16 · US500 · H132.6%26.6%
Out of sample: 2024-01-01 to 2026-11-16 · US500 · H435.2%27.5%
Out of sample: 2024-01-01 to 2026-11-16 · USDCAD · M1527.9%20.7%
Out of sample: 2024-01-01 to 2026-11-16 · USDCAD · H130.1%24.2%
Out of sample: 2024-01-01 to 2026-11-16 · USDCAD · H435.4%20.2%
Out of sample: 2024-01-01 to 2026-11-16 · USDCHF · M1526.4%19.2%
Out of sample: 2024-01-01 to 2026-11-16 · USDCHF · H128.2%21.7%
Out of sample: 2024-01-01 to 2026-11-16 · USDCHF · H439.2%31.2%
Out of sample: 2024-01-01 to 2026-11-16 · USDJPY · M1529.5%22.4%
Out of sample: 2024-01-01 to 2026-11-16 · USDJPY · H134.0%25.8%
Out of sample: 2024-01-01 to 2026-11-16 · USDJPY · H434.6%27.4%
Out of sample: 2024-01-01 to 2026-11-16 · WTI · M1531.5%23.3%
Out of sample: 2024-01-01 to 2026-11-16 · WTI · H135.4%26.1%
Out of sample: 2024-01-01 to 2026-11-16 · WTI · H432.4%27.2%
Out of sample: 2024-01-01 to 2026-11-16 · XAGUSD · M1529.8%22.2%
Out of sample: 2024-01-01 to 2026-11-16 · XAGUSD · H131.5%24.0%
Out of sample: 2024-01-01 to 2026-11-16 · XAGUSD · H433.9%29.5%
Out of sample: 2024-01-01 to 2026-11-16 · XAUUSD · M1533.3%25.9%
Out of sample: 2024-01-01 to 2026-11-16 · XAUUSD · H132.2%24.3%
Out of sample: 2024-01-01 to 2026-11-16 · XAUUSD · H445.3%33.0%
In sample: through 2023-12-31 · AUDUSD · M1530.4%21.7%
In sample: through 2023-12-31 · AUDUSD · H133.8%26.7%
In sample: through 2023-12-31 · AUDUSD · H433.2%26.2%
In sample: through 2023-12-31 · AUDUSD · D134.1%25.0%
In sample: through 2023-12-31 · AUS200 · M1533.1%25.5%
In sample: through 2023-12-31 · AUS200 · H133.6%25.7%
In sample: through 2023-12-31 · AUS200 · H433.5%24.6%
In sample: through 2023-12-31 · AUS200 · D135.0%26.8%
In sample: through 2023-12-31 · BNB · H133.0%24.9%
In sample: through 2023-12-31 · BNB · H435.8%27.0%
In sample: through 2023-12-31 · BNB · D133.3%27.8%
In sample: through 2023-12-31 · BTCUSD · H128.0%22.2%
In sample: through 2023-12-31 · BTCUSD · H432.9%26.1%
In sample: through 2023-12-31 · ETHUSD · H133.0%23.6%
In sample: through 2023-12-31 · ETHUSD · H430.1%23.6%
In sample: through 2023-12-31 · EURUSD · M1527.8%21.9%
In sample: through 2023-12-31 · EURUSD · H134.7%26.3%
In sample: through 2023-12-31 · EURUSD · H432.6%24.3%
In sample: through 2023-12-31 · EURUSD · D134.3%23.5%
In sample: through 2023-12-31 · GBPUSD · M1529.3%21.8%
In sample: through 2023-12-31 · GBPUSD · H134.9%26.3%
In sample: through 2023-12-31 · GBPUSD · H434.8%25.4%
In sample: through 2023-12-31 · GBPUSD · D131.4%23.7%
In sample: through 2023-12-31 · GER40 · M1534.0%25.9%
In sample: through 2023-12-31 · GER40 · H135.9%26.8%
In sample: through 2023-12-31 · GER40 · H436.2%26.9%
In sample: through 2023-12-31 · GER40 · D137.7%28.9%
In sample: through 2023-12-31 · JP225 · M1535.7%28.4%
In sample: through 2023-12-31 · JP225 · H136.1%27.5%
In sample: through 2023-12-31 · JP225 · H435.4%26.4%
In sample: through 2023-12-31 · JP225 · D134.8%27.3%
In sample: through 2023-12-31 · NAS100 · M1530.6%22.7%
In sample: through 2023-12-31 · NAS100 · H134.4%27.1%
In sample: through 2023-12-31 · NAS100 · H434.0%27.6%
In sample: through 2023-12-31 · NAS100 · D132.4%28.2%
In sample: through 2023-12-31 · NZDUSD · M1524.9%18.1%
In sample: through 2023-12-31 · NZDUSD · H135.7%27.0%
In sample: through 2023-12-31 · NZDUSD · H433.7%25.8%
In sample: through 2023-12-31 · NZDUSD · D137.0%25.0%
In sample: through 2023-12-31 · SOLUSD · H132.8%25.5%
In sample: through 2023-12-31 · SOLUSD · H434.3%30.0%
In sample: through 2023-12-31 · UK100 · M1529.4%22.2%
In sample: through 2023-12-31 · UK100 · H130.7%23.3%
In sample: through 2023-12-31 · UK100 · H433.8%26.4%
In sample: through 2023-12-31 · UK100 · D126.7%19.2%
In sample: through 2023-12-31 · US30 · M1532.0%24.0%
In sample: through 2023-12-31 · US30 · H133.3%25.8%
In sample: through 2023-12-31 · US30 · H440.2%30.6%
In sample: through 2023-12-31 · US30 · D138.2%32.5%
In sample: through 2023-12-31 · US500 · M1528.4%20.9%
In sample: through 2023-12-31 · US500 · H133.4%27.0%
In sample: through 2023-12-31 · US500 · H435.8%28.3%
In sample: through 2023-12-31 · US500 · D134.8%31.4%
In sample: through 2023-12-31 · USDCAD · M1527.6%22.5%
In sample: through 2023-12-31 · USDCAD · H131.8%23.0%
In sample: through 2023-12-31 · USDCAD · H432.8%24.9%
In sample: through 2023-12-31 · USDCAD · D130.2%20.8%
In sample: through 2023-12-31 · USDCHF · M1524.6%18.0%
In sample: through 2023-12-31 · USDCHF · H131.2%22.9%
In sample: through 2023-12-31 · USDCHF · H437.6%29.9%
In sample: through 2023-12-31 · USDCHF · D136.0%22.5%
In sample: through 2023-12-31 · USDJPY · M1530.3%21.1%
In sample: through 2023-12-31 · USDJPY · H133.4%25.7%
In sample: through 2023-12-31 · USDJPY · H432.9%24.9%
In sample: through 2023-12-31 · USDJPY · D129.8%22.1%
In sample: through 2023-12-31 · WTI · M1531.6%23.4%
In sample: through 2023-12-31 · WTI · H135.6%27.1%
In sample: through 2023-12-31 · WTI · H436.8%26.5%
In sample: through 2023-12-31 · WTI · D140.0%27.8%
In sample: through 2023-12-31 · XAGUSD · M1531.8%24.4%
In sample: through 2023-12-31 · XAGUSD · H129.4%21.9%
In sample: through 2023-12-31 · XAGUSD · H430.9%24.1%
In sample: through 2023-12-31 · XAGUSD · D139.8%27.2%
In sample: through 2023-12-31 · XAUUSD · M1531.5%22.7%
In sample: through 2023-12-31 · XAUUSD · H134.6%26.2%
In sample: through 2023-12-31 · XAUUSD · H434.7%27.8%
In sample: through 2023-12-31 · XAUUSD · D138.6%30.7%

What counts as a win

  • W1: take profit before stop loss. Stop loss = 1.5 × ATR(14) Wilder of the signal bar; shown take profit = 1 × stop loss (1:1). Entry is at the signal bar close. Buy pays the spread at entry; sell pays it at exit. If stop loss and take profit occur in the same M15 bar, count a loss. No result within 200 bars is not counted.
  • W2 direction after 5, 10 and 20 bars is measured too.
  • Default inputs require confluence ≥ 4/7.
  • In sample: first bar to 2023-12-31; out of sample: 2024-01-01 to 2026-11-16.
  • Costs: Real spread of an ECN-type MT5 account, no commission.
  • Data source: MT5 tick data (BNB: Binance spot).
  • Cells with fewer than 30 signals show –.

TradingView H4/D1 bars may follow the exchange time zone of the TradingView symbol, not the MT5 server time (UTC) used for the measurement; sessions and the H4 trend may differ on the Pine version. Same signals on TradingView not checked yet.

Arrows show measured rates for each market.

What this version adds

  • Standard SuperTrend versions on MT5 or TradingView do not show a measured win rate for their signals.
  • Every arrow shows its measured win rate, e.g. "Buy 1:1 50% (n=966)" on XAUUSD H1 buys. Measured on 20 MT5 symbols + BNB, M15 to D1, in and out of sample.
  • Signals on closed bars only; 7-factor confluence score, by default only signals scoring 4/7 or more.
  • ATR-based SL/TP suggestions, per-bar odds, standard buffers for EAs, one alert per closed bar.
  • On gold: GII panel and an optional GII side filter (off by default: GII is not validated yet).

Past test statistics are not a promise of future results.

More in this category

All Trend indicators

Aroon

Trend · Indicator

Counts the bars since the most recent highest high and lowest low. Use it to tell whether a trend is just starting or running out of steam.

FreeMT5Measured

ATR Trailing Stop Line

Trend · Indicator

An ATR-based trailing stop line that follows price and flips colour when the trend reverses. Use it to ride a trend and know when to get out.

FreeMT5TradingViewMeasured

Heikin Ashi Smoothed

Trend · Indicator

Smoothed Heikin Ashi candles that filter out much of the noise. Use them to see whether a trend is continuing or losing steam.

FreeMT5TradingViewMeasured