StrategyLab

Pullback in an uptrend

Only buy dips in stocks that are already trending up: above the 200-day average, down 4% in 5 days.

Swing trading1 to 4 weeksIntermediateTested on 10 stocks & indices

₹1 lakh in HDFCBANK, Nov 2011 → Nov 2026

19 Nov 2011 → 19 Nov 2026
Buy & hold Best
₹8.42 L
XIRR 15.3% · Worst fall −41.1%
Pullback in uptrend
₹4.68 L
XIRR 10.8% · Worst fall −14.4% · 25 trades, 68% won
₹0₹2.5L₹5L₹7.5L₹10L20112013201520172019202120232025
Money investedPullback in uptrendBuy & hold

The idea

“Buy the dip” works better when the trend is on your side. This setup waits for a stock that is above its 200-day moving average (a long-term uptrend) to fall sharply for a few days, then buys the pullback and exits quickly.

The rules

Trend filter
Close is above the 200-day simple moving average
Buy
Price has fallen 4% or more over the last 5 trading days
Sell
Up 8% (target) or down 6% (stop-loss)
Size
All capital, one trade at a time; idle cash earns 6%
Prompt to paste in the Lab

₹1 lakh in HDFCBANK. Buy when it is above its 200-day average and has fallen 4% or more in 5 trading days. Sell at +8% or -6%. Idle cash earns 6%, 0.2% cost per trade. Compare with buy and hold, last 15 years.

Test it in the Lab

Verdict across 10 stocks and indices

One stock can flatter any rule. The same rules on more names show whether it is an edge or luck.

0/10higher XIRR than buy & hold
10/10smaller worst fall

Pullback in uptrend: on average 6.53 points a year worse than buy & hold on XIRR, with a worst fall 25.8 points smaller.

Stock / indexBuy & holdPullback in uptrendTradesWonTime in market
XIRRWorst fallXIRRWorst fall
NIFTY5011.8%−38.4%8.3%−13.3%1567%18%
BANKNIFTY14.2%−47.9%5.5%−18.5%2548%22%
RELIANCE15.3%−45.1%3.6%−37.6%4949%42%
HDFCBANK15.3%−41.1%10.8%−14.4%2568%32%
ICICIBANK19.3%−51.5%18.6%−20.7%5761%33%
TCS12.9%−53.4%7.8%−21.6%4652%36%
INFY11.1%−48.2%4.5%−25.8%3754%27%
SBIN15.2%−59.5%1.1%−35.7%5242%33%
ITC9.2%−55.3%8.4%−16.4%3256%31%
LT16.2%−54.4%6.5%−32.4%4850%32%

Each row is a separate backtest, 19 Nov 2011 → 19 Nov 2026. Green marks the best value in the row. Worst fall is the maximum drawdown: the largest drop from a peak in portfolio value.

Real trades, real dates

From the HDFCBANK backtest above: the median winner and loser. Exits are checked on closing prices, so a gap can push a loss past the stop-loss.

A typical winning trade

Bought HDFCBANK9 Jul 2024at ₹794.20
79 days
Sold26 Sep 2024at ₹865.52

₹3,99,963 in → ₹4,34,138 out · +8.5% after costs

A typical losing trade

Bought HDFCBANK10 Jul 2019at ₹555.20
20 days
Sold30 Jul 2019at ₹523.48

₹2,52,429 in → ₹2,37,056 out · −6.1% after costs

Last 8 trades
BoughtPriceSoldPriceDaysResult
1 Sep 2025₹935.132 Mar 2026₹865.09182−7.9%
10 Jan 2025₹804.0325 Mar 2025₹883.9674+9.5%
23 Dec 2024₹874.039 Jan 2025₹809.3917−7.8%
4 Oct 2024₹804.4728 Nov 2024₹870.2255+7.7%
9 Jul 2024₹794.2026 Sep 2024₹865.5279+8.5%
12 May 2023₹789.4325 Sep 2023₹732.99136−7.5%
11 Jan 2023₹753.035 May 2023₹769.48114+1.8%
29 Oct 2021₹740.6129 Nov 2021₹702.4331−5.5%

Tends to work

  • Steady compounders in long uptrends (private banks, FMCG)
  • Normal corrections inside a bull market

Tends to fail

  • Volatile PSU and cyclical stocks, where a 4% fall is routine noise
  • The first leg of a real crash, before the 200-day filter switches off

Make it yours

Click one to open it in the Lab, or write your own twist in plain English.

Assumptions and the exact spec the engine ran
  • ₹1,00,000 invested once; each trade uses all available cash
  • 0.2% cost on every buy and every sell (STT, brokerage, exchange charges, stamp duty)
  • Cash waiting between trades earns 6% a year, like a liquid fund
  • Prices are daily closes; indices are price indices (no dividends), stock prices include dividends
  • Taxes are not deducted
  • Signals are filled at the next day's close.
  • The stock list is today's, so stocks that were delisted or shrank are missing (survivorship bias).
{
  "title": "Pullback in uptrend: HDFCBANK",
  "years": 15,
  "cost_pct": 0.2,
  "assumptions": [
    "₹1,00,000 invested once; each trade uses all available cash",
    "0.2% cost on every buy and every sell (STT, brokerage, exchange charges, stamp duty)",
    "Cash waiting between trades earns 6% a year, like a liquid fund",
    "Prices are daily closes; indices are price indices (no dividends), stock prices include dividends",
    "Taxes are not deducted"
  ],
  "strategies": [
    {
      "name": "Buy & hold",
      "symbol": "HDFCBANK",
      "contribution": {
        "amount": 100000,
        "every": "once"
      },
      "buy": {
        "when": "on_contribution"
      }
    },
    {
      "name": "Pullback in uptrend",
      "symbol": "HDFCBANK",
      "contribution": {
        "amount": 100000,
        "every": "once"
      },
      "cash_interest_pct": 6,
      "buy": {
        "when": "signal",
        "check": "daily",
        "condition": {
          "type": "all",
          "conditions": [
            {
              "type": "vs_sma",
              "days": 200,
              "op": ">",
              "value": 0
            },
            {
              "type": "change",
              "over": {
                "days": 5
              },
              "op": "<=",
              "value": -0.04
            }
          ]
        },
        "amount": "all_cash"
      },
      "sell": {
        "check": "daily",
        "condition": {
          "type": "any",
          "conditions": [
            {
              "type": "position_return",
              "op": ">=",
              "value": 0.08
            },
            {
              "type": "position_return",
              "op": "<=",
              "value": -0.06
            }
          ]
        },
        "fraction": 1
      }
    }
  ]
}

Keep researching

All strategies