Why Did My Algo Strategy Fail? Common Mistakes and Fixes
An algo strategy usually fails for one of two reasons: it didn't trade the way you intended (a setup or execution problem such as an expired broker session, a rejected order or a rule that never triggers), or it traded as designed and lost (overfitting, ignored costs, weak risk control, a changed market or simply a normal drawdown). Diagnose which one first; the fixes are completely different.
Step 1: Work out which kind of failure it is
| Symptom | Probably | Look at |
|---|---|---|
| No trades at all, or far fewer than expected | Setup or execution problem | Notification log, broker connection, conditions |
| Orders placed but rejected | Execution problem | Margin, order type, instrument, broker messages |
| Trades at times or prices you didn't expect | Logic problem | Runtime data, condition definitions |
| Trades as designed, but losing | Performance problem | Live vs backtest, drawdown, costs |
When the strategy didn't trade as intended
These are the most common causes, roughly in order of how often they come up:
- The broker isn't connected. Broker sessions usually need to be renewed regularly. An expired session means orders can't be placed. Check the connection before the market opens.
- Not enough margin. F&O orders get rejected if the account can't cover the margin. Check margin for the full position, including hedges.
- The contract changed. NIFTY's lot size is 65 now and BANK NIFTY's is 30. NSE's weekly index expiry (NIFTY only) is on Tuesday, and BANK NIFTY, FINNIFTY and MIDCPNIFTY have monthly expiries only. A strategy written for an older setup may pick the wrong contract or a size that no longer exists. Our post on the NIFTY 65 and BANK NIFTY 30 lot sizes lists what to check.
- A condition can never be true. For example, an entry time outside market hours, or two conditions that contradict each other.
- It's deployed in the wrong mode. A strategy left in Live Offline records trades but sends nothing to the exchange; Live Auto sends orders to your broker. Make sure you're looking at the mode you meant.
- Execution settings. Limit pricing that never fills in a fast market, with no fallback, can leave entries or exits unfilled.
On Tradetron, the strategy's notification log and runtime data (both in the three-dot menu on the Deployed page) show what the strategy checked, decided and sent. The guide to debugging a strategy on Tradetron walks through them.
When the strategy traded as designed and lost
Is it actually failing, or just in a normal drawdown?
Every strategy has losing streaks, and they are longer than most people expect. Over 100 independent trades, a strategy that wins half the time has better-than-even odds of a run of six losses somewhere, and a 40% win-rate strategy is more likely than not to see a run of seven.
Calculated for independent trades. Long losing runs are a normal part of any strategy
Before you call a strategy broken, compare the current drawdown with the worst one in its backtest. If it's within that range, the strategy may be doing exactly what it did before. If it's clearly beyond it (as a rough rule, more than 1.5 times the tested worst), something may have changed.
The six usual root causes
| Cause | What happened | Fix |
|---|---|---|
| Overfitting | Settings were tuned until the backtest looked perfect, so they fit past noise | Fewer settings, values from a stable range, check on held-back data |
| Ignoring costs | Brokerage, taxes and slippage weren't in the test | Apply realistic costs in the backtest; trade less often or more liquid contracts |
| Weak risk management | No stop, no daily limit, size too large | Stops on every position, a daily loss limit, size by risk |
| The market changed | The pattern the strategy relied on faded, or the contract changed | Review the logic; adapt with tested changes or retire the strategy |
| No forward testing | Went straight from backtest to full size | Run Live Offline first, then go live small |
| Human interference | Switched off in a drawdown, sized up after a win, edited mid-session | Pre-commit to review rules; change only through testing |
1. Overfitting
The classic failure. A strategy tried in fifty versions, with the best one kept, will usually disappoint live. The backtesting mistakes guide shows with a simulation how a strategy with no real edge can look excellent after enough tries.
2. Ignoring transaction costs
Read understanding slippage for how to estimate it.
3. Poor risk management
A strategy with no stop, or sized too large, can be profitable for months and then give it all back in a day. Seven ways to reduce drawdown covers the controls every strategy needs.
4. Static rules in a changing market
Markets move between calm and volatile, trending and sideways. A strategy built for one condition will struggle in the other. That isn't always failure; it may be a strategy that needs a filter, or one that should only run in certain conditions. If it has been fading for a long time, read strategy fatigue.
5. No testing in live conditions
A backtest can't see your broker's fills, delays between signal and order, or a logic error that only shows up in real time. Live Offline testing catches many of these before they cost anything.
6. Unclear objectives
Without a defined goal (what return, at what maximum drawdown, over what period), you can't tell a failing strategy from a normal bad month, and every loss becomes a reason to change something. Write the objective down before deploying.
A recovery plan when a strategy disappoints
- Pause new risk, don't panic-exit unless there's an operational fault.
- Check execution: logs, broker connection, rejected orders.
- Compare live with the backtest for the same days. Same trades? Same prices?
- Compare the drawdown with the tested worst.
- Re-run the backtest including recent data, with realistic costs.
- Change one thing, test it, and run it Live Offline before redeploying.
- Retire it if the edge has gone. Not every strategy should be saved.
Also useful: what to do when live algo trades don't perform as expected.
Frequently asked questions
Why is my algo strategy not taking trades?
The most common causes are an expired broker session, insufficient margin, a contract that has changed (lot size or expiry), conditions that can't be met, or the strategy running in a different mode than you expected. The strategy's logs show which.
Why does my strategy lose money live when the backtest was profitable?
Usually because of costs and slippage the backtest didn't include, overfitting during development, or a market that has changed since the tested period. Compare live trades with the backtest for the same days to find the gap.
How do I know if my strategy is broken or just in a drawdown?
Compare the current drawdown with the worst drawdown in the backtest. If it's within that range, it may be normal. If it's well beyond it, or the strategy is taking trades that its rules shouldn't produce, investigate before continuing.
How can I detect overfitting?
Warning signs are many tuned settings, results that collapse when a setting changes slightly, and a big drop in performance on data that wasn't used to build the strategy.
How often should I update my algo strategy?
Review results every month and re-test every few months with new data, but change rules rarely and only after testing. Update immediately when a contract changes, such as a lot size or expiry day.
Can algo trading eliminate risk?
No. It enforces your rules consistently and removes many human errors, but market risk, execution risk and the risk that the strategy's edge fades always remain.