Register
Learn guide

Fix Broker Connection Problems

Most broker connection problems come from an expired session, an API key or static IP that does not match what your broker has on record, or an order that your broker's risk system will not accept. This guide to troubleshooting algo trading lists the common problems, what they mean and how to fix them, from login errors to rejected orders and strategies that do not trade.

QuantPower Research · Updated 16 Nov 2026 · 20 min read

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

Flowchart of five checks for algo trading problems, each with its fix (illustration)

Most problems are solved by one of these:

  1. Have you signed in to your broker today? Broker sessions end every day, so a strategy cannot trade until you sign in again.
  2. 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.
  3. Is the segment active? Options and futures need F&O enabled on your broker account.
  4. Is there enough margin? Option buyers need the full premium in the account, and sellers need SPAN and exposure margin.
  5. 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.

StepWhat is checkedTypical failure
1. The strategyIts rules, times, days and statusNo order at all: the conditions were not met, or the strategy was paused or off
2. The platformInstrument, lot size, tick size, your own risk limitsRefused before it leaves: kill switch on, daily loss limit reached, contract expired
3. The broker sessionThat you are signed in for today"Session expired", "invalid token", "Sign-in needed"
4. The network routeThat the order comes from your registered static IP"IP not allowed", "IP mismatch"
5. The broker's risk systemMargin, segment, order type, product, restricted contracts"Insufficient margin", "segment not enabled", "blocked by RMS"
6. The exchangePrice band, freeze quantity, ban list, order rate"Price outside band", "quantity above freeze limit", "too many requests"
7. The marketWhether anyone will trade at your priceOpen 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

ProblemLikely causeWhat to do
Session expired or invalid tokenYour broker ended the previous day's sessionSign in to your broker again; brokers end sessions every day
"Sign-in needed" on the broker rowThe day's session has ended or was never startedSign in from the broker row before the first entry time
Two-factor code rejectedYour phone's clock is out of sync, or the code expiredSet your phone to automatic time and use a fresh code
Invalid API key or secretThe key was deleted or regenerated, or was copied wronglyCopy the current key and secret from your broker's API console and connect again
API subscription lapsedYour broker charges for API access and the plan has expiredRenew it in your broker's API console, then sign in again
IP not allowed or IP mismatchThe static IPs registered at your broker are not the ones your orders leave fromCopy 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 loginThe browser blocked a pop-up or cookiesAllow pop-ups for quantpower.tech, or try another browser
Funds or positions do not appearThe sign-in did not complete, or the broker's API is downReconnect, then check the QuantPower status page and your broker's app
"Activation pending" on a brokerThat broker's order connection is not active yetYour keys are saved, encrypted, but nothing is sent to that broker until its connection is active
"Sample data" shows when you try to orderYou are exploring with sample data and no broker is connectedConnect your stock broker; sample data places nothing
Account lockedToo many wrong passwords or codesUnlock 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 typeHow you sign in each day
Brokers on the XTS trading systemTap "Log in again"; the saved key is used and the row shows when the session ends
Zerodha, Upstox and FyersSign in on the broker's own page and come back; Zerodha and Upstox tokens end early the next morning
DhanPaste a new token when the old one ends; the token's own expiry is used
ShoonyaA 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 seeWhat it meansWhat to do
Insufficient funds or marginThe order needs more margin than is freeAdd funds or reduce lots. For spreads, buy the hedge legs first
Segment not enabledF&O is not active on your broker accountActivate it with your broker, which may ask for income proof, and try again once it is active
Market orders not allowedYour broker blocks market orders in this contractUse a limit order priced near the best bid or ask
SL-M not allowedNSE does not accept SL-M orders in optionsUse an SL order with a buffer between trigger and limit
Trigger price on the wrong sideA sell stop's trigger is above the last price, or a buy stop's is below itMove the trigger to the other side of the market
Quantity not a multiple of lot sizeThe lot size was revised, or the quantity is wrongUpdate the quantity. Since 31 December 2025, Nifty's lot is 65 and Bank Nifty's is 30; Sensex's is 20
Quantity above freeze limitThe order is larger than the exchange's freeze quantity for that contractSplit it, for example with iceberg orders. Freeze limits change with lot sizes, so check NSE's current list
Price outside the price bandThe exchange accepts limit prices only within a set range around the current price, and each option has its own bandUse a price inside the band your broker's terminal shows, closer to the best bid or ask
Security in ban periodThe stock is in the F&O banYou can only reduce existing positions until the ban ends
Order rate exceeded or too many requestsThe strategy sent orders faster than the exchange or your broker allowsSpace 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 expiredThe strategy points to an expired contractSelect a current expiry
Blocked by RMSYour broker's risk team has restricted the contract or the accountAsk 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:

  1. A live algo needs a connected broker. With none, the app offers Forward test instead.
  2. With two or more brokers connected, you pick one, and every leg goes to it.
  3. If the kill switch would still be on for that segment at the algo's first entry, the switch-on is refused.
  4. If today's loss has already reached your daily loss limit and the algo would enter today, it is refused.
  5. If the algo would enter right now and your broker is not signed in, it is refused.
  6. A fixed leg whose contract has expired cannot be switched on.
  7. Up to 20 algos can run at once, with up to 6 legs each.
  8. Your token wallet must cover the charge.
  9. 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 happensWhat 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 refusedIt tries again, up to 8 times, with a growing gap. The card shows what is still owed
Prices or Greeks are missingIt waits and says why. No strike, target or stop is ever decided on a guess
The broker is not answeringOrders are refused, not assumed. Nothing is treated as "no position"
The broker was disconnectedThe algo cannot place orders there. A restart is refused until it is connected again
A fixed contract expiredThe algo stops and says which contract
Tokens run out at the end of the 28 daysThe 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

ProblemLikely causeWhat to do
Order placed but not filledThe limit price is away from the market, or the contract is thinPrice closer to the best bid or ask, or trade a more liquid strike
Partly filledNot enough quantity at your priceLeave it open, change the price or cancel the rest
Entry still open after several secondsThe market moved away from the limitIn 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 triggerThe price moved quickly between trigger and fillReview the buffer, or add an account-level limit such as a daily loss limit
Stop loss did not fillThe price jumped past the SL order's limitExit manually, then widen the buffer between trigger and limit
Positions differ between QuantPower and your brokerYou traded the same contract by hand, or an order filled in partsRefresh, and avoid trading by hand in positions a strategy manages
Duplicate ordersThe same strategy was switched on twice, or an order was resent after a timeoutCheck 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

TimeCheck
Before 9:00Sign 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:15Check which strategies are scheduled, the day's expiries and the F&O ban list, and read any broker or exchange notices
9:15The normal market opens for equity and F&O
During the dayCheck the order book, positions and each algo's card after every entry
Before the closeConfirm intraday positions closed as planned. Since 3 August 2026, F&O trading runs until 3:40 pm
After the closeRead 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.

References

  1. SEBI, broad guidelines on algorithmic trading, circular of 30 March 2012 (sebi.gov.in)
  2. US Securities and Exchange Commission, *In the Matter of Knight Capital Americas LLC*, order of 16 October 2013 (sec.gov)
  3. 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)
  4. NSE, circular NSE/FAOP/49677 on discontinuation of stop-loss market orders in options, September 2021 (nseindia.com)
  5. 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)
  6. 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)
  7. QuantPower: algo switch-on checks, restarts and failure handling, from the app's code, checked 12 November 2026
  8. QuantPower: daily broker sign-in, static IPs and the order path, from the app's code, checked 12 November 2026
Trading involves substantial risk. This page is for information and is not investment advice.