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

Zero-lag EMA cross

Moving-average crossovers are slow because averages lag price. A zero-lag, or error-correcting, EMA adds a correction term that pulls the average toward the latest price, so it turns sooner. This strategy pits that fast line against an ordinary 69-bar EMA on 15-minute NIFTY futures bars. It is always in the market: long while the zero-lag line is above, short while it is below.
Holds one NIFTY futures lot at all times on 15-minute bars: long when a zero-lag EMA is above a 69-bar EMA, short when below, reversing on every cross.
Market viewEither direction (follows the move)
TradesNIFTY near-month futures, 1 lot, long or short
RiskOpen-ended (loss not capped by the structure)
CapitalFutures margin
SuitsIntermediate
Trades a month9.7
Typical hold2 days
Profitable months5 of 12
Longest losing run9 trades
Made money inNIFTY moving more than 1% either way while heldTrend days that close near the high or lowCalm evenings with India VIX below 11.5
Lost money inNIFTY staying within ±1% while heldChoppy days with a wide range that close mid-rangeIndia VIX in the normal 11.5-14.5 band
Default settings
Symbol
Length
Gain limit
Bar minutes
Stop points
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 Intraday · 1 Oct 25 → 30 Sep 26
Enters
Next print after a 15-min bar where the zero-lag EMA crosses the 69-bar EMA
Legs
BUY FUT · near month · Current month · 1 lotSELL FUT · near month · Current month · 1 lot
Exits
signal opposite cross reverses the positionroll 15:15 on futures expiry day, reopen next session
Re-entry
Always in the market; every cross flips the side
Bars
15-minute bars (BAR_MINUTES) of the rolled near-month future, anchored at 09:15, continuous across sessions.
Lines
EMA = the LENGTH-bar exponential average of the close (alpha = 2 / (LENGTH + 1)). EC (error-correcting EMA) = alpha x (EMA + g x (close - previous EC)) + (1 - alpha) x previous EC, where the gain g is chosen each bar from -GAIN_LIMIT/10 .. +GAIN_LIMIT/10 in steps of 0.1 to make |close - EC| smallest (Ehlers' "zero lag, well almost").
Entry
a bar closing with EC above EMA after closing below it -> buy LOTS of the near-month future at the next print; EC crossing below EMA -> sell. Always in: each cross closes the open side and opens the other.
Stop
optional STOP_POINTS (0 = off) - a points stop on each side; after it fires the system waits flat for the next cross.
Roll
a future cannot be held past its monthly expiry: on the expiry day the side is closed at ROLL_TIME ("monthly roll") and re-opened on the new near month at the next session's first print.
End
whatever is open is closed at the last print of the test window.
2

Results

PRE-BUILT · DEFAULTS
NIFTY · 2025-10-01 → 2026-09-30 · 116 trades · before costs
Net P&L+₹17,974
Win rate30%
Max drawdown−₹2,57,575
Avg per trade+₹155
Profit factor1.02
Worst trade−₹31,245
3

Where it made and lost money

This is a classic trend follower, and in this test it lived or died by whether NIFTY moved. Trades during which NIFTY fell more than 1% made ₹4,11,460 over 17 trades, and those during a rise of more than 1% made ₹1,20,450: the system caught the swing and stayed with it. The 57 trades during which NIFTY moved less than 1% lost ₹3,63,391, winning only 21%, because in a range the two averages cross back and forth and each reversal is a small loss. Entries on trend days made ₹1,04,801, while choppy days lost ₹81,061. Calm evenings with India VIX below 11.5 made ₹1,51,018.

Market while the trade was held
NIFTY rose over 1% while held+₹1,20,45016 trades44% won
NIFTY within ±1% while held−₹3,63,39157 trades21% won
NIFTY fell over 1% while held+₹4,11,46017 trades76% won
Session direction on the entry day
NIFTY closed above its open−₹2,58,31059 trades19% won
NIFTY closed below its open+₹2,76,28457 trades42% won
India VIX the evening before
VIX below 11.5 (calm)+₹1,51,01824 trades42% won
VIX 11.5-14.5 (normal)−₹1,03,34658 trades26% won
VIX above 14.5 (nervous)−₹29,69934 trades29% won
Trend going in
Uptrend (NIFTY above its 20-day average)−₹88,84156 trades34% won
Downtrend (NIFTY below its 20-day average)+₹1,06,81560 trades27% won
Kind of session on the entry day
Quiet session (range under 0.75%)−₹5,76648 trades31% won
Trend day (closed near the high or low)+₹1,04,80135 trades37% won
Choppy day (wide range, closed mid-range)−₹81,06133 trades21% won
Expiry day (NIFTY weekly)
Expiry day−₹45,85019 trades32% won
Other days+₹63,82497 trades30% won
Day of the week
Monday−₹12,30420 trades25% won
Tuesday−₹45,85019 trades32% won
Wednesday+₹32,87133 trades27% won
Thursday+₹24,39816 trades38% won
Friday+₹60,05626 trades35% won
How the entry day opened
Gap up of 0.4% or more+₹12,62829 trades21% won
Flat open+₹9,64869 trades32% won
Gap down of 0.4% or more−₹4,30318 trades39% won
The same trades, split by the market conditions around each entry, before costs.
4

About this strategy

  1. Build 15-minute bars of the NIFTY near-month future from 09:15, adjusted so that monthly rolls do not create false jumps.
  2. Compute a 69-bar EMA and the zero-lag EMA, whose correction gain is chosen each bar between −2.2 and +2.2 to keep it as close to price as possible.
  3. When a bar closes with the zero-lag EMA crossing above the EMA, buy one lot at the next price; when it crosses below, sell one lot.
  4. On every new cross, close the current position and take the opposite side.
  5. On the monthly futures expiry day, close at 15:15 and reopen the same side in the new contract next session.
  6. No target and, by default, no stop.

Why traders use it

Trend followers want to catch big moves early and stay in them. Reducing the lag of the fast average means entering turns sooner, and comparing it with a slower average keeps the system on the right side of sustained swings. An always-in design never misses a move. The trade-off is well known: in sideways markets the lines cross often, and each crossing costs a little. Traders accept those small losses in exchange for occasional large wins.

Works best whenIn this test, stretches when NIFTY moved more than 1% while a position was held, in either direction, and entries on trend days that closed near their high or low. Calm periods with India VIX below 11.5 also did well, often ahead of a clean move.
Struggles whenRange-bound stretches when NIFTY moved less than 1% during a trade, and choppy days with wide swings that closed mid-range, where the averages crossed repeatedly and every reversal took a small loss.

The year in plain words

On NIFTY futures from 1 Oct 2025 to 30 Sep 2026 with default settings, the system made 116 trades, including 12 monthly rolls, and won only 30%. A few large wins, the biggest ₹1,36,923, offset many small losses, leaving ₹17,974 before costs and a profit factor of 1.02. The swings were large: March made ₹1,44,656 and September ₹89,570, while May lost ₹1,07,107 and February ₹95,840, with a ₹2,57,575 maximum drawdown. After ₹20 per order and bid-ask slippage, the result became an ₹18,125 loss.

What the settings do

LengthThe number of bars in both averages. Longer lengths cross less often and follow bigger trends.Gain limitHow far the zero-lag correction may push the fast line toward price; the range is plus or minus this value divided by ten. Larger limits make the fast line hug price more closely.Bar minutesThe bar length. Shorter bars give more crosses and more reversals.Stop pointsAn optional stop in NIFTY points on each position; 0 turns it off. After a stop the system waits flat for the next cross.Roll timeThe time on the futures expiry day when the position is closed before reopening in the next contract.

Risks

  • Being always in means sitting through every adverse swing until the next cross, with no stop by default.
  • Win rates around 30% bring long losing streaks, up to nine in a row in this test.
  • Each reversal costs two orders' worth of spread and brokerage, which turned this year's small profit into a loss.
  • Drawdowns of over ₹2.5 lakh on one lot need deep pockets and patience.

Who it suits

Systematic futures traders who accept low win rates and large drawdowns in exchange for riding big moves, with futures margin and the discipline to follow every reversal.

5

Questions traders ask

What is a zero-lag EMA?

It is an exponential moving average with an error-correction term. Each bar, the average is nudged toward the latest price by a gain chosen to minimise the gap between the two. The result turns faster than a normal EMA while still smoothing noise.

Is the zero-lag EMA crossover strategy profitable?

In this backtest on NIFTY futures from 1 Oct 2025 to 30 Sep 2026 it made ₹17,974 before costs but lost ₹18,125 after ₹20 per order and bid-ask slippage (statutory charges not included). Past results do not guarantee future ones.

Why does a crossover system lose in sideways markets?

In a range, price keeps crossing back and forth around the averages, so the lines cross often. Each cross reverses the position after only a small move, and most of those reversals lose a little, especially once costs are counted.

Why adjust prices for the monthly roll?

The next month's future trades at a different price from the expiring one. Without adjustment, that jump at each rollover could look like a sudden move and trigger a false cross. Adjusting the indicator series removes it, while trades still use real prices.

6

Before you rely on it

WHERE THE RULES WERE UNCLEAR · OUR CHOICES- The author's rules are only in an AFL download; LENGTH 69 and GAIN_LIMIT 22 are a commenter's values (spec). - The commenter's 10-point stop "made results too good to be true" - most likely bar-close fills inside the bar; here a stop fills at the print that crosses it, and it is OFF by default. signals are known at the bar close and filled at the next print, never at that close. Known pitfalls: an always-in cross system whipsaws in ranges and pays the spread on every reversal. Gross of costs.
Also known asehlers zero lag EMAZLEMA
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.