Skip to content

Why Anakin Failed Performing in Indian Markets

By OpenKuber Research ·

Author: Paul K
Published Date: 2026-03-22T08:23:15.214Z


A technically sophisticated AI trading system met a market that runs on signals no model was trained to see. This is what 167,000 lines of live execution logs look like when the thesis is wrong.

Part 1: The Diagnosis — what broke and why

In March 2026, a tweet circulated among India's finance and fintech crowd. It wasn't about AI or algorithms. It was about Kotak Mahindra Bank.
Image

In March 2026, a tweet circulated among India's finance and fintech crowd. It wasn't about AI or algorithms. It was about Kotak Mahindra Bank.

That last line is the entire thesis of this post-mortem. Markets reward fundamentals eventually — but never on your timeline. And a trading agent that must make decisions every 30–60 minutes? It is always working against that timeline.

This is the story of Anakin, our causal AI trading system built on top of LabhLabs. What it was, why it should have worked in theory, why it didn't work in practice, and what Indian markets actually demand from any system trying to beat them.

What Anakin Actually Was

Most algorithmic trading systems pick a lane: either rigid rule-based logic ("buy when RSI crosses 30") or ML models that predict price direction. Anakin tried to occupy a different position entirely; a reasoning agent that could explain its decisions using causal inference rather than correlation.

It was a three-layer system running on NSE live data through a broker API we built called Bison:

Image

The Causal Engine was the centerpiece. Instead of asking "what direction will this stock move?", it asked a fundamentally different question: "If I take this specific action right now, what additional profit is caused by that action, versus doing nothing?" It used Microsoft's EconML library, a Double Machine Learning framework from academic economics, trained on 12 technical indicators per symbol.

The SymbolicGuardian was intentionally adversarial to the LLM. No matter what Gemini decided, the guardian would clip or block any order that violated hard portfolio limits. A hallucinating model couldn't blow up the account. That part worked exactly as designed.

The 0.15% threshold was the break-even filter. NSE intraday has brokerage, STT, exchange charges, GST adding up to roughly 0.10–0.15% per round trip. Any trade that the causal model predicted would return less than that was automatically skipped. Smart in theory. Brutal in practice because it meant the model had to be right by more than the cost of being wrong.

What the History Actually Shows

The full trade history is public. You can see every decision, every execution, every result at labh.openkuber.com/history. We're not hiding the losses, the whole point of building in public is that the failures teach more than the wins.

Image

The headline finding: every model worked for a while, then stopped working. The pattern was consistent across all six strategies; Anakin (Gemini + causal ML), plain Gemini 2.5, Llama 4 Scout, GPT-4.1-nano, Qwen3-32B, and Kimi-K2. Initial trades captured momentum correctly. Then the market shifted and none of them adapted.

"Anakin wasn't failing because the causal math was wrong. It was failing because it was solving a precise, quantitative version of the wrong problem."
— Internal post-mortem, OpenKuber team

Causal Inference on the Wrong Features

The causal model was trained on 12 features. Every single one of them was a technical indicator derived from price and volume data:

python
# The 12 features Anakin's causal engine could see
features = [
 "Rsi_14", # momentum oscillator
 "Macdh_12_26_9", # trend/momentum crossover
 "Roc_15", # rate of change
 "Price_vs_sma20", # price relative to 20-day average
 "Sma20_vs_sma100", # short vs long-term trend alignment
 "Bb_position", # position inside Bollinger Bands
 "Atr_14", # volatility proxy
 "Volume_ratio", # current vs average volume
 "Momentum_5", # 5-day price momentum
 "Vwap_deviation", # price vs VWAP
 "Obv_slope", # on-balance volume trend
 "Adx_14" # trend strength
]

# What it could NOT see
missing = [
 "FII / DII net flows",
 "RBI policy stance",
 "IMD monsoon forecast updates",
 "State election calendar",
 "Ministry of Finance capex announcements",
 "SEBI regulatory changes",
 "Global crude oil price direction",
 "USD/INR movement"
]

This is the fundamental problem. The causal model was mathematically rigorous about asking "what additional profit does this action cause?" — but it could only compute that answer from price history. And price history in Indian markets is downstream of forces that never appear in an OHLCV chart.

Indian markets are policy-driven, not just earnings-driven

This is the piece that Western trading literature often misses when applied to India. A Nifty Bank constituent like HDFC Bank or ICICI Bank doesn't move primarily on earnings beats. It moves on:

What Actually Moves NSE Stocks

FII/DII flow data — Foreign institutional investors can enter or exit ₹5,000–10,000 crore in a session, dwarfing any technical signal. RBI's rate stance a 25bps shift or even a hawkish tone in the MPC minutes re-prices the entire banking sector immediately. Budget announcements and state elections. Indian markets have a well-documented pre-election rally pattern in capex-linked sectors. None of this is in RSI.

Kotak's situation from the tweet above is the cleanest illustration. Profits grew at 21% CAGR for five years. The stock returned nearly nothing. Why? Because the market's valuation multiple compressed, investors were willing to pay less per rupee of earnings than they were five years ago. That re-rating has nothing to do with RSI or MACD. It's about interest rate environment, regulatory pressure on the private banking sector, and shifting institutional preference toward PSU banks. Anakin's causal model had no visibility into any of it.

Why the Other Models Worked Until They Didn't

Alongside Anakin, we ran five other LLM strategies in parallel, each with its own Bison account, each trading independently. The design was a tournament: let every model run its own approach and see who survives. The logs ran from January 14 to March 20, 2026 — 167,564 lines of live execution data across 67 trading days.

Image

All six models started with a 100% success rate. The very first completed cycle on January 14 at 11:03 AM: 11 trades, 11 successful, every strategy green. But "successful" meant the broker accepted the order — not that it was profitable. This distinction erased weeks of misreading the system's health.

The LLMs were all extremely articulate about the wrong data. They gave precise, confident reasoning about RSI and EMA crossovers — in market conditions where those crossovers were completely irrelevant.

What each model was actually seeing

Each model received the same condensed context every cycle, intentionally compressed to fit token limits, especially for the Groq models:

bash
# Actual format from the execution logs
"ETERNAL:293.95|R:58.3|T:bullish"
"HDFCBANK:932.4|R:44.1|T:neutral"
"TCS:3206.6|R:70.89|T:bullish"
# LTP | RSI-14 | EMA Trend. That's the entire world.

When you only give a model LTP, RSI, and EMA trend, that's all it can reason about. Gemini 2.5 Pro is one of the most capable reasoning models available. But no reasoning capability compensates for a missing variable. You cannot reason your way to "FII sold ₹8,000 crore today" from an RSI reading.

Starting Every Trade in a Hole

There's a structural constraint that made every failure more expensive: brokerage and transaction costs on NSE. Every intraday round trip carries STT, exchange charges, GST on brokerage, SEBI fees, and stamp duty. The total damage on a typical intraday trade is around 0.10–0.15% of trade value.

This is why Anakin had a hard threshold — no trade would execute unless the causal model predicted ≥ 0.15% profit impact. But that's a very high bar. The model needed to be not just directionally right, but confidently right by more than the cost of participation.

Image

A model that's right 55% of the time on direction but working with only technical indicators is not profitable after costs. The math is brutal. In liquid stocks like HDFCBANK or RELIANCE, the real edge comes from catching the 1–2% moves, not the noise. And those large moves are almost always triggered by macro or news not by RSI reaching 30.

What research actually says about RSI and MACD in Indian markets

There's an uncomfortable finding buried in academic literature that every technical analyst in India quietly ignores. A 2015 study published in the Asian Journal of Research in Banking and Finance one of the most cited papers specifically on RSI and MACD performance on NSE stocks found that for standard (non-optimized) indicators,buy-and-hold outperformed both MACD and RSI across most of the six sectors tested. Only when the parameters were specifically optimized for each stock did the indicators beat passive holding. Standard RSI-14 with the textbook 30/70 thresholds that every trading tutorial teaches? Underperformed doing nothing in most Indian sectors tested.

A broader academic study examining technical indicators across multiple market types found that "all technical indicators perform poorly in terms of profitability and predictive power" with the caveat that developing markets showed slightly better results than developed ones, though "results are not conclusive." Indian markets fall into this developing-market category, which is why the indicators showed some signal at all. But "some signal in a research paper" is very different from "enough edge to clear 0.15% per trade after costs."

The Uncomfortable Truth About RSI

RSI was developed in 1978 by J. Welles Wilder for commodity markets. It has been used for 47 years, has been in every trading textbook since the 1980s, and is one of the most studied indicators in finance. When signals are that widely known and acted upon, they tend to be arbitraged away. The edge from RSI-30 "oversold" signals in liquid NSE stocks if it ever existed was priced out long before Anakin came along. Any system that relies on it as a primary signal is starting from a deficit.

The Signals That Were Always Missing

If we were to rebuild the feature set not just for Anakin, but for any agent seriously attempting intraday NSE trading, it would look fundamentally different from 12 technical indicators. And the research on what actually moves Indian markets is more nuanced than the usual narrative suggests.

A 2025 study covering Nifty 50 flows from 2015–2025 found that FII net withdrawals explain only about 16.5% of the variation in market performance far less than popular belief would suggest. DII inflows, by contrast, showed a strong positive association with index stability, particularly during the sharp FII exit years of 2022, 2024, and 2025. The story of Indian markets post-2020 is partly the story of domestic institutional money offsetting foreign selling and any system that tracks only FII data while ignoring DII is reading half the picture.

Image

There's a particularly counterintuitive finding worth sitting with. Research applying NLP to a decade of RBI communications (2014–2024) found that dovish sentiment in MPC communications generally led to equity market declines, especially in sectors related to economic growth and interest rate policy. Market participants interpreted dovish language as signalling economic weakness not as a green light to buy. This is the opposite of the simple mental model most retail investors carry. The relationship between central bank tone and market response is not linear or obvious, and no technical indicator in Anakin's feature set could capture it.

The correct mental model for Indian markets: macro signals determine direction, technical signals determine timing. Anakin only had the timing layer. It was optimally executing in the wrong direction and often, in the wrong direction for reasons that weren't even visible in any data it could access.

The Parts of Anakin That Did Their Job

A post-mortem that only catalogues failures isn't honest. Several components of the Anakin architecture performed exactly as designed — and these are the parts worth carrying forward.

The SymbolicGuardian was genuinely valuable

The rule-based safety layer hard limits on position size (95% max), short exposure cap (50%), automatic order clipping worked perfectly throughout. No position was ever taken that violated portfolio risk rules, regardless of what the LLM decided. In a world where LLMs can hallucinate order quantities, this kind of adversarial safety layer is not optional. It's essential infrastructure. The Guardian blocked 2,180 attempts across the run. Every one of those blocks was correct.

The loop detection was production-grade

The agentic loop included a mechanism to detect when Gemini was calling the same tool four times in a row, a symptom of the model getting stuck in a reasoning loop. This terminated gracefully rather than burning API credits or accidentally placing duplicate orders. The 28 FATAL LOOP terminations logged across the run represent the system working correctly, not failing. Small engineering detail, large operational importance.

The causal framing was architecturally correct

Asking "what profit is caused by this action?" rather than "what direction will price go?" is fundamentally the right question for a trading agent. The CausalForestDML approach using Double Machine Learning to isolate treatment effects from confounders is the right architecture. It just needs to be fed features that actually explain Indian market returns, not just technical indicators derived from the same price series it's trying to predict. The math was sound. The inputs were wrong.

The 0.15% threshold was protective

As frustrating as it was to watch Anakin skip trades, the threshold probably saved the account from deeper losses. By March 20, Anakin still had ₹88,421 in cash by far the healthiest balance of any strategy, because it refused to trade when the causal signal was weak. Compare that to Kimi-K2 with ₹70.78. The model that traded most aggressively died fastest.

Part 2 Preview: The Map Forward

Part 1 is the diagnosis. If you've read this far, you understand what broke and why. But the more interesting question and the one that actually matters for building something better is what the architecture of a system that doesn't fail these ways looks like.

Part 2 goes deep on three things:

Coming in Part 2

Why LLM agents are fundamentally stateless — and what the latest research (A-MEM at NeurIPS 2025, TradingAgents, the ACM survey on agent memory) says about solving it in financial contexts. What a proper Indian market signal hierarchy looks like — not a wishlist, but a layered architecture grounded in how money actually flows through NSE. What IROHA is building — the "Why is [stock] moving today?" engine, causal graph UI, and what it means for SEBI-registered RIAs trying to explain portfolio decisions to clients.

The failure of Anakin is the specification document for IROHA. The architecture stays. The data layer changes entirely. The question we're building toward is one our users actually ask when they open their trading app in the morning: "Why is HDFCBANK moving today?" Not a price prediction. A causal explanation with a chain of evidence.

Follow the Build

The full trade history from LabhLabs is public at labh.openkuber.com/history. Every win, every loss, every loop termination — 67 days of live execution. If you're building in this space or want to watch what a causal AI system looks like when it's honest about its failures, it's all there.

OpenKuber provides research infrastructure to regulated financial firms. Nothing on this site is investment advice or a recommendation to buy, sell or hold any security. OpenKuber is not registered with SEBI as an investment adviser or research analyst. Past price moves and model results do not indicate future performance. LabhLabs results come from paper trading; no real money is used.

Related: How to Build AI That Explains Itself: Causal Ontology in IROHA · The Map Forward: Stateful Agents and Causal Architecture · How IROHA works