Entered OHLC bars · recursive final-band state arithmetic

Supertrend Calculator

Reproduce a transparent Supertrend series from entered bars, Wilder ATR, basic bands and the prior final-band state.

Runs in your browserRecursive bands shownDirection is not a trade signal

Enter chronological OHLC bars

Supertrend is path-dependent: keep every row in order and include enough warm-up history for the declared ATR period.

Entered

Whole number from 2 through 200, no longer than the entered history.

Positive decimal from 0.01 through 100; this is a scenario, not an optimized setting.

One row per bar: Label, High, Low, Close. Use commas, tabs or semicolons; omit a header row.

Supertrend boundary: The up/down state is a mechanical consequence of entered closes and recursive bands. It is not a BUY, SELL, probability, forecast, stop order or trading recommendation.

Latest Supertrend line and state

Entered Volatility Stop Overlays 1.0.0.

Derived
No Supertrend series calculated yetEnter enough valid chronological OHLC bars for the ATR period, or load the audited example.

How the recursive Supertrend line is calculated

HL2 = (High + Low) ÷ 2
Basic upper = HL2 + multiplier × ATR
Basic lower = HL2 − multiplier × ATR
Final bands retain or reset from prior bands according to the prior close
Active Supertrend = final lower in the up state; final upper in the down state

Version 1.0.0 calculates gap-aware true range and Wilder ATR first. Once the initial ATR becomes available, the basic upper and lower bands are midpoint plus or minus the ATR multiple. On that first ready bar, both final bands equal their basic bands, the disclosed boundary state is down, and the active Supertrend is the final upper band.

For each later bar, the basic upper replaces the previous final upper only when it is lower or the previous close was above the previous final upper; otherwise the prior upper is retained. The basic lower replaces the previous final lower only when it is higher or the previous close was below the previous final lower; otherwise the prior lower is retained.

State then depends on the prior active line. When the prior Supertrend was its final upper band, the state changes to up only if the current close is above the current final upper. When the prior line was its final lower band, the state changes to down only if current close is below current final lower. Strict comparisons mean equality does not flip state.

A careful interpretation workflow

Start with the visible inputs and row-level audit trail, then decide whether the entered history and declared convention answer your actual risk question. A precise line is not evidence that the line is optimal.

  • Read the row table from the first ATR-ready bar; earlier rows are explicitly marked as warming up.
  • Inspect final bands, not only basic bands, because retained prior values create the recursive path.
  • Treat the direction label as model state rather than a standalone recommendation to buy or sell.
  • Use completed bars if your rules act on close; this calculator cannot verify whether the final entered bar is complete.
  • Compare platform results only after matching ATR smoothing, initialization, multiplier and equality conventions.
  • Evaluate any strategy with costs, slippage, whipsaw controls and out-of-sample testing outside this page.

Worked example from the audited fixture

Reproduce it with “Load audited example”The 12-bar fixture uses ATR period 3 and multiplier 2. Supertrend initializes down at B3, changes to up at B8 when close 106 exceeds final upper 105, and changes back to down at B10 when close 101 falls below final lower 102. At B12, ATR is 3.6049382716, final upper is 105.2098765432, final lower is 93.1851851852 and the active down-state line is 105.2098765432.

How to interpret the result

The two state changes prove that the audited example exercises both branches of the recursion. They do not prove profitable entries or exits. A live platform can differ because of intrabar updates, current-bar handling, source data, initialization, ATR warm-up, equality rules or an alternative published Supertrend variant.

ATR stop, Chandelier Exit and Supertrend compared

All three use ATR, but their anchors and state rules answer different questions. They should not be treated as duplicate names for the same stop. The table below keeps the differences visible before you transfer a value into a chart or risk worksheet.

OverlayAnchorPath dependencePrimary outputNot included
ATR stop referenceLatest entered closeATR recursion onlySymmetrical long/short referenceVolume and order rules
Chandelier ExitLookback highest high or lowest lowATR plus rolling extremaLong/short extrema-based referenceCrossing or fill verdict
SupertrendHL2 basic bands retained by prior stateATR plus recursive final bands and stateActive line and mechanical stateBUY/SELL recommendation

The ATR Calculator isolates the underlying volatility series. The ATR Position Size Calculator then answers a separate question: how much volume corresponds to a chosen risk budget and ATR distance. Separating line placement from size helps prevent a wider volatility stop from silently increasing account risk.

Assumptions and limits

  • At least the selected ATR-period number of OHLC rows is required; up to 2,000 rows are supported.
  • The model initializes the first ATR-ready bar in the down state, matching the disclosed TradingView-style boundary.
  • The current bar is included and treated exactly as entered; timestamps and bar completion are not validated.
  • Different Supertrend implementations may use another ATR seed, warm-up, equality rule, source field or first state.
  • A state change reflects only entered closes crossing recursive final bands; intrabar touches and fills are not modeled.
  • No spread, commission, slippage, overnight gap, broker stop restriction or position risk is calculated.
  • No historical profitability, forecast probability, optimal parameter, BUY/SELL instruction or personal advice is claimed.

Prepare OHLC data before calculating

Export completed bars from one symbol, one timeframe and one broker or data vendor. Keep them in chronological order from oldest to newest and include enough earlier history for the ATR recursion to warm up. A short pasted sample can reproduce the formula while still differing from a platform that initialized ATR hundreds of bars earlier.

Use raw price units consistently. Do not mix points, pips and quoted prices inside the OHLC rows. For currencies quoted to different decimal places, the formulas still operate in price units; any conversion to pips needs the symbol’s pip size. Metals, indices, crypto and CFDs can have contract and tick conventions that differ materially from spot FX.

Check high, low and close fields against the source before pasting. The calculator rejects a close outside the stated bar range, but it cannot discover a mislabeled timestamp, duplicated candle, daylight-saving shift, weekend rule or missing session. Record symbol, timeframe, time zone, source, dates, parameters and model version with any saved result.

If the level will inform a live order, separately check bid/ask side, current spread, tick size, minimum stop distance, guaranteed-stop rules, slippage, market gaps and position volume. These operational constraints are deliberately kept outside a descriptive entered-data calculator.

Frequently asked questions

  • It builds HL2 basic bands from an ATR multiple, recursively retains or resets final bands using the prior close, and selects the active band from the prior state.
  • Version 1.0.0 seeds with the first-period true-range mean and then uses Wilder recursive smoothing.
  • At the first ATR-ready bar, final bands equal basic bands, the boundary state is down and the active line is the final upper band.
  • When the previous active line was the final upper band, the current close must be strictly above the current final upper band.
  • When the previous active line was the final lower band, the current close must be strictly below the current final lower band.
  • Data, warm-up history, ATR seed, current-bar handling, source field, equality rules and formula variants can differ.
  • No. Up and down are mechanical states in this calculation and are not standalone trade recommendations or forecasts.
  • No. It does not backtest entries, exits, costs, slippage, parameter robustness or out-of-sample performance.

Sources and methodology

The operational contract is Entered Volatility Stop Overlays version 1.0.0. Formula branches, boundary initialization, fixture outputs, validation and the production-isolation guard are tested before a staging release. Source links explain methodology; they do not endorse this site or any trading outcome.

Compare chart feeds and stop-order terms

Before transferring an entered volatility line to execution, compare the broker’s symbol history, quote precision, spreads, commissions, stop-level rules and gap policy. An ATR series calculated from one chart feed need not reproduce exactly on another, and a reference price is not a guaranteed fill.

XM

Review instruments, chart history and account conditions available for your region.

Check XM terms

FBS

Compare symbol specifications, pricing feeds and stop-order conditions.

Check FBS terms

FXOpen

Confirm contract details, tick size, platform history and execution costs.

Check FXOpen terms

Risk and affiliate disclosure: Leveraged forex and CFD trading can result in substantial losses. These are affiliate links, so ForexMT4Indicators.com may receive compensation if you register or trade through them, at no additional cost to you. Availability and terms vary by jurisdiction and broker entity.

Disclaimer: The results from this tool are estimates for educational and informational purposes only and may differ from your broker's figures. This is not financial or investment advice. Trading forex and CFDs carries a high level of risk and can result in the loss of all your capital. Always verify calculations with your broker and trade within your risk tolerance.