An automated strategy fails in more places than a manual trade, because more links sit between the rule and the fill: the platform, the broker session, the static IP, the broker's risk checks, the exchange's checks and the market itself. The good news is that almost every failure leaves a message, and most messages point to one of a handful of causes. This guide starts with the five checks that solve most problems, walks through each link of the chain with the errors it produces, works through the rupee cost of the common mistakes, and explains what QuantPower's algos do on their own when something goes wrong.
Start with five checks
Most problems are solved by one of these:
- Have you signed in to your broker today? Broker sessions end every day, so a strategy cannot trade until you sign in again.
- Is your static IP registered with your broker? Since 1 April 2026, brokers accept API orders only from a static IP registered for your API key.
- Is the segment active? Options and futures need F&O enabled on your broker account.
- Is there enough margin? Option buyers need the full premium in the account, and sellers need SPAN and exposure margin.
- Is the contract tradable now? Check market hours, holidays, expiry dates and the F&O ban list.
How an algo order travels
Knowing the path an order takes tells you where to look when it fails. Each step below can stop an order, and each produces a different kind of message.
| Step | What is checked | Typical failure |
|---|---|---|
| 1. The strategy | Its rules, times, days and status | No order at all: the conditions were not met, or the strategy was paused or off |
| 2. The platform | Instrument, lot size, tick size, your own risk limits | Refused before it leaves: kill switch on, daily loss limit reached, contract expired |
| 3. The broker session | That you are signed in for today | "Session expired", "invalid token", "Sign-in needed" |
| 4. The network route | That the order comes from your registered static IP | "IP not allowed", "IP mismatch" |
| 5. The broker's risk system | Margin, segment, order type, product, restricted contracts | "Insufficient margin", "segment not enabled", "blocked by RMS" |
| 6. The exchange | Price band, freeze quantity, ban list, order rate | "Price outside band", "quantity above freeze limit", "too many requests" |
| 7. The market | Whether anyone will trade at your price | Open but unfilled, partly filled, filled worse than expected |
A failure at steps 1 and 2 never reaches your broker, so the broker's order book will be empty and the answer is in the platform's log. A failure at steps 3 to 6 shows as a rejected order with a message. A failure at step 7 is not an error at all: the order is valid but the market has not met it.
A short history of algo trading failures
India allowed direct market access for institutional investors in 2008, and algorithmic trading grew quickly after it. In March 2012, SEBI issued its first broad guidelines on algorithmic trading, asking exchanges to set order-to-trade limits and brokers to run risk checks on every algo order.1
Two events that year shaped how the industry thinks about failures. On 1 August 2012, Knight Capital in the United States lost more than $400 million in about 45 minutes after a software deployment left old code active on one of its servers; the firm sent millions of unintended orders before anyone stopped it.2 On 5 October 2012, erroneous orders worth about ₹650 crore from a single broker's terminal sent the Nifty down about 15% within moments, and NSE halted trading for 15 minutes.3 Both cases became textbook examples of why pre-trade checks, order limits and a working stop switch matter more than strategy logic.
Retail traders gained broker APIs from around 2016, and with them came the everyday failures this guide covers: expired sessions, wrong lot sizes, orders sent twice. In 2021 NSE discontinued stop-loss market orders in options, which turned a common rejection into a rule every options algo must respect.4 SEBI's framework for retail algo trading, issued on 4 February 2025 and in force from 1 April 2026 after a glide path, added registered static IPs, algo identifiers on orders and a threshold of 10 orders a second above which an algo must be registered with the exchange.5
Login and connection problems
| Problem | Likely cause | What to do |
|---|---|---|
| Session expired or invalid token | Your broker ended the previous day's session | Sign in to your broker again; brokers end sessions every day |
| "Sign-in needed" on the broker row | The day's session has ended or was never started | Sign in from the broker row before the first entry time |
| Two-factor code rejected | Your phone's clock is out of sync, or the code expired | Set your phone to automatic time and use a fresh code |
| Invalid API key or secret | The key was deleted or regenerated, or was copied wrongly | Copy the current key and secret from your broker's API console and connect again |
| API subscription lapsed | Your broker charges for API access and the plan has expired | Renew it in your broker's API console, then sign in again |
| IP not allowed or IP mismatch | The static IPs registered at your broker are not the ones your orders leave from | Copy the static IPs shown on your broker row in QuantPower and register them in your broker's API console. Many brokers allow a change only once a week |
| Blank page or loop after broker login | The browser blocked a pop-up or cookies | Allow pop-ups for quantpower.tech, or try another browser |
| Funds or positions do not appear | The sign-in did not complete, or the broker's API is down | Reconnect, then check the QuantPower status page and your broker's app |
| "Activation pending" on a broker | That broker's order connection is not active yet | Your keys are saved, encrypted, but nothing is sent to that broker until its connection is active |
| "Sample data" shows when you try to order | You are exploring with sample data and no broker is connected | Connect your stock broker; sample data places nothing |
| Account locked | Too many wrong passwords or codes | Unlock or reset the account with your broker, then reconnect |
The daily sign-in, broker by broker
Every broker ends its API session at the end of the day or sooner, and the way you start a new one depends on the broker. In QuantPower:8
| Broker type | How you sign in each day |
|---|---|
| Brokers on the XTS trading system | Tap "Log in again"; the saved key is used and the row shows when the session ends |
| Zerodha, Upstox and Fyers | Sign in on the broker's own page and come back; Zerodha and Upstox tokens end early the next morning |
| Dhan | Paste a new token when the old one ends; the token's own expiry is used |
| Shoonya | A sign-in with a code you type that day |
Nothing signs you in on your behalf. If an algo would enter right now and your broker is not signed in, switching it on is refused with a request to sign in. If its entry is later in the day, it switches on and its card says "Sign in to your broker before the entry". If the entry time arrives and you are still signed out, the entry is refused with the reason.
Static IP problems
Every API order must come from a static IP registered with your broker. Every QuantPower account gets 2 static IPs free, a primary and a backup, and your orders leave through them.8 Your part is to register both addresses with your broker. Three things to know:
- The addresses to register are shown on your broker row in QuantPower. Copy them exactly; a single wrong character produces an IP mismatch on every order.
- If the route through the static IPs is down, orders are held, not sent from another address. A held order is safer than one your broker rejects, or one that leaves from an address you never registered.
- Because your orders leave only from those two static IPs, your own computer, router or internet connection does not change the IP your broker sees. Switching from home Wi-Fi to mobile data does not cause an IP mismatch.
Why orders get rejected
Your broker and the exchange check every order before it reaches the order book. The wording differs by broker, but rejections fall into a few groups.
| What you might see | What it means | What to do |
|---|---|---|
| Insufficient funds or margin | The order needs more margin than is free | Add funds or reduce lots. For spreads, buy the hedge legs first |
| Segment not enabled | F&O is not active on your broker account | Activate it with your broker, which may ask for income proof, and try again once it is active |
| Market orders not allowed | Your broker blocks market orders in this contract | Use a limit order priced near the best bid or ask |
| SL-M not allowed | NSE does not accept SL-M orders in options | Use an SL order with a buffer between trigger and limit |
| Trigger price on the wrong side | A sell stop's trigger is above the last price, or a buy stop's is below it | Move the trigger to the other side of the market |
| Quantity not a multiple of lot size | The lot size was revised, or the quantity is wrong | Update the quantity. Since 31 December 2025, Nifty's lot is 65 and Bank Nifty's is 30; Sensex's is 20 |
| Quantity above freeze limit | The order is larger than the exchange's freeze quantity for that contract | Split it, for example with iceberg orders. Freeze limits change with lot sizes, so check NSE's current list |
| Price outside the price band | The exchange accepts limit prices only within a set range around the current price, and each option has its own band | Use a price inside the band your broker's terminal shows, closer to the best bid or ask |
| Security in ban period | The stock is in the F&O ban | You can only reduce existing positions until the ban ends |
| Order rate exceeded or too many requests | The strategy sent orders faster than the exchange or your broker allows | Space out orders. An algo that is not registered with the exchange must stay under 10 orders a second, and your broker's API may set lower limits |
| Contract not found or expired | The strategy points to an expired contract | Select a current expiry |
| Blocked by RMS | Your broker's risk team has restricted the contract or the account | Ask your broker for the reason |
Two rules cause many rejections on expiry day. Short index options need an extra 2% margin on the day of expiry, and calendar spreads lose their margin offset, so a position that fitted your margin the day before may not fit on expiry day.6 NSE's weekly index options expire on Tuesday and BSE's on Thursday, so these rules can bite twice a week if you trade both.
Many brokers also restrict new positions in stock options close to expiry, because in-the-money contracts settle by delivery of shares. Our guide to SEBI rules for option trading covers these rules.
Worked example: expiry-day margin
A trader sells one lot each of the Nifty 25,000 call and put on the morning of expiry, with Nifty at 25,000. Suppose the broker's margin for the straddle was about ₹2,30,000 the day before (an illustrative figure; your broker's screen shows the real one). The extra 2% is charged on the contract value of each short leg:
- Contract value of one leg: 25,000 × 65 = ₹16,25,000.
- Extra margin per leg: 2% × ₹16,25,000 = ₹32,500.
- Extra for the two short legs: ₹65,000.
- Margin needed on expiry day: about ₹2,95,000.
With ₹2,60,000 free in the account, the second leg is refused for insufficient margin, and the trader is left holding one naked short option. Checking the expiry-day figure on an F&O margin calculator before the strategy runs avoids the surprise. In a QuantPower algo, buy legs are sent before sell legs, and if an entry order is refused the algo closes the legs already in and stops, so a half-built position is not left running.
Worked example: freeze quantity
Suppose a contract's freeze quantity is 1,800 units (an illustration; NSE publishes the current figure for each contract). A strategy that sends 40 lots of Nifty in one order asks for 40 × 65 = 2,600 units, which is above the limit, and the whole order is rejected. Split into two orders, for example 27 lots (1,755 units) and 13 lots (845 units), it goes through. The split must be in whole lots, and each part must be below the freeze limit.
Worked example: a stop-limit buffer that is too narrow
A trader sells a call at ₹100 and protects it with a buy stop-limit: trigger ₹130, limit ₹135. The planned loss at the trigger is (130 − 100) × 65 = ₹1,950. On a sharp move the premium jumps from ₹128 to ₹142 between ticks. The stop triggers, but the limit of ₹135 is now below the market, so the order sits open and unfilled. If the trader exits by hand at ₹142, the loss is (142 − 100) × 65 = ₹2,730, ₹780 more than planned. A buffer of ₹15 (limit ₹145) would have filled at about ₹142 at once. A wider buffer does not make the fill worse; it only allows the order to fill in a fast market.
When a strategy does not trade
If the connection works but the strategy placed no order, check:
- Conditions: the entry rules may not have been met. Compare the strategy's conditions with the chart at the expected time. Signal conditions are read on closed candles, so a crossing that happened during a candle and reversed before its close does not count.
- Timing: the strategy may be scheduled outside market hours, on a holiday or for an expiry that has passed.
- Status: the strategy may be off, paused, or running in Forward test with test money instead of live.
- Margin at entry: other positions may have used up the free margin.
- Session: the broker session may have ended before the entry time.
- Account limits: the kill switch may be on for the segment, or the day's loss may have reached your daily loss limit, so new orders are refused.
Why an algo will not switch on
When you switch on a QuantPower algo, it is checked at that moment. If a check fails, it stays off, you are told why in plain words, and no tokens are taken.7 The checks are:
- A live algo needs a connected broker. With none, the app offers Forward test instead.
- With two or more brokers connected, you pick one, and every leg goes to it.
- If the kill switch would still be on for that segment at the algo's first entry, the switch-on is refused.
- If today's loss has already reached your daily loss limit and the algo would enter today, it is refused.
- If the algo would enter right now and your broker is not signed in, it is refused.
- A fixed leg whose contract has expired cannot be switched on.
- Up to 20 algos can run at once, with up to 6 legs each.
- Your token wallet must cover the charge.
- If the algo was edited after your screen loaded, you are asked to check it again.
Checks 3 and 4 apply only when the algo would send a new entry. An algo that still holds today's positions can always be switched back on, so that it watches their stop-loss and exit time again.
Why a restart is refused
"Restart today", and a start by a webhook or a signal, runs the algo in the same place as before: a Forward-test algo restarts in Forward test and a live algo restarts at the same broker. It never moves from test money to real money, or from one broker to another, on its own. If that broker has since been disconnected, the restart is refused and says so. Connect the same broker again and the restart works.
What QuantPower does when something goes wrong
Some failures happen after an algo is running. The rule throughout is that the algo refuses or waits rather than guesses, and tells you why.7
| What happens | What the algo does |
|---|---|
| An entry order is refused (margin, a risk rule, the broker) | It closes the legs already in, stops, and shows the reason |
| An exit order is refused | It tries again, up to 8 times, with a growing gap. The card shows what is still owed |
| Prices or Greeks are missing | It waits and says why. No strike, target or stop is ever decided on a guess |
| The broker is not answering | Orders are refused, not assumed. Nothing is treated as "no position" |
| The broker was disconnected | The algo cannot place orders there. A restart is refused until it is connected again |
| A fixed contract expired | The algo stops and says which contract |
| Tokens run out at the end of the 28 days | The algo is stopped and you are told. Open positions are kept and no longer watched |
Two of these need your action. When an exit is still owed after its retries, the position is open at your broker, so check it in your broker's app or on the Positions screen and close it there if needed. When an algo stops because tokens ran out, or because you chose "Stop algo, keep positions", its positions have no stop-loss and no exit time any more: they are yours to manage until you close them.
Lost answers and duplicate orders
The most dangerous moment in automated trading is an order whose result is unknown: the request went out, and the answer never came back. Re-sending it may open a second position; assuming it failed may leave a position you do not know about.
Every order in QuantPower, from any screen or algo, takes one path, and the placing call carries an idempotency key, a unique label that makes a repeated request place nothing new.8 If the answer is lost, the app asks the server by that key before it says anything. It never says "nothing was sent" for an unknown result, and never retries on its own; you check Orders.
The cost of getting this wrong is easy to see. A trader whose screen froze resends a one-lot Nifty futures buy, and both orders fill. Nifty then falls 50 points before the trader notices. The extra lot loses 50 × 65 = ₹3,250 that was never part of the plan. The rule for any platform: when in doubt, look at the order book before you send again.
When prices look wrong
- Forward test prices do not move. Without your own connected broker, Forward test uses the last close, not real-time prices. Connect a broker to see live prices.
- A strategy waits at entry time. If the prices or Greeks it needs are missing, a QuantPower algo waits and its card says why, rather than choosing a strike on stale data.
- Charts and your broker disagree. Different feeds can differ by a tick or two, and a candle's close depends on the exact time cut-off. For orders, the broker's price is the one that matters.
When orders fill differently than expected
| Problem | Likely cause | What to do |
|---|---|---|
| Order placed but not filled | The limit price is away from the market, or the contract is thin | Price closer to the best bid or ask, or trade a more liquid strike |
| Partly filled | Not enough quantity at your price | Leave it open, change the price or cancel the rest |
| Entry still open after several seconds | The market moved away from the limit | In a QuantPower leg, "Modify until filled" moves the price to the last price after N seconds, up to 10 times, then cancels or sends at market, as you chose |
| Stop loss filled worse than the trigger | The price moved quickly between trigger and fill | Review the buffer, or add an account-level limit such as a daily loss limit |
| Stop loss did not fill | The price jumped past the SL order's limit | Exit manually, then widen the buffer between trigger and limit |
| Positions differ between QuantPower and your broker | You traded the same contract by hand, or an order filled in parts | Refresh, and avoid trading by hand in positions a strategy manages |
| Duplicate orders | The same strategy was switched on twice, or an order was resent after a timeout | Check the order book before switching on or sending again |
Our guide to order types explains triggers, limits and freeze quantities in detail.
A pre-market routine
| Time | Check |
|---|---|
| Before 9:00 | Sign in to your broker, confirm your funds appear, and check that the broker row shows "signed in" with today's session end |
| 9:00 to 9:15 | Check which strategies are scheduled, the day's expiries and the F&O ban list, and read any broker or exchange notices |
| 9:15 | The normal market opens for equity and F&O |
| During the day | Check the order book, positions and each algo's card after every entry |
| Before the close | Confirm intraday positions closed as planned. Since 3 August 2026, F&O trading runs until 3:40 pm |
| After the close | Read the activity log and note anything that was refused or waited |
Keeping an incident note
When something goes wrong, a short note written the same day turns a bad trade into a fixed problem. Record:
- the date, time and strategy,
- what you expected to happen and what happened,
- the exact message from the platform or broker,
- the order IDs involved, and whether each filled, part-filled, was rejected or is unknown,
- the rupee effect, worked out from the fills, and
- the fix, and how you will know it worked.
In QuantPower, each algo's activity log records every entry, exit, re-entry, change and refusal in one plain line each, and "Copy log" copies a whole day. Pasting that into your note, or into a message to support, saves a round of questions.
Common mistakes when fixing a problem
- Switching the strategy on again before finding why it stopped. The same cause stops it again, or worse, opens a second position.
- Editing a running strategy in your head and assuming the change applied. In QuantPower an algo can be edited only when it is off.
- Exiting by hand and leaving the algo running. The algo still expects its legs and may act on a position that no longer exists. Stop it first, or use "Stop algo and square off its positions".
- Re-registering the static IP for every connection error. Most errors are expired sessions; an IP change may lock you out for a week with brokers that limit changes.
- Treating a timeout as a failure. Check the order book first.
Where troubleshooting is going
Three changes are making failures easier to diagnose. Under SEBI's framework, every algo order carries an identifier from the exchange, so a broker can see which strategy sent which order, and a rejected order can be traced to its source. Platforms are moving from silent retries to explicit refusals with reasons, because an order that is refused and explained is easier to fix than one that half-worked. And more checks are moving earlier in the chain: margin, lot size, ban lists and loss limits checked by the platform before the order leaves, so that the broker's rejection becomes the exception rather than the way you learn about a problem.
Contacting support
Send these details so we can help quickly:
- your broker and client ID, but never your password, two-factor codes or API secret,
- the strategy name,
- the time of the problem,
- the order ID and the exact error message,
- the copied activity log for the day, and
- a screenshot, if you have one.
Email [email protected], call +91 97111 30044, or use our contact page. If QuantPower is unavailable while you have open positions, manage them directly in your broker's app, because the positions are held with your broker.
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
What does an IP mismatch error mean?
Your broker received an API order from an address that is not registered for your API key. In QuantPower, register the two static IPs shown on your broker row with your broker; your own internet connection does not affect it.
Why was my order rejected when I have enough money?
Margin depends on the position, not only on the cash in your account. Selling options needs SPAN and exposure margin, expiry day adds extra margin on short index options, and money already blocked for other positions is not free.
My strategy worked in a Forward test but not live. Why?
Forward test runs with test money and does not go through your broker, so it skips the broker's checks on sign-in, static IP, segment, margin and order types. Check those first.
What should I do if an order is stuck as open?
It is waiting for its price. Change the price closer to the market, or cancel it. If a stop loss is stuck because the market moved past its limit, exit the position manually.
Can I trade by hand while a strategy runs?
Yes, but avoid the contracts the strategy manages. Manual trades change the position the strategy expects and can cause wrong exits.
Why did my algo stop in the middle of the day?
The card and the activity log say why. Common reasons are an entry order that was refused (the algo closes the legs already in and stops), an expired fixed contract, the kill switch, or a disconnected broker.
Related guides
- Order rejection reasons: broker messages explained one by one
- Broker connection requirements: API keys, static IPs and daily sign-in
- Trading automation checklist: what to check before an algo goes live
- Paper vs live trading: why results change when real money is involved
References
- SEBI, broad guidelines on algorithmic trading, circular of 30 March 2012 (sebi.gov.in)
- US Securities and Exchange Commission, *In the Matter of Knight Capital Americas LLC*, order of 16 October 2013 (sec.gov)
- Reports on the NSE trading halt of 5 October 2012 after erroneous orders from one broker's terminal (The Economic Times and Business Standard, October 2012)
- NSE, circular NSE/FAOP/49677 on discontinuation of stop-loss market orders in options, September 2021 (nseindia.com)
- SEBI, circular on safer participation of retail investors in algorithmic trading, 4 February 2025, and glide-path circular, 30 September 2025; NSE, implementation standards for retail algo trading, 5 May 2025 (sebi.gov.in, nseindia.com) (checked 12 November 2026)
- SEBI, measures to strengthen the equity index derivatives framework, 1 October 2024; NSE, contract specifications, lot sizes and freeze quantities, and Business Standard, "F&O changes from today: Lower Nifty, Bank Nifty lots", 31 December 2025 (business-standard.com)
- QuantPower: algo switch-on checks, restarts and failure handling, from the app's code, checked 12 November 2026
- QuantPower: daily broker sign-in, static IPs and the order path, from the app's code, checked 12 November 2026