Register
Strategy guide

Automated Swing & Delivery Stock Trading Engine

Swing trading holds positions for a few days to a few weeks, aiming to capture one leg of a larger move. It sits between intraday trading and long-term investing: positions avoid the noise of minute-by-minute charts but are not held for years. A rule-based swing strategy on NSE stocks defines the setups, entries, stops and exits exactly, so it can be tested and automated.

QuantPower Research · Updated 14 Nov 2026 · 18 min read

This guide covers where swing trading came from, the main swing setups, a complete rule set, two worked examples, the risks of holding overnight, delivery, margin, costs and tax, position sizing, and how to scan, test and automate a swing strategy. The rules shown are examples for you to test and change, not recommendations.

Swing trading at a glance

Positional swing trading
Holding periodA few days to a few weeks
InstrumentsLiquid NSE stocks and ETFs; index and stock futures
CandlesDaily for the setup, sometimes hourly for the entry
SetupsPullbacks in uptrends, breakouts from a base, short-term mean reversion
StopsBelow the swing low, or a multiple of ATR
ExitsA target in multiples of the risk, a trailing stop, or a time limit
Main riskOvernight and weekend gaps
SettlementT+1 for shares bought for delivery

A short history of swing trading

The idea of riding one swing of a larger move is older than charts on screens. In 1923, Edwin Lefèvre's thinly disguised account of the trader Jesse Livermore described waiting for the market to show its direction, then holding for the main move and leaving the small wiggles alone.1 Richard Wyckoff, writing in the same years, taught traders to read the swings between accumulation and distribution from price and volume.

After the Second World War, swing trading gained its first famous rule-based system. Nicolas Darvas, a dancer who traded by telegram while touring, described in 1960 how he bought stocks breaking out of "boxes", ranges a stock had held for weeks, with a stop just below the box.2 Breakout swing trading still uses his idea almost unchanged.

The tools then caught up. In 1978 J. Welles Wilder published the Average True Range, which gave swing traders a way to set stops by how much a stock normally moves rather than by a fixed percentage.3 In the 1990s, Linda Bradford Raschke and Larry Connors wrote down short-term setups lasting two to five days, such as buying a pullback in a strong trend, in precise enough terms to test on a computer.4 By the 2000s, retail traders could scan thousands of stocks every evening for these setups.

In India, swing trading grew with online broking in the 2000s and took off with low-cost discount brokers after 2015. Two changes made it cheaper and faster. The NSE and BSE moved share settlement to T+1, completing the switch on 27 January 2023, so money and shares from a sale arrive the next working day.6 And a new margin pledge system from September 2020 let traders pledge shares they hold as collateral instead of transferring them to the broker. Today most Indian swing traders use daily charts of liquid stocks and futures, scanners in the evening and orders that wait for the next morning.

Why traders choose swing trading

  • Fewer, larger moves. A swing trade aims for several per cent in a few days, so costs and spreads take a smaller share of the target than in intraday trading.
  • Less screen time. The setup is found on daily candles after the close; entries and exits can wait in the market overnight.
  • No intraday square-off. Positions bought for delivery are not closed by the broker at the end of the day.
  • The price of it: gap risk. Anything that happens while the market is closed shows up at the next open, beyond any stop.

Common swing setups

Pullback in an uptrend

Buy a stock that is in a clear uptrend after a short pullback, expecting the trend to resume. For example, the stock is above its rising 50-day average and pulls back to near the 20-day average. Pullback setups have a natural stop below the pullback's low and a natural target at the previous high or beyond.

Breakout from a base

Buy a stock that breaks out of a multi-week range on strong volume, Darvas-style. The stop goes just inside the range. Breakouts fail often, but a breakout that works can run far, so the rules usually trail the stop rather than take a fixed target. See the momentum breakout strategy for the full rules.

Short-term mean reversion

Buy a stock in a long-term uptrend after a sharp, short drop, such as when its 2-period RSI is very low. These trades are shorter, often two to five days, and exit on a bounce rather than a trend. See the RSI mean reversion strategy.

Moving average crossover

Buy when a fast average crosses above a slow one on daily candles, such as the 20-day over the 50-day, and exit on the reverse cross. Crossovers are late by design: they give up the first part of a move to avoid many false starts.8

Short swings

The same setups work in reverse for falling stocks, but shares cannot be held short overnight in the cash market in India. Short swings use stock or index futures, or bought puts, which bring leverage, margin and expiry into the trade.

A complete rule set: pullback swing

  1. Universe: stocks in the Nifty 200 with average daily traded value above a minimum, such as ₹50 crore.
  2. Trend filter: the close is above the 200-day average, and the 50-day average is rising.
  3. Setup: the stock pulls back for at least three days to within 2% of its 20-day EMA.
  4. Trigger: a daily close above the previous day's high.
  5. Entry: buy at the next open.
  6. Stop: below the pullback's low, or 2 times the 14-day ATR below entry, whichever is closer.
  7. Exits: take half at 2 times the risk, then trail the stop under the 10-day EMA for the rest; exit everything after 20 trading days if neither has happened.
  8. Event filter: no new entry within five trading days before the company's results.
  9. Portfolio limits: at most eight open positions, and no more than three in one sector.

Every line is a rule a computer can check, which is what makes the strategy testable. "Strong stock" or "good pullback" is not a rule; "close above the 200-day average and a rising 50-day average" is.

A worked example: a pullback swing

Pullback swing rules: buy ₹1,143 after a pullback to the 20-day EMA, stop ₹1,118, half sold at ₹1,193, the rest trailed under the 10-day EMA (illustration)

This is a hypothetical example, not a result.

  • A stock is above its rising 50-day and 200-day averages. It pulls back for four days from ₹1,180 to ₹1,128, near its 20-day EMA of ₹1,122.
  • The next day it closes at ₹1,141, above the previous day's high of ₹1,136.
  • The trader buys 80 shares at the next open, ₹1,143. The stop is below the pullback low of ₹1,118, a risk of 80 × ₹25 = ₹2,000.
  • The first target is 2 times the risk, ₹1,193. The stock reaches it seven days later; the trader sells 40 shares for a gain of ₹2,000.
  • The stop on the remaining 40 shares trails the 10-day EMA. Two weeks later the stock closes below it at ₹1,236, and the trader sells at the next open, ₹1,232, for a further gain of 40 × ₹89 = ₹3,560.

Total gain before costs: ₹5,560 on a planned risk of ₹2,000. The same rules will produce losing trades too, often several in a row; the example shows the mechanics, not a typical outcome.

A worked example: a breakout that fails

This is a hypothetical example, not a result.

  • A stock has traded between ₹480 and ₹520 for six weeks. It closes at ₹527 on twice its average volume.
  • The trader buys 150 shares at the next open, ₹529, with a stop at ₹509, just inside the old range: a risk of 150 × ₹20 = ₹3,000.
  • Two days later the stock's sector falls on news, and the stock closes back inside the range at ₹512.
  • The next morning it opens at ₹505, below the stop. The stop order fills at ₹504.

The loss is 150 × ₹25 = ₹3,750, a quarter more than planned, because the stock gapped through the stop. This is the normal cost of swing trading: some losses come in larger than the plan, which is why position size must leave room for gaps.

Choosing time frames for swing trades

Most swing traders use more than one time frame, each for a different job:

Time frameJobExample
Weekly candlesThe big picture: is the stock in a long uptrend, a range or a downtrend?Trade long only when the weekly close is above the 30-week average
Daily candlesThe setup and the stopA three-day pullback to the 20-day EMA; stop below the pullback low
Hourly candlesThe entry, when you want a tighter oneBuy when the first hourly candle of the day closes above the previous day's high

Using a shorter time frame for the entry can cut the risk per share, because the stop can sit closer. It also brings more false starts, because hourly candles turn more often than daily ones. Whatever you choose, use the same time frames in the backtest as in live trading.

Swing trading with options

Some traders use options instead of shares for swing setups, to limit the money at risk or to trade a stock whose share price is high. The setups are the same; the instrument behaves differently.

  • Buying a call on a pullback setup risks only the premium, but the option loses value every day the stock does not move. A swing that takes three weeks to play out can be right on direction and still lose money on a near-month option.
  • Choosing the expiry. Many swing traders buy an expiry at least twice as far away as the expected holding period, so time decay is slower while the trade works.
  • Choosing the strike. At-the-money or slightly in-the-money options follow the stock more closely; far out-of-the-money options need a large move quickly.
  • Spreads. A bull call spread, buying one call and selling a higher one, lowers the cost and the decay but caps the gain at the higher strike.

Stock options in India are monthly and settle by physical delivery if held in the money at expiry, so close or roll them before expiry week unless you intend to take delivery of the shares. Check the lot size of the stock: one lot of a stock option often represents several lakh rupees of shares.

Reviewing a swing strategy's results

Swing strategies make few trades, so judge them with measures that work on small numbers:

  • Average R. Divide each trade's result by its planned risk. A trade that made ₹5,560 on a planned risk of ₹2,000 is +2.8R; the failed breakout above is −1.25R.
  • Expectancy. Multiply the win rate by the average winning R and subtract the loss rate times the average losing R. With a 40% win rate, an average win of 2.5R and an average loss of 1R, expectancy is 0.4 × 2.5 − 0.6 × 1 = +0.4R per trade, before costs.
  • Losses larger than planned. Count how often a gap made a loss larger than 1R. If it happens often, positions are too large or the strategy holds through too many events.
  • Time in the market. Note how many days capital was tied up. Two strategies with the same expectancy are not equal if one holds for twice as long.

Keep a simple journal of each trade: the setup, the entry, the stop, the exit and why it closed. After 30 to 50 trades, the journal shows whether the live results match the backtest.

A week in a swing trader's routine

  • Each evening: run the scans, check the charts, remove stocks with results due, and set the next morning's orders with their stops and targets.
  • Each morning: check for gaps on open positions and news on stocks with pending orders; cancel an entry if the stock gaps far beyond the plan.
  • During the day: little to do; the orders and GTT triggers wait in the market.
  • At the weekend: review the week's trades in the journal, update the list of upcoming results and corporate actions, and check total risk across open positions.

The risks of holding overnight

Swing trades are exposed to everything that happens while the market is closed:

  • Gaps on results or news can open far beyond a stop.
  • Global moves can gap the whole market, for example after a large move in US markets overnight.
  • Weekends and holidays add longer stretches of risk you cannot act on.
  • Corporate actions such as splits and bonuses change the price on the ex-date, which can trigger stops that are not adjusted.

Ways to manage this: avoid holding through a company's results date, keep position sizes small enough that a gap of several ATRs is survivable, limit total exposure to one sector, and check the corporate action calendar for stocks you hold.

Delivery, margin and costs

Delivery. Swing positions in shares are usually bought for delivery, paying the full value. With T+1 settlement, the shares reach your demat account the next working day, and a sale's money reaches your trading account the next working day.6

Margin trading. Many brokers offer a margin trading facility that lends part of the purchase price for delivery positions, with interest charged daily. It increases both the gain and the loss on each trade, and the interest is a cost that grows with the holding period. Check your broker's rate and the list of eligible stocks.

Pledging. Shares you already hold can be pledged with your broker as collateral for margin on futures or options. In QuantPower, holdings can be pledged from the Holdings screen.

Futures. Stock and index futures need margin, carry the full value's exposure, and expire monthly, so positions held across expiry must be rolled to the next month, paying charges again.

Costs on a delivery trade. On a ₹1 lakh delivery round trip, STT is 0.1% on each side, ₹200 in total, plus exchange charges, SEBI fees, stamp duty on the buy, GST and the broker's delivery brokerage, which is zero at many discount brokers. Each sale from your demat account also carries a depository charge. Costs are small against a swing target of several per cent, but they add up for a strategy that trades often.

Tax on swing trading

Gains on listed shares held for 12 months or less are short-term capital gains, taxed at 20% for sales from 23 July 2024; gains on shares held longer are long-term, taxed at 12.5% above ₹1.25 lakh a year.7 Most swing trades are short-term. Some frequent traders treat their share trading as business income instead, which changes how gains, losses and expenses are counted. Futures and options profits are non-speculative business income. See our guide to F&O taxation in India, and confirm your position with a tax adviser before you file.

Position sizing

Size each trade by the distance to the stop, so a stopped trade loses a fixed small share of capital, such as 0.5% to 1%. With ₹10 lakh of capital and a 1% risk limit, the pullback example above could risk up to ₹10,000; at ₹25 per share, that allows up to 400 shares. The position size calculator does this sum for you.

Three further limits keep a swing portfolio from becoming one large bet:

  • A cap on positions, such as eight, so no single gap can do lasting damage.
  • A cap per sector, such as three, because stocks in one sector gap together.
  • A cap on total risk, such as 5% of capital across all open stops.

Scanning for swing setups

Swing setups are found after the close, on daily candles. A typical evening routine:

  1. Run a scan for the trend filter and the setup, for example stocks above their 200-day average that are within 2% of their 20-day EMA after three down days.
  2. Remove stocks with results in the next week.
  3. Check the chart of each remaining stock for anything the scan cannot see, such as a large gap or a sector-wide move.
  4. Place the orders for the next morning, with the stop and target already decided.

In QuantPower, the scanner runs ready-made scans, such as RSI levels, the 200-day average, EMA crosses, 52-week highs and lows, and breakouts, and your own conditions, on daily candles, over a universe you choose, such as Nifty 50, Nifty 500, F&O stocks or your watchlist. Quanty can write a scan from your words and save it.

Automating a swing strategy

Swing strategies are slower than intraday ones, but they still benefit from automation: scanning many stocks every evening, placing entries at the open, and managing stops and time exits the same way every time. In QuantPower:

  • Signal algos watch a condition on closed daily or weekly candles, such as a close above the previous day's high while the price is above its 200-day average, with up to 20 conditions in ALL and ANY groups. When a signal fires, it either notifies you with the order ready for one touch, or, once armed in auto mode, places the order itself with every risk check. A live signal costs no tokens.
  • GTT orders hold the exit for days or weeks: a GTT waits for its trigger price for up to 365 days, and an OCO pair places the stop and the target together, so the first to fire cancels the other. You can keep up to 100 active GTTs and drag a GTT's line on the chart to a new trigger.
  • Futures swings can run as algos with futures legs on the Overnight product, with stops, targets and exit rules on each leg.
  • Charts show your open orders, positions and GTT triggers as lines on the price scale, on daily and weekly candles as well as intraday ones.

Every order, from a signal, a GTT or an algo, goes through the same risk checks, and the daily loss limit, Smart Exit and the kill switch sit above all of them.

Start with 500 free tokens

Connect your broker, build a strategy and test it on paper before a single live order goes out.

Testing a swing strategy

  • Avoid survivorship bias by testing on the stocks that were in your universe at the time, including those later removed from the index.
  • Adjust prices for splits, bonuses and dividends, or the test will see false gaps.
  • Use the real open for entries and for stops hit on a gap, so gaps cost what they really cost.
  • Model portfolio limits, such as the maximum number of positions, because they change which trades are taken.
  • Count the time held. A strategy that holds positions for three weeks ties up capital; compare its result per month of capital used, not per trade.
  • Run it forward for a few months before using real money; swing strategies make few trades, so a short forward test proves little.

See how to backtest trading strategies for the full method. A QuantPower rule backtest runs a condition on one instrument over up to 2,000 daily candles from your broker, about eight years of trading days, with a stop, a target, an exit rule, slippage and charges; the first 10 backtests each week are free.

Swing trading through different markets

The same rules behave very differently as the broad market changes, which is why most swing systems add a market filter on top of the stock's own chart.

Market phaseWhat happens to long swing setupsA common adjustment
Steady uptrend in NiftyPullbacks hold and breakouts follow through more oftenNormal position size and the full number of positions
Sideways marketBreakouts fail more often; mean-reversion swings work betterFewer breakout trades, quicker targets
Falling marketMost long setups fail, however good the stock's chart looksNo new longs while Nifty is below its 200-day average, or short swings with futures
Sharp fall and reboundMean-reversion setups appear everywhere at onceA cap on new entries per day, so one rebound does not fill the whole portfolio

A simple market filter, such as "no new long swings while Nifty closes below its 200-day average", is easy to test. Compare the strategy's results with and without it over several years; a filter that cuts the worst drawdowns at a small cost to the gains is usually worth keeping.

Common swing trading mistakes

  • Moving the stop further away after the trade goes against you.
  • Holding through results because the chart looked strong.
  • Too many positions in one sector, which turns eight trades into one.
  • Taking profits early and letting losses run, the opposite of what the rules say.
  • Ignoring the market's trend. Most stocks fall in a falling market, whatever their own chart shows.
  • Changing the rules after a few losses. A swing strategy needs dozens of trades before its result means anything.
  • Forgetting corporate actions. A bonus or split halves the price on the ex-date; a stop or GTT set before it must be adjusted, or it fires on a move that never happened.
  • Rolling futures without a plan. A futures swing held into expiry week needs a rule for when to roll, and the roll costs charges and a new spread.

Where swing trading is going

Swing trading has become more systematic. Scanners and daily data put the setups of the 1990s within reach of every retail trader, and AI assistants can turn a sentence into a scan or a rule in seconds, which makes careful testing more important as ideas become cheap to produce. India's market plumbing keeps getting faster, with T+1 settlement in place and exchanges working on shorter settlement cycles, which frees capital between swing trades sooner. And since 1 April 2026, any algo that places orders for a retail trader runs through a broker under exchange rules, so automated swing rules, like intraday ones, are registered and written down.5

Frequently asked questions

How long is a swing trade held?

Usually a few days to a few weeks, depending on the setup and exit rules. Mean-reversion swings are often shorter, two to five days; trend pullbacks and breakouts can run for several weeks.

How does swing trading differ from intraday trading?

Swing trading aims for larger moves with lower costs relative to the target, but carries overnight gap risk. Intraday trading avoids gaps but has smaller targets, more trades and the broker's end-of-day square-off. Neither suits every trader.

Which stocks suit swing trading?

Liquid stocks with enough daily traded value to enter and exit without much slippage, typically large and mid-cap stocks in the Nifty 200 or the F&O list. Thinly traded stocks gap more and fill worse.

Can I swing trade with futures?

Yes, but futures carry leverage and expire monthly, so positions must be rolled and margin managed. They are also the main way to swing short, since shares cannot be held short overnight.

Can I hold a swing trade across a weekend?

Yes, delivery positions and overnight futures positions carry over the weekend. Weekend news and global moves show up at Monday's open, so size positions with that gap in mind.

References

  1. Lefèvre, E. (1923). Reminiscences of a Stock Operator. George H. Doran Company
  2. Darvas, N. (1960). How I Made $2,000,000 in the Stock Market. American Research Council
  3. Wilder, J. W. (1978). New Concepts in Technical Trading Systems. Trend Research (Average True Range)
  4. Connors, L. and Raschke, L. B. (1995). Street Smarts: High Probability Short-Term Trading Strategies. M. Gordon Publishing Group
  5. SEBI, circular on safer participation of retail investors in algorithmic trading, 4 February 2025, in force for every broker from 1 April 2026 (sebi.gov.in)
  6. SEBI, introduction of T+1 rolling settlement on an optional basis (7 September 2021), phased in from February 2022 and completed on 27 January 2023 (sebi.gov.in)
  7. Finance (No. 2) Act, 2024: tax on short-term gains on listed equity raised to 20% and long-term gains to 12.5% above ₹1.25 lakh, for transfers from 23 July 2024 (incometaxindia.gov.in)
  8. Murphy, J. J. (1999). Technical Analysis of the Financial Markets. New York Institute of Finance
The examples on this page are hypothetical and for illustration. Trading involves substantial risk. This guide is for education and is not investment advice.