QuantsappFaster in the app: live data, alerts, tradingOpen
Log inStart free
Open Backtesting →
Futures · technicalPositionalNIFTYlow complexity

ADX-gated MACD and Supertrend

Trend indicators work well in trends and poorly in ranges. This daily NIFTY futures strategy uses ADX, a measure of trend strength, as an on-off switch for two separate signals. A MACD signal-line cross and a Supertrend(10, 3) flip each trade their own lot, but only when ADX(14) is above 25. As soon as ADX closes below 25, everything is closed at the next open.
Trades NIFTY futures on daily MACD crosses and Supertrend flips, one lot each, only while daily ADX is above 25, and goes flat once ADX drops below 25.
Market viewEither direction (follows the move)
TradesNIFTY near-month futures, up to 2 lots, held days
RiskOpen-ended (loss not capped by the structure)
CapitalFutures margin
SuitsIntermediate
Trades a month0.2
Typical hold11 days
Profitable months2 of 12
Longest losing run0 trades
Made money inToo few trades to judge (3 in the year)
Lost money inToo few trades to judge (3 in the year)
Default settings
Symbol
ADX period
ADX min
Macd fast
Macd slow
Macd signal
St period
St mult
Roll 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 Positional · 1 Oct 25 → 30 Sep 26
Enters
Next open after a daily MACD cross or Supertrend flip while ADX(14) is above 25
Legs
BUY FUT · Near month · Current month (rolled at expiry) · 2 lotsSELL FUT · Near month · Current month (rolled at expiry) · 2 lots
Exits
signal ADX closes below 25: all closed next opensignal opposite signal of the same book reverses itroll closed 15:15 on futures expiry, reopened next open
Re-entry
Next signal while ADX is above 25
Bars
daily bars of the rolled near-month future (bt.daily). ADX(ADX_PERIOD) is the built-in Wilder ADX.
MACD
line = EMA(MACD_FAST) - EMA(MACD_SLOW) of the closes (built-in EMAs), signal = EMA(MACD_SIGNAL) of the line. Line crosses above the signal -> long, below -> short.
Supertrend
ST_PERIOD / ST_MULT on the daily bars; a flip up -> long, a flip down -> short.
Entry
a signal on a close where ADX > ADX_MIN opens (or reverses) that signal's own book - LOTS for the MACD book and LOTS for the Supertrend book - at the next session's first tick. Signals while ADX is at or below ADX_MIN are ignored; a book waits for its next signal.
Exit
a close with ADX < ADX_MIN -> both books are closed at the next session's first tick ("ADX below"). An opposite signal of the same book (with ADX > ADX_MIN) reverses that book.
Roll
on the futures expiry day each open book is closed at ROLL_TIME ("monthly roll") and re-opened on the new near month at the next session's first tick.
End
closed at the last tick of the test window.
2

Results

PRE-BUILT · DEFAULTS
NIFTY · 2025-10-01 → 2026-09-30 · 3 trades · before costs
Net P&L+₹1,33,315
Win rate100%
Max drawdown₹0
Avg per trade+₹44,438
Profit factor–
Worst trade₹0
3

Where it made and lost money

With three trades, the evidence cannot separate good conditions from bad. All three won. The two trades held while NIFTY rose more than 1% made ₹1,29,688 together, and the one held while NIFTY stayed within 1% made ₹3,627. This fits the design: the ADX gate keeps the system out of the market unless a strong trend is already under way, and the exit fires as soon as that trend strength fades, so the few trades it takes are concentrated in powerful moves. The cost of that selectivity is that most of the year passed without a position.

India VIX the evening before
VIX 11.5-14.5 (normal)+₹3,6271 trades100% won
VIX above 14.5 (nervous)+₹1,29,6882 trades100% won
Kind of session on the entry day
Trend day (closed near the high or low)+₹99,4631 trades100% won
Choppy day (wide range, closed mid-range)+₹33,8522 trades100% won
Market while the trade was held
NIFTY rose over 1% while held+₹1,29,6882 trades100% won
NIFTY within ±1% while held+₹3,6271 trades100% won
How the entry day opened
Flat open+₹3,6271 trades100% won
Gap down of 0.4% or more+₹1,29,6882 trades100% won
Session direction on the entry day
NIFTY closed above its open+₹1,03,0902 trades100% won
NIFTY closed below its open+₹30,2251 trades100% won
Trend going in
Uptrend (NIFTY above its 20-day average)+₹33,8522 trades100% won
Downtrend (NIFTY below its 20-day average)+₹99,4631 trades100% won
Expiry day (NIFTY weekly)
Expiry day+₹99,4631 trades100% won
Other days+₹33,8522 trades100% won
Day of the week
Tuesday+₹99,4631 trades100% won
Wednesday+₹3,6271 trades100% won
Thursday+₹30,2251 trades100% won
The same trades, split by the market conditions around each entry, before costs.
4

About this strategy

  1. Use daily bars of the near-month NIFTY future to compute ADX(14), MACD(12, 26, 9) and Supertrend(10, 3).
  2. MACD book: when the MACD line crosses above its signal line on a day ADX is above 25, buy one lot at the next open; a cross below goes short one lot.
  3. Supertrend book: when Supertrend flips up on a day ADX is above 25, buy a separate lot at the next open; a flip down goes short.
  4. Signals on days when ADX is 25 or lower are ignored. Signals on the first session after a futures expiry are ignored too, since the roll jump can fake them.
  5. When ADX closes below 25, close both books at the next session's first tick. An opposite signal with ADX above 25 reverses that book.
  6. On the monthly futures expiry, open books are closed at 15:15 and reopened in the next month at the next open.

Why traders use it

MACD and Supertrend are two of the most widely used trend tools, but both produce many false signals in sideways markets. ADX measures whether a trend is strong regardless of its direction, so requiring it above 25 is meant to keep the signals for trending periods only. Closing everything when ADX fades means the strategy steps aside as soon as the trend weakens, instead of waiting for the opposite signal. Two independent books let the faster and slower signal each contribute.

Works best whenToo few trades to judge from the evidence. In this test, the trades that made the most were held through rises of more than 1%, during the strong April 2026 trend, which is what the ADX gate is designed to wait for.
Struggles whenNot seen in this test, since all three trades won. By design, sideways markets keep it flat, and a sharp reversal while ADX is still above 25 would be absorbed in full until a reverse signal or the ADX exit.

The year in plain words

On NIFTY futures from 1 Oct 2025 to 30 Sep 2026 with default settings, the ADX gate kept the strategy out of the market for most of the year: it took only three trades, in February and April 2026, and all three won. It made ₹1,33,315 before costs and ₹1,32,298 after ₹20 per order and bid-ask slippage. One trade alone made ₹99,463, and April contributed ₹1,29,688. All three exits were triggered by ADX falling below 25, and the median hold was 11 days. Three trades are far too few to judge, and the result rests almost entirely on one strong April trend.

What the settings do

ADX periodThe number of days in the ADX. A shorter period reacts faster to changes in trend strength.ADX minThe ADX level above which signals are taken and below which everything is closed, from 20 to 30. A lower level trades more often in weaker trends.Macd fastThe fast EMA of the MACD line.Macd slowThe slow EMA of the MACD line.Macd signalThe EMA of the MACD line used as the signal line; crosses of the two trigger the MACD book.St periodThe ATR period of the daily Supertrend.St multThe ATR multiple of the Supertrend band. A larger value flips less often.Roll timeWhen open books are closed on the futures expiry day before being reopened in the next month.

Risks

  • Only three trades in a year means the result depends on one or two trends and cannot be relied on.
  • With two books, the position can reach two futures lots in the same direction, doubling exposure.
  • Positions are held for days, and overnight gaps can move a full lot sharply before the next-open exit.
  • ADX lags, so the exit can come well after a trend has already reversed.

Who it suits

Patient positional traders who are content to stay flat for months and act only in strong trends, with margin for up to two NIFTY futures lots. It is suited to those testing trend filters rather than trading frequently.

5

Questions traders ask

How is ADX used to filter MACD and Supertrend?

ADX measures trend strength from 0 to 100 without regard to direction. Here, MACD and Supertrend signals are taken only when daily ADX is above 25, which is read as a trending market. When ADX closes below 25, all positions are closed at the next open.

Is the MACD Supertrend ADX strategy profitable?

In this backtest on NIFTY futures from 1 Oct 2025 to 30 Sep 2026 it made ₹1,33,315 before costs and ₹1,32,298 after ₹20 per order and bid-ask slippage, from three winning trades. Statutory charges were excluded. Three trades are too few to judge, and past results do not guarantee future ones.

Why did it trade only three times?

Daily ADX on NIFTY spends much of its time below 25, and a signal also had to occur while it was above that level. Most MACD crosses and Supertrend flips in the year happened during weaker trends and were ignored by the filter.

Can it be used on stocks?

Yes. Setting the symbol to an F&O stock trades that stock's near-month future on the server. Stock futures have different lot sizes and volatility, so the number of trades and the results will differ from NIFTY.

6

Before you rely on it

ADAPTED FOR TODAY'S NSE RULES- The source tests NIFTY 50 stocks (cash / stock futures). The library default is NIFTY index futures; set SYMBOL to a stock on the server (it has stock futures; local data is NIFTY only). - Parameters and the threshold are not stated in the source; ADX(14) > 25, MACD(12, 26, 9), Supertrend(10, 3) per the spec, one lot per signal type (so the net position is -2 .. +2 lots). - Decisions are on the daily close and act at the next session's first tick (never at the signal close). - The rolled future jumps at each monthly roll and the daily indicators are unadjusted. A MACD cross or Supertrend flip printed on the first session after a futures expiry is ignored (it may be the roll jump, not a move); the ADX gate is still applied that day.
WATCH OUTsurvivorship bias (today's NIFTY 50 list) and an unrealistic 1-2% commission assumption. Daily signals are rare: a 2-week window may not trade. Gross of costs.
Also known asMACD supertrend ADX
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.