StrategyLab
How it works

AI understands your idea. A calculator does the maths.

Language models are good with words and bad with numbers. So Strategy Lab splits the job: the AI only translates your question into exact rules, and a deterministic backtest engine produces every number.

1

You ask

In plain English, as you would ask a friend.

2

AI writes the rules

Your idea becomes a strict strategy spec: symbol, money, entry, exit, period.

3

Validator checks them

Wrong symbol or impossible rule? It goes back to the AI to fix, like a compiler error.

4

Engine runs day by day

Every trading day since the start: contributions, signals, trades, costs, interest.

5

You see and refine

Chart, XIRR, worst fall, every trade. Then ask a follow-up.

Your words

What you type

Start with ₹1 lakh in HDFCBANK. Buy when RSI(14) falls below 30, sell at +8% profit or -5% loss. Idle cash earns 6%, 0.2% cost per trade. Compare with buy and hold over the last 15 years.

Test it in the Lab

The rules the engine runs

{
  "title": "RSI oversold bounce: HDFCBANK",
  "years": 15,
  "cost_pct": 0.2,
  "assumptions": [
    "₹1,00,000 invested once; each trade uses all available cash",
    "0.2% cost on every buy and every sell (STT, brokerage, exchange charges, stamp duty)",
    "Cash waiting between trades earns 6% a year, like a liquid fund",
    "Prices are daily closes; indices are price indices (no dividends), stock prices include dividends",
    "Taxes are not deducted"
  ],
  "strategies": [
    {
      "name": "Buy & hold",
      "symbol": "HDFCBANK",
      "contribution": {
        "amount": 100000,
        "every": "once"
      },
      "buy": {
        "when": "on_contribution"
      }
    },
    {
      "name": "RSI oversold bounce",
      "symbol": "HDFCBANK",
      "contribution": {
        "amount": 100000,
        "every": "once"
      },
      "cash_interest_pct": 6,
      "buy": {
        "when": "signal",
        "check": "daily",
        "condition": {
          "type": "rsi",
          "days": 14,
          "op": "<",
          "value": 30
        },
        "amount": "all_cash"
      },
      "sell": {
        "check": "daily",
        "condition": {
          "type": "any",
          "conditions": [
            {
              "type": "position_return",
              "op": ">=",
              "value": 0.08
            },
            {
              "type": "position_return",
              "op": "<=",
              "value": -0.05
            }
          ]
        },
        "fraction": 1
      }
    }
  ]
}

Building blocks you can use

Mix and match these in one sentence.

Price change“falls 4% in a week”, “up 20% in a year”, “down 7% in 5 days”
Fall from peak“10% below its all-time high”, “at a 52-week high”
Moving averages“above its 200-day average”, “2% below the 50-day EMA”
RSI“RSI(14) below 30”, “RSI above 70”
Crossovers“20-day EMA above 50-day EMA”, golden cross
Profit & loss“sell at +8% or −5%”, “book 25% at +40%”
Combine“above 200 DMA and down 4% in 5 days”, any / all
Moneylump sum, monthly or weekly SIP, fixed amount per signal, idle cash interest

The data

  • 1,471 NSE stocks with market cap above ₹1,000 crore, daily closes adjusted for splits, bonuses and dividends
  • 11 indices and ETFs: NIFTY50, BANKNIFTY, SENSEX, NIFTY100, NIFTY500, NIFTYMIDCAP50, NIFTYBEES, NIFTY200, NIFTYNEXT50, NIFTYMIDCAP150, NIFTYSMALLCAP250
  • NIFTY 50 from 17 Sep 2007; most large stocks from 2005; prices up to 19 Nov 2026
  • Indices are price indices (no dividends). For NIFTY with dividends, use NIFTYBEES

How the engine trades

  • Uses daily closing prices; one position per strategy, which can be split into up to 4 parts
  • Applies the cost you set (we use 0.2% per buy and per sell) and optional interest on idle cash
  • Signals are checked daily, at week end or at month end, using only prices known on that day
  • Reports final value, XIRR, maximum drawdown, trades, win rate and time invested
  • Does not deduct taxes, and the stock list is today's (survivorship bias)