QuantsappFaster in the app: live data, alerts, tradingOpen
Log inStart free
Futures · technicalIntradayNIFTYmedium complexity

Self-tuning Supertrend

This intraday NIFTY futures strategy trades Supertrend flips on 5-minute candles, but it does not fix the indicator's settings. Every night it tests 16 period and multiplier pairs on the previous 30 sessions and trades the next day with whichever pair would have made the most points. It only trades on days when the daily ADX says the market is in a strong trend.
Trades intraday Supertrend flips on NIFTY futures only on strong-trend days, re-picking the Supertrend settings each night from the last 30 sessions.
Market viewEither direction (follows the move)
TradesNIFTY near-month futures, 1 lot
RiskOpen-ended (loss not capped by the structure)
CapitalFutures margin
SuitsAdvanced
Trades a month6.2
Typical hold1.1 hours
Profitable months0 of 12
Longest losing run7 trades
Made money inFlat opens (small positive in this test)
Lost money inChoppy wide-range daysOpening gaps of 0.4% or moreNIFTY weekly expiry days
Default settings
Symbol
Periods
Mults
Opt days
ADX n
ADX min
Bar minutes
Entry from
Entry to
Exit time
Lots
Backtest this strategy →Change any setting, pick your own period and run it in the Quantsapp web app. Backtesting is part of the Max plan. Pro+ members can use it now as a free trial.
1

How it trades

What it trades
Universe
NIFTY Intraday · 1 Oct 25 → 30 Sep 26
Enters
Next print after a 5-minute Supertrend flip closing 09:20-15:00
Legs
BUY FUT · Near month · Current month · 1 lotSELL FUT · Near month · Current month · 1 lot
Exits
signal Opposite Supertrend flip (may reverse inside the entry window)time Anything still open at 15:15
Re-entry
Yes, on every flip during the entry window
Bars
5-minute bars (BAR_MINUTES) of the rolled near-month future of SYMBOL, anchored at 09:15, continuous across sessions (as charting platforms draw Supertrend).
Tuning
before each session, every (period, multiplier) pair from PERIODS x MULTS is scored by the points it would have made with the trading rules below over the OPT_DAYS sessions BEFORE that session; the best pair (ties: the first listed) trades the session. Nothing from the session itself is used. A session needs OPT_DAYS / 2 scored sessions behind it.
Filter
no trade in a session whose ADX(ADX_N) on daily bars, as of the previous close, is below ADX_MIN. None on a day SYMBOL is in the F&O ban.
Entry
a bar closing between ENTRY_FROM and ENTRY_TO that flips the Supertrend up -> buy LOTS of the future at the next print; a flip down -> sell. Several trades a day are possible.
Exit
the opposite flip ("supertrend flip") - which also opens the other side while inside the entry window; anything open at EXIT_TIME is squared off ("square-off").
2

Results

PRE-BUILT · DEFAULTS
NIFTY · 2025-10-01 → 2026-09-30 · 75 trades · before costs
Net P&L−₹51,682
Win rate31%
Max drawdown−₹65,416
Avg per trade−₹689
Profit factor0.75
Worst trade−₹10,556
3

Where it made and lost money

Almost every condition lost money in this test, so the evidence mostly shows where it lost most. Choppy days with a wide range but a mid-range close cost ₹30,894 over 38 trades, as Supertrend flipped back and forth. Even trend days, where a trend tool should shine, lost ₹17,518 over 30 trades, because the intraday flips came late and reversed. Opening gaps were costly: gap-up days lost ₹31,207 over 25 trades and gap-down days ₹25,811 over 22. The only positive bucket of size was flat opens, at ₹5,336 over 28 trades. Figures are before costs.

Day of the week
Monday+₹21,72912 trades42% won
Tuesday−₹20,44215 trades27% won
Wednesday−₹43,48528 trades29% won
Thursday−₹4,58910 trades30% won
Friday−₹4,89410 trades30% won
How the entry day opened
Gap up of 0.4% or more−₹31,20725 trades28% won
Flat open+₹5,33628 trades36% won
Gap down of 0.4% or more−₹25,81122 trades27% won
India VIX the evening before
VIX below 11.5 (calm)−₹4,6549 trades33% won
VIX 11.5-14.5 (normal)−₹10,22412 trades25% won
VIX above 14.5 (nervous)−₹36,80354 trades31% won
Kind of session on the entry day
Quiet session (range under 0.75%)−₹3,2707 trades29% won
Trend day (closed near the high or low)−₹17,51830 trades30% won
Choppy day (wide range, closed mid-range)−₹30,89438 trades32% won
Session direction on the entry day
NIFTY closed above its open−₹19,81243 trades33% won
NIFTY closed below its open−₹31,87032 trades28% won
Expiry day (NIFTY weekly)
Expiry day−₹21,02121 trades29% won
Other days−₹30,66154 trades31% won
Trend going in
Uptrend (NIFTY above its 20-day average)−₹21,8209 trades22% won
Downtrend (NIFTY below its 20-day average)−₹29,86166 trades32% won
The same trades, split by the market conditions around each entry, before costs.
4

About this strategy

  1. Before each session, score every Supertrend pair from periods 7, 10, 14, 20 and multipliers 1 to 4 by the points it would have made over the previous 30 sessions; pick the top scorer.
  2. Check the daily ADX(14) as of the previous close. If it is below 30, or the symbol is in the F&O ban, skip the day.
  3. On 5-minute futures candles, when a candle closing between 09:20 and 15:00 flips Supertrend up, buy one lot at the next print; a flip down sells one lot.
  4. The opposite flip closes the trade and, if still inside the entry window, opens the reverse position.
  5. Several trades a day are possible; anything open at 15:15 is squared off.

Why traders use it

Fixed Supertrend settings that worked last quarter often stop working, so adapting them to recent behaviour is an appealing idea. The nightly test uses only past sessions, so there is no peeking at the day being traded. The ADX filter adds a second idea: trend tools do well on trending days and badly in ranges, so the system sits out whenever the daily trend strength is weak.

Works best whenIn this test the only clearly positive condition was a flat open, where NIFTY started near the previous close and developed its direction gradually, giving the 5-minute Supertrend time to catch it.
Struggles whenChoppy sessions and days with an opening gap of 0.4% or more lost the most. Even trend days lost money, as flips on 5-minute candles tended to arrive after the move and reverse soon after.

The year in plain words

With default settings on NIFTY from 1 Oct 2025 to 30 Sep 2026, the ADX filter allowed trading in only three months: March, April and September. Across 75 trades the strategy won 31% and lost ₹51,682 before costs, a profit factor of 0.75. Average wins (₹6,796) were larger than average losses (₹4,000), but there were too few of them. April alone lost ₹26,234. After ₹20 per order and bid-ask slippage the loss grows to ₹68,442. On this year's data, nightly re-tuning did not turn Supertrend flips into an edge.

What the settings do

PeriodsThe Supertrend ATR periods tried each night. A wider list gives the optimiser more choice but also more chances to fit noise.MultsThe Supertrend multipliers tried each night. Low multipliers flip often; high ones flip rarely and hold trends longer.Opt daysHow many past sessions are used to score each pair. A short window adapts quickly; a long one is steadier but slower to change.ADX nThe look-back of the daily ADX used as the trend filter.ADX minThe daily ADX level required before any trade. Lowering it lets the strategy trade on many more days.Bar minutesThe candle length the Supertrend runs on. Shorter candles mean more flips and more costs.Entry fromThe earliest time a signal candle may close and open a trade.Entry toThe last time a signal candle may open a new trade. Flips after it only close positions.Exit timeWhen any open position is squared off for the day.

Risks

  • Re-optimising every night tends to chase whatever worked recently, which may not repeat.
  • With a 31% win rate, long losing streaks are normal and can test discipline.
  • Trading only on high-ADX days means few active months, so results depend on a handful of sessions.
  • Each flip is a full futures lot, so a whipsaw day can produce several losing trades back to back.

Who it suits

Traders curious about adaptive or walk-forward systems who can monitor 5-minute futures signals all day, and who want to study how parameter re-fitting behaves with real data rather than trade it blindly.

5

Questions traders ask

What does self-tuning Supertrend mean?

Instead of fixed settings like Supertrend(10, 3), the strategy re-tests 16 combinations every night on the previous 30 sessions and trades the next day with the best one. Only past sessions are used, so the choice is made the way a trader could have made it in real time.

Is the self-tuning Supertrend strategy profitable?

Not in this test. From 1 Oct 2025 to 30 Sep 2026 on NIFTY futures it lost ₹51,682 before costs and ₹68,442 after ₹20 per order and bid-ask slippage, over 75 trades. Past results do not guarantee future ones, but this period showed no edge.

Why filter with ADX 30?

ADX measures how strong a trend is, regardless of direction. Readings of 30 or more are usually taken as a strong trend. Trend-following tools like Supertrend tend to whipsaw in weak markets, so the filter tries to trade them only when trend strength is high.

Why did it trade in only three months?

Daily ADX on NIFTY stayed below 30 for most of the year, so the filter blocked trading on those days. Only March, April and September had sessions that passed it.

6

Before you rely on it

WATCH OUTnightly brute-force re-optimisation chases noise - the walk-forward scoring keeps it honest but does not make it robust; Supertrend whipsaws in ranges. Gross of costs.
WHERE THE RULES WERE UNCLEAR · OUR CHOICES- The source scans the source screener list of cash stocks and brute-forces the parameters nightly without saying on what objective or grid. Spec interpretation: grid period 7-20 x multiplier 1-4, objective = the last 30 sessions' P&L. The grid is kept small (4 x 4) so a year stays well inside the server's time limit. - The scoring is walk-forward: pair scores for a session are sums over strictly earlier sessions. Scoring fills at the signal bar's close (cheap and close enough to rank pairs); the trades themselves fill at the next print after the bar closes. - Sessions are scored whatever their ADX (more data to rank on); only the trading is ADX-gated. - Default NIFTY futures; set SYMBOL to an F&O stock to trade its future (the source traded cash). - Rolled series: the Supertrend is computed on a roll-adjusted copy (every price after a roll shifted by the jump between the old contract's last print and the new one's first), so a roll never reads as a flip (known SDK gap: the rolled series is unadjusted). The daily ADX still sees the roll jump on the session after an expiry.
Backtests run on historical NSE data with fills at the last traded price. "Before costs" excludes brokerage, taxes and slippage. Quantsapp is not recommending any strategy; it is just a backtesting utility. Past results are not a promise of future returns.

Log in or sign up

Enter your mobile number. New to Quantsapp? The same OTP creates your free account.

+91

By continuing you agree to the Terms of Use and Privacy Policy.