QuantsappFaster in the app: live data, alerts, tradingOpen
Log inStart free
Stock F&OPositionalAXISBANKlow complexity

Pair ratio density trade

This is the simplest form of pair trading: no regression, just the ratio of one stock's price to another's. The ratio of AXISBANK to ICICIBANK futures is placed on a normal density curve built from its last 500 sessions. When it lands in the far tail, the strategy bets the ratio will drift back towards its average, buying the cheap stock and selling the rich one in equal rupee amounts.
Tracks the price ratio of AXISBANK to ICICIBANK futures and trades it when the ratio falls into the far tail of its two-year range, buying the cheap stock and selling the rich one.
Market viewFades moves (mean reversion)
TradesAXISBANK and ICICIBANK near-month futures, rupee-matched
RiskOpen-ended (loss not capped by the structure)
CapitalFutures margin
SuitsIntermediate
Trades a month0
Typical hold
Profitable months0 of 12
Longest losing run0 trades
Made money inNo evidence: the rules never triggered in the year
Lost money inNo evidence: zero trades to split by condition
Default settings
Symbol
Symbol b
Entry cdf
Stop cdf
Exit cdf
Time stop days
Min return corr
Jump guard %
Exec time
Roll time
Lots a
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
AXISBANK Positional · 1 Oct 25 → 30 Sep 26
Enters
09:20 next session after the ratio closes in its 2.5% tail but not beyond 0.3%
Legs
BUY FUT · Near month (cheap stock by the ratio) · Current month · 1 lotSELL FUT · Near month (rich stock, rupee-matched lots) · Current month · 1 lot
Exits
target Ratio back inside about 1 standard deviation; closed 09:20 next sessionstop Ratio beyond about 3 standard deviations; closed 09:20 next sessionroll Both legs closed 15:15 on monthly expiry, reopened next session at 09:20
Re-entry
Yes - a fresh signal once the previous pair trade has closed
Ratio
ratio = A's near-month futures close / B's, per session. Over the last LOOKBACK_DAYS ratios (as of the previous close): mean, standard deviation, and cdf = the normal distribution value of the latest ratio (Excel NORM.DIST) - where the ratio sits on its density curve.
Filter
the two stocks' daily RETURNS must correlate at least MIN_RETURN_CORR over the same window (price correlation is not enough); no window with a one-day ratio move above JUMP_GUARD_PCT % (a split or bonus in unadjusted futures prices); no new entry while either stock is in the F&O ban.
Entry
STOP_CDF <= cdf <= ENTRY_CDF (2nd-3rd deviation BELOW the mean) -> long the pair: buy LOTS_A lots of A, sell B worth the same rupees (whole lots); 1 - ENTRY_CDF <= cdf <= 1 - STOP_CDF -> short the pair. Signal at the close, executed at EXEC_TIME of the next session; both legs are ONE position (tagged long / short pair).
Exit
target - long: cdf >= EXIT_CDF; short: cdf <= 1 - EXIT_CDF (back inside about one deviation). stop - long: cdf < STOP_CDF; short: cdf > 1 - STOP_CDF (beyond three deviations). time - TIME_STOP_DAYS sessions after entry (0 = off). All executed at EXEC_TIME the next session.
Roll
stock futures cannot be held past their monthly expiry: on the expiry day both legs close at ROLL_TIME and the trade re-opens (same side, re-sized) at the next session's EXEC_TIME.
2

Results

PRE-BUILT · DEFAULTS
No trades in this periodThe rules never triggered with the default settings in the sample year.
3

Where it made and lost money

There is no evidence to split here. On default settings the strategy took no trades between 1 Oct 2025 and 30 Sep 2026, so nothing can be said about how it fared against the NIFTY market backdrop, whether by India VIX, session type or trend. The cause is the narrow entry band: the AXISBANK/ICICIBANK ratio had to close in the outer 2.5% of its two-year density curve, but not past the 0.3% stop level, on a day the stocks' returns also correlated at 0.7 or more. That combination did not occur in this year.

The same trades, split by the market conditions around each entry, before costs.
4

About this strategy

  1. Each evening, divide AXISBANK's near-month futures close by ICICIBANK's and measure the ratio's average and standard deviation over the last 500 sessions.
  2. Turn today's ratio into a percentile on the normal curve (its cumulative probability).
  3. Check the filters: daily returns of the two stocks must correlate at 0.7 or more, the window must have no one-day ratio jump above 15%, and neither stock may be in the F&O ban.
  4. If the ratio sits between the 0.3% and 2.5% percentiles, buy 1 lot of AXISBANK and sell ICICIBANK lots of about the same rupee value at 09:20 next session; at the mirror-image top tail, do the reverse. Both legs sit in one position.
  5. Close at 09:20 once the ratio is back inside about one standard deviation (target) or beyond about three (stop).
  6. On monthly expiry both legs close at 15:15 and reopen, re-sized, in the next month at 09:20 the following session.

Why traders use it

A price ratio is easy to chart and easy to explain: if AXISBANK usually trades at a steady fraction of ICICIBANK, an unusual reading suggests one has run ahead of the other. Putting the ratio on a density curve turns that into clear entry, target and stop bands. The method needs no statistics package, which is why it is widely taught to Indian traders as a first step into pair trading with stock futures.

Works best whenIn principle, when two stocks keep a steady price ratio and short-lived divergences push it into the tail and then back. This test produced no trades, so it offers no evidence on which market conditions suit it.
Struggles whenWhen the ratio stays within its usual range, as AXISBANK/ICICIBANK did throughout this year, nothing triggers. If a trade were open, a lasting change in the two banks' relative value would drag the ratio to the stop.

The year in plain words

On default settings from 1 Oct 2025 to 30 Sep 2026 the ratio trade on AXISBANK and ICICIBANK made no trades, so there is no profit or loss before or after costs. The code re-measures the ratio every session and opens a pair only when it sits between the 0.3% and 2.5% tail of its 500-session curve, with return correlation of at least 0.7. In this year the ratio never closed in that band with the filters passing. This means the rule set was untested on this pair over the year, not that it worked or failed.

What the settings do

Symbol bThe second stock of the pair, the ratio's denominator. It should be a closely related name in the same sector with stock futures.Lookback daysHow many sessions of ratios set the average and standard deviation. A shorter window adapts faster and may put recent readings in the tail more often.Entry cdfHow far into the tail the ratio must be to open a trade. Raising it, say to 0.05, widens the entry band and loosens the gate that kept this run flat.Stop cdfThe outer edge of the entry band and the stop level, about three standard deviations. A ratio already beyond it does not open a trade.Exit cdfWhere the trade takes profit: by default once the ratio is back inside about one standard deviation of its average.Time stop daysCloses the trade after this many sessions if neither target nor stop is hit. Zero, the default, switches it off.Min return corrThe least correlation of daily returns the two stocks need over the window. Lowering it lets less closely linked periods qualify.Jump guard %Skips windows with a one-day ratio move larger than this, which usually signals a split or bonus in unadjusted futures prices.Exec timeThe time next morning at which entries, exits and post-roll re-entries are placed.Roll timeThe time on monthly expiry day at which both legs are closed before reopening in the next month.Lots aLots of AXISBANK futures per trade; ICICIBANK lots are chosen to match its rupee value as closely as whole lots allow.

Risks

  • A ratio far from its two-year average may reflect a real change in the businesses, and the trend can continue to the three-deviation stop.
  • Whole-lot sizing means the rupee values of the two legs rarely match exactly, leaving some net market exposure.
  • The time stop is off by default, so a trade drifting between target and stop can stay open for months, rolling at each expiry.
  • Each round trip is four futures orders, plus four more at every monthly roll, so costs add up.

Who it suits

Traders who want a simple, chart-friendly introduction to pair trading with stock futures, have margin for two futures positions at once, and are prepared for long spells with no signal.

5

Questions traders ask

Is the ratio pair trade profitable on AXISBANK and ICICIBANK?

This test cannot say. With default settings it made zero trades from 1 Oct 2025 to 30 Sep 2026 because the ratio never reached the 2.5% tail of its two-year curve while the filters passed, so there was no profit or loss before or after costs. Past results, or the lack of them, do not guarantee anything about future ones.

How is the ratio method different from regression pair trading?

Regression methods fit a hedge ratio and trade the leftover residual. The ratio method simply divides one price by the other and asks how unusual today's reading is against its own history. It is easier to follow but assumes the two stocks should be held in equal rupee amounts.

What does the density curve tell you?

The ratio's past 500 readings give an average and a standard deviation. Placing today's ratio on a normal curve with those values gives a percentile: 2.5% means only about one reading in forty would be expected this low. The strategy enters in that tail, takes profit near one deviation and stops beyond about three.

How can I make the strategy trade more often?

Raise the entry percentile, lower the return-correlation filter, shorten the lookback, or choose a different second stock. Each widens the set of days that qualify. None of them says whether the extra trades would make money.

6

Before you rely on it

WATCH OUTthe author admits his example trades did not strictly meet the entry ranges; whole lots break rupee neutrality; corporate actions shift the ratio in unadjusted prices; four fills per round trip plus rolls. Gross of costs.
WHERE THE RULES WERE UNCLEAR · OUR CHOICES- The source's tables carry acknowledged typos and the lookback only appears in comments: two years (LOOKBACK_DAYS 500 sessions), exit inside one deviation (cdf 0.16 / 0.84), stop at 3 deviations (spec). - Rupee-neutral means the B lots whose notional is closest to A's (lot sizes from the exchange's table on the trade date); the residual is reported, not hedged. The ratio is rolling - re-measured every session. - Signals use the previous close and trade the next morning, so no close is used before it is known.
Also known aswhistler ratio pair
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.