Register
Tutorial

Configure a QuantPower Algo Bot

This tutorial sets up a strategy as a QuantPower algo bot, step by step: choosing the legs, the strikes, the entry and exit times, the stops and targets, the account's safety limits, and whether it runs live or in Forward test, then checking the first run. Once a strategy is tested, setting it up takes about ten minutes.

QuantPower Research · Updated 16 Nov 2026 · 18 min read

An algo in QuantPower is a set of orders, called legs, with rules: when to enter, when to exit, and what to do when a target or a stop-loss is reached. A new algo is always off. Nothing happens until you switch it on, and you choose whether it runs live, with orders going to your own stock broker, or in Forward test, with test money. Once it is on, it is fully automated: it enters, watches and exits by its rules on every day you chose, with no further tap. The tutorial follows the screens in the order you meet them, with an example strategy throughout: a Nifty short straddle entered at 9:20 am with a stop on each leg and an exit at 3:10 pm.

Algo setup at a glance

StepWhereWhat you decide
1Algos → Option botsStart from a template or your own legs
2The legsBuy or sell, call, put or future, lots, which strike and expiry
3Product, time and daysIntraday or Overnight, entry and exit times, which weekdays
4EntryAt the time, Wait & trade, or opening range breakout; the order type
5Exits on each legTarget, stop-loss, trailing stop, what happens after a hit
6Exits for the whole algoExit time, rupee target and stop, profit lock
7Algos → M2MThe account's Smart Exit, daily loss limit and kill switch
8Switch onLive or Forward test
9The algo cardThe first run: fills, the activity log, the exit

A short history of algo bots for retail traders in India

Automated trading in India began with institutions. Direct market access arrived in 2008, and for years algos were something large firms ran on servers beside the exchange. Retail traders reached automation in the 2010s, as brokers opened APIs and platforms connected to them to place orders for their users. That worked, but the exchange could not tell which orders came from algos, who had built them, or where they came from.

SEBI's circular of 4 February 2025 on retail participation in algorithmic trading changed that.1 It made the broker responsible for every algo order, asked exchanges to empanel algo providers, gave approved strategies an identifier, and tied API access to registered static IP addresses. After two postponements, the framework came into force for every broker from 1 April 2026.2 For a trader setting up a bot today, the practical results are that the platform runs through your broker's official API, orders leave from a static IP registered with the broker, and the broker's daily sign-in rules apply to automated orders as they do to manual ones.

Before you start

  • A tested strategy. Write the rules down first; see how to create a strategy. Then backtest them and run them in Forward test. See the backtest tutorial.
  • A connected broker for live trading, with today's sign-in done. Forward test does not need one.
  • Your static IPs registered with the broker. Every QuantPower account gets 2 static IPs free, a primary and a backup; the Brokers screen shows them for you to whitelist on your broker's developer page.
  • Enough margin for the full position, and for every other algo that may be in a position at the same time.
  • Tokens. A live algo costs 200 tokens per 28 days and a Forward-test algo 100 (1 token = ₹1, GST extra). Switching on part-way through a 28-day cycle is charged for the days left only.
  • The account's safety limits set, or ready to set in step 7.

Step 1: Open the algo builder

  1. Open Algos. It has four tabs:
TabWhat it is
Option botsYour algos: the cards, the switch, the builder
Signal algosA condition on price or indicators that prepares or places an order, or starts and stops an algo
WebhooksYour own URLs that start and stop your algos from Arth.live price alerts, other charting software, Excel or any tool that can call a URL
M2MSmart Exit for the whole account, the daily loss limit and the kill switch
  1. On Option bots, create a new algo. You can start in three ways:
  • From a template. Templates are grouped as bullish (such as Bull Call Spread or Sell Put), bearish (such as Bear Put Spread or Sell Call), neutral (such as Short Straddle, Short Strangle, Iron Fly, Iron Condor or Jade Lizard) and volatile (such as Long Straddle or Reverse Iron Condor). A template is an open sample: once loaded, it is your own algo and every part can be changed.
  • From your own legs on an index option chain.
  • From the strategy builder. "Run as algo" turns the legs on the payoff screen into an algo.

For the example, load the Short Straddle template.

Step 2: Set the legs

Each leg is one order: buy or sell, a call, a put or a future, and a number of lots. Markets covered are NSE and BSE cash and F&O, commodity and currency.

There are two kinds of leg:

  • A fixed leg trades one exact contract: this strike, this expiry. When that contract expires the algo stops and says so; edit the leg to move it to the next expiry.
  • A rule leg picks its contract fresh at each entry, such as "the at-the-money call, weekly expiry", so the algo keeps running week after week.

For a rule leg, choose how the strike is picked:

ChoiceMeaning
ATMAt the money
ITM n / OTM nn strikes in or out of the money (1 to 20)
PremiumThe strike nearest to, at or above, or at or below a premium you set
Delta / Theta / Gamma / VegaThe strike whose Greek is nearest your value
Straddle widthATM plus a multiple of the ATM straddle premium (−5 to 5)
% of straddleATM plus a percentage of the ATM straddle premium (−500 to 500)
% from ATMThe strike nearest the price moved by your percentage (−50 to 50)

Choose the price the strike is counted from: the spot, the future, or a synthetic future (the ATM call minus the ATM put plus the ATM strike). Choose the expiry: weekly, next weekly, monthly or next monthly for options; the current or next month for futures.

If the prices or Greeks a rule leg needs are missing at the moment of entry, the algo waits and says why. It never guesses a strike.

For the example: leg 1, sell the ATM call, weekly expiry, 1 lot; leg 2, sell the ATM put, weekly expiry, 1 lot. Nifty weekly options expire on Tuesdays, and one Nifty lot is 65 units.

Step 3: Set the product, times and days

SettingChoicesFor the example
ProductIntraday or Overnight (an algo with stock legs is intraday)Intraday
Entry timeAny time in market hours, in IST09:20
Exit timeNever later than the market's own square-off time15:10
DaysEvery trading day, or the weekdays you pick; market holidays are skippedTuesday only (expiry day)
Next-day exit (BTST / STBT)Carry today's legs and exit at a time on the next trading dayOff
Quantity multiplier1 to 50; every leg's lots, and rupee targets and stops, scale with it1

Start with the smallest size you tested. The multiplier makes it easy to scale up later without editing each leg.

Step 4: Set the entry

Choose the entry mode:

Entry modeWhat it does
At the timeEvery leg enters at the entry time
Wait & tradeEach leg waits from the entry time until the premium or the underlying moves up or down by the points or percentage you set, then enters; each leg can have its own wait
ORB (opening range breakout)The algo reads the high and low of the first N minutes (1 to 180) from the market open or a time you set, on the underlying or the instrument; a leg enters on the first price above the high or below the low, as you chose

The order of the legs. Buy legs go first. Sell legs go only after the buys are filled, so a hedge is in place before the sold option. On exit it is the reverse: sold legs are bought back first.

The entry order type, per leg:

  • Market, the default.
  • Limit: a fixed price, or the last price plus or minus a buffer in points or per cent.
  • Stop-limit: a trigger and a limit, for a breakout entry.
  • Modify until filled: if the entry is still open after N seconds, its price moves to the last price, up to 10 times; after that it is cancelled or sent at market, as you chose.

Lazy legs. A leg can be set to enter later: when another leg enters, hits its target or hits its stop-loss. Lazy legs can chain up to 10 legs long. They are useful for adding a hedge only when the position comes under pressure.

For the example: At the time, market orders.

Step 5: Set the exits on each leg

Each leg can carry its own exits:

SettingChoices
TargetPoints, %, underlying points, underlying %, delta, theta, gamma or vega; on an ORB leg also points or % beyond the range
Stop-lossThe same choices
Count fromThe traded price, the price the entry was decided on, or the last price when the order was sent
Trail SLFor every X the leg moves in your favour, the stop moves Y in your favour; it only ever tightens; checked every pass or every 1, 5, 15, 30 or 60 minutes
SL to costMove the stop to cost once the leg is X in profit, or when another leg's stop-loss hits
On a hitExit this leg only, or exit all legs
After a hitEnter the leg again (re-execute) or enter it on the opposite side (reverse), 1 to 20 times a day; a rule leg picks a fresh strike

There is also one simple setting for the whole algo: a stop-loss on each leg as a percentage (1 to 500) of its traded price, with re-enter at cost (0 to 5 re-entries a day for each leg).

Exits are market orders that only reduce the position. They can never open a new one.

For the example: a stop-loss of 30% on each leg, counted from the traded price, exit this leg only, no re-entry.

Step 6: Set the exits for the whole algo

SettingWhat it does
Exit timeEvery leg is squared off at this time
M2M target or stop in ₹Every leg exits when the algo's profit or loss today reaches the amount
M2M %The same, as a percentage of the open legs' entry premium
Net delta or theta bandExits when the algo's net delta or theta leaves the band you set
What a hit doesExit all legs, exit the losing legs, exit the profitable legs, square off and re-enter, or reverse (re-enter and reverse 1 to 20 times a day)
Lock profit and trailOnce the M2M reaches X, lock Y; for every Z more, the lock rises by W; every leg exits when the M2M falls to the lock

Monitoring. Targets, stops, the lock, Wait & trade and the breakout are read on every tick, or once per 1, 3, 5 or 15 minute candle close, as you choose. The entry time, the exit time and exits already owed are never delayed.

For the example: exit time 15:10, an M2M stop of ₹4,000 for the algo, read on every tick. Save the algo. It is saved switched off.

Step 7: Set the account's safety limits

Smart Exit and the daily loss limit in QuantPower's M2M settingsSmart Exit and the daily loss limit in QuantPower's M2M settings
Smart Exit and the daily loss limit in QuantPower's M2M settings

Open Algos → M2M. These limits sit above every algo and cover the whole account, across every connected broker:

ControlWhat it does
Smart ExitA profit target, a stop-loss and a trailing step for the whole account; on a hit it stops the algos and squares off every position
Daily loss limitOnce today's loss reaches it, new orders are refused
Maximum orders a dayAn optional cap on the number of orders
Kill switchStops trading in the chosen segments until their next session; running algos in them stop

Arming Smart Exit and setting the kill switch need your confirmation and the second factor of your login. Set these before your first live algo. They are your protection if several algos lose on the same day, or if a market moves faster than any single algo's stop. The MTM stop loss tutorial covers Smart Exit in detail.

Step 8: Switch it on

On the algo's card, switch it on and choose where it runs:

LiveForward test
MoneyReal, at your stock brokerVirtual: ₹10,00,000 to start
Needs a connected brokerYesNo
PricesLive from your brokerThe prices your account sees
Tokens200 per algo per 28 days100 per algo per 28 days

With two or more brokers connected, pick the broker; every leg of the algo goes to that broker.

At the moment you switch on, these checks run. If one fails, the algo stays off, you are told why in plain words, and no tokens are taken:

  1. Live needs a broker. With none connected, the app offers Forward test instead.
  2. The kill switch. If you stopped that segment and it would still be stopped at the algo's first entry, the switch-on is refused.
  3. The daily loss limit. If today's loss has already reached it and the algo would enter today, the switch-on is refused. An algo that still holds today's positions can always be switched back on, so that it watches their stops and exit time again.
  4. The broker sign-in. If the algo would enter right now and your broker is not signed in for today, the switch-on is refused and asks you to sign in. If the entry is later, the algo switches on and its card says to sign in before the entry.
  5. An expired fixed leg cannot be switched on.
  6. Safety caps: up to 20 algos running at a time, and up to 6 legs in an algo that runs.
  7. Tokens must cover the charge.
  8. Changed since you looked. If the algo was edited after your screen loaded, you are asked to check it again.

Switch the example on in Forward test first. Run it for several expiries and compare its trades with your backtest before switching it on live.

Step 9: Check the first run

The Positions tab: open positions from manual orders, algos and signals, with Smart Exit and Exit allThe Positions tab: open positions from manual orders, algos and signals, with Smart Exit and Exit all
The Positions tab: open positions from manual orders, algos and signals, with Smart Exit and Exit all

On the first live day:

  1. Before entry: the card shows that the algo is waiting for its entry time, and anything it is waiting on.
  2. At entry: the card shows today's legs with their fills. The activity log shows each order as a plain line. Compare them with your broker's order book.
  3. During the day: the card shows the algo's M2M. The order book shows which algo placed each order in its Strategy column.
  4. At a stop: the log shows which leg hit its stop and the exit order.
  5. At exit time: check that every leg closed, here and in the broker's positions.

"Copy log" copies a day's activity log, which is useful when you want to keep a record or ask for help.

While it runs

ActionWhat happens
PauseNo new entries; open legs keep their targets, stops and exit time. "Resume new entries" undoes it
Stop algo and square offCloses the legs, then stops
Stop algo, keep positionsStops at once; the positions are yours to manage, with no stop and no exit time from the algo
Restart todayRuns it again today, in the same place: a Forward-test algo restarts in Forward test, a live algo at the same broker
EditOnly when the algo is off; while an off algo still holds positions, its targets, stops and times can change but its legs, product and quantity cannot
DeleteOnly when the algo is off, and it asks twice

Several algos can be paused, stopped or exited together. The pausing automation tutorial covers pausing before events.

A checklist before switching on live

  • The algo has run in Forward test for several weeks, and its trades match the backtest closely enough.
  • Every leg's lots, and the multiplier, are what you meant; quantity is in lots, not units.
  • The entry and exit times, and the days, are right for the instrument's expiry and hours.
  • Every sold leg has a stop, and the algo has an M2M stop.
  • Smart Exit and the daily loss limit are set for the account.
  • Your broker is signed in for the day, your static IPs are registered with it, and the margin covers this algo and the others that may be in a position together.
  • You know how you will pause or stop it if something unexpected happens.

When something goes wrong

What happensWhat the algo doesWhat you do
An entry order is refused (margin, a risk rule, the broker)Closes the legs already in, stops, and shows the reasonRead the reason, fix it, switch on again
An exit order is refusedTries again, up to 8 times, with a growing gap; the card shows what is still owedCheck the broker; exit by hand if needed
Prices or Greeks are missingWaits and says why; never decides on a guessCheck the broker's feed and sign-in
The broker is not answeringOrders are refused, not assumedWait, or check the broker's status
The broker was disconnectedCannot place orders there; a restart is refused until it is connected againConnect the same broker again
A fixed contract expiredStops and says which contractEdit the leg to the next expiry
Tokens run out at the end of the 28 daysStops and tells you; open positions are kept and no longer watchedAdd tokens, or manage the positions by hand

A second example: an iron condor with a hedge that waits

This example uses more of the builder.

  • Legs. Sell the OTM 4 call and the OTM 4 put, weekly expiry, 1 lot each. Add two buy legs, the OTM 8 call and the OTM 8 put, as the wings.
  • Entry. At the time, 09:30, market orders. The buy legs go first, so the wings are in place before the sold options.
  • Exits on each leg. A stop of 40% on each sold leg, counted from the traded price, with On a hit: exit this leg only. When a sold leg is stopped, its wing stays, which is often what the trader wants on a sharp move.
  • A lazy leg. A fifth leg, a buy of the ATM call, set to enter when the sold call hits its stop. It adds protection only on the side that is under pressure.
  • Exits for the whole algo. Exit time 15:15; an M2M stop of ₹6,000; and a profit lock: once the M2M reaches ₹3,000, lock ₹1,500, and for every ₹500 more, raise the lock by ₹250.
  • Days. Monday, Wednesday, Thursday and Friday: every weekday except Tuesday, the expiry day.

Check the whole algo against the account's limits: the M2M stop of ₹6,000 should sit inside the daily loss limit, so that the algo's own exit comes first and the account limit is the backstop. With five legs it is inside the 6-leg cap for a running algo.

Running several algos

When several algos trade at once, their losses add up. Each algo's own stop limits that algo; Smart Exit and the daily loss limit watch the whole account. Use both. Check that the combined margin of all the algos that may be in a position together fits your account, or later entries may be refused for margin. Up to 20 algos can run at a time, and you can keep up to 50 saved.3

Starting and stopping algos from other tools

If your entry signal comes from a chart alert or your own code, connect it through Algos → Webhooks. A webhook is your own private URL. An entry hit switches the linked algos on for today and enters now; an exit hit stops them and squares off. A hit needs no tap and acts only on your own algos, in the place each one ran before. You can have up to 20 webhooks, each linked to up to 10 algos, and the hit log keeps the last 500 hits. Outside market hours, after an algo's exit time, or on a day it does not run, nothing happens and the hit log says why.

Common mistakes

  • Going live before Forward test. A strategy that has never run on live prices has not met real fills, refused orders or an expired broker session.
  • No account limits. Each algo's stop can look reasonable while the day's combined loss does not.
  • Fixed legs left to expire. A fixed leg stops the algo at expiry; use rule legs for a strategy meant to run every week.
  • Lots and units confused. Quantity is in lots; one Nifty lot is 65 units.
  • Trading the same contracts by hand. Manual trades in contracts an algo manages can cause wrong exits.
  • Forgetting the daily sign-in. A live algo cannot enter while the broker is signed out.

Where algo setup is going

Setting up an algo is becoming a conversation rather than a form. In QuantPower, Quanty can build an algo from your description and save it switched off for you to check, and an AI app connected through Connect AI can do the same; neither can switch an algo on, which stays your decision. At the same time, broker and exchange rules for retail algos are settling into a common shape under SEBI's framework, with registered static IPs and daily sign-ins as standard. The skill that matters most is unchanged: knowing your rules, testing them, and setting limits before you need them.

Start with 500 free tokens

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

Frequently asked questions

Can I trade by hand while a bot runs?

Yes, but avoid the contracts the bot manages. Manual trades in the same contracts can cause wrong exits.

How many algos can run at the same time?

Up to 20, each with up to 6 legs, and you can keep up to 50 saved. Margin is usually the real limit: every algo that may be in a position at the same time needs its own margin.

Does an algo stop if I close the app or switch off my phone?

No. Once switched on, an algo keeps running when your phone or computer is off, and sends orders to your broker through its official API from your static IPs. Your broker must stay signed in for the day.

What is the difference between Pause and Stop?

Pause stops new entries but keeps watching the open legs' stops, targets and exit time. Stop ends the algo: either squaring off its legs, or leaving the positions with you and no longer watching them.

Can I edit an algo while it is running?

No. Switch it off first. While an off algo still holds positions, you can change its targets, stops and times, but not its legs, product or quantity until the positions are closed.

References

  1. SEBI, circular on safer participation of retail investors in algorithmic trading, 4 February 2025 (sebi.gov.in)
  2. SEBI, circular extending the timeline for implementation, 30 September 2025, with the framework in force for every broker from 1 April 2026 (sebi.gov.in)
  3. QuantPower: algo builder, limits and prices, from the app's code and price list, checked 12 November 2026
Screens in this tutorial are illustrations. Labels in the app may differ slightly. Automated trading involves substantial risk, including losses larger than expected in fast markets. This page is for information and is not investment advice.