The Algo Desk

Trading strategies, written as rules — that run themselves

A strategy shouldn't live in someone's head, or bury its logic in code only its author understands. On the Algo Desk, every strategy is a set of plain, explicit rules — authored, sealed, and run automatically against real market data as a live paper book. This is the engine underneath everything: how strategies are built, the families they come in, and two live ones taken apart side by side.

The Algo Desk is where a trading idea becomes something you can read, test, run, and trust — not a black box, and not a spreadsheet that breaks when you look away. A strategy here is a recipe of rules; the desk compiles it, seals it with a fingerprint, and runs it on live data as a paper book. Let's start with what one of those recipes actually looks like.

The idea

A strategy you can read top to bottom

Here is a real strategy — the built-in Portfolio Auto-Pilot — shown in full, exactly as the desk compiles and runs it. No code, no jargon: just every decision it can make, on real data, read top to bottom.

Portfolio Auto-Pilot — full recipe daily · sealed (ir_hash)
ALGO   Portfolio Auto-Pilot    [daily profile]
================================================================
REGIME (master overlay)
    cash ladder: {CRISIS: 20, NEUTRAL: 0, RISK_ON: 0, RISK_OFF: 0}
    halt new buys in [CRISIS]
    max 25% per sector
UNIVERSE  liquid IN equities + holdings
    where market cap >= ₹1000 Cr
    where ADV >= ₹5 Cr
PORTFOLIO  up to 50 holdings · rank by triple_confirmation, blue_sky, mansfield_rs_level, volume_expanding, stage_in, ias, ad_accumulation
ENTRY  (open a NEW position when)
  ALL of:
    ANY of:
      - Weinstein stage in [2A_EARLY, 2B_MID]
      ALL of:
        - Weinstein stage in [2C_LATE]
        - blue sky (at 52w high, no overhead resistance)
    ANY of:
      - triple_confirmation
      - 4-week volume ratio > 1
    - earnings AND OCF improving
    ANY of:
      - confirmed breakout within 15d (pivot/stop/target)
      - bullish candlestick within 10d
      - bottom reversal within 15d
      - IAS state == ACCUMULATION
    - clear air above — within 15% of 52w high or >= 8% to next resistance
    NONE of:
      - overextended_blowoff {rsi: 70, ext_pct: 20}
      - hollow_breakout {stages: [2A_EARLY, 2B_MID], slope_max: 0.0, vol_ratio: 1.5}
    NONE of:
      - A/D state == DISTRIBUTION
HOLD   (keep while)
  ANY of:
    - Weinstein stage in [2A_EARLY, 2B_MID, 2C_LATE]
    - unrealized return >= 100%
    - weekly trend holds (Stage 2 + above 30W SMA)
    - close > 30-week SMA
ADD    (pyramid a winner when)
  ALL of:
    - unrealized return >= 8%
    - Weinstein stage in [2A_EARLY, 2B_MID, 2C_LATE]
    - clear air above — within 15% of 52w high or >= 8% to next resistance
    NONE of:
      - overextended_blowoff {rsi: 70, ext_pct: 20}
    ANY of:
      - triple_confirmation
      - 4-week volume ratio > 1.0
    -> +1.0% of value until invested = 2.5% (max 5/day)
TRIM   (reduce when)
    - position value > 10% single-stock cap
      -> to_cap 10% [HARD]
TRIM   (reduce when)
    - weekly RSI > 70
      -> by_pct 25%
TRIM   (reduce when)
    - price > 40% above 30W SMA
      -> by_pct 25%
TRIM   (reduce when)
    - Weinstein stage in [3_DISTRIBUTION]
      -> by_pct 33% [HOLD-shielded]
TRIM   (reduce when)
    ALL of:
      - results filed within 15d
      - earnings OR OCF deteriorating
      -> by_pct 33%
TRIM   (reduce when)
    ALL of:
      - 3.125xATR(14) in one bar (7.5-15%)
      - weekly trend holds (Stage 2 + above 30W SMA)
      -> by_pct 33% [HOLD-shielded]
TRIM   (reduce when)
    ALL of:
      - 3xATR(14) from entry (8-20%)
      - weekly trend holds (Stage 2 + above 30W SMA)
      -> by_pct 33% [HOLD-shielded]
    EXCEPT (never soft-trim; HARD cap still fires) when
      ANY of:
        - blue sky (at 52w high, no overhead resistance)
        - Mansfield RS level >= 8 (leadership)
EXIT   (close when)
  ANY of:
    - Stage-4 breakdown >= 10d, not recovering
    ALL of:
      - 3xATR(14) from entry (8-20%)
      NONE of:
        - weekly trend holds (Stage 2 + above 30W SMA)
    ALL of:
      - 3.125xATR(14) in one bar (7.5-15%)
      NONE of:
        - weekly trend holds (Stage 2 + above 30W SMA)
    - 6xATR(14) from peak (15-35%)
    - A/D state == DISTRIBUTION
EXECUTION
    LIMIT orders, stop -10%; max 2 buys / 5 adds per day
    initial tranche 1.5% of value; pyramid to 2.5% cost basis; single-stock cap 10%

Everything a strategy does is one of a small set of verbs — ENTRY, HOLD, ADD, TRIM, EXIT — each a condition written in a shared vocabulary of real market signals (Weinstein stage, relative strength, breakouts, volume, ATR volatility). Because it's written this way, the desk can do four things a black box can't: compile it, back-test it on history, run it live on paper, and seal it with a fingerprint so any later edit is detectable. That's what "deterministic" means here — the same data always produces the same actions, and you can see exactly why.

You can't back-test a hunch, or seal a black box. You can do both to a rule you can read.
The families

Strategies come in classes

A single strategy is an instance; behind it stands a class — a family that defines what kind of strategy it is, what fields you can tune, and how those settings compile into runnable rules. The desk ships six classes today, each a different way to be in the market:

portfolio_daily

Portfolio Rebalance

Screen a liquid universe daily, hold a diversified book of momentum names, manage exits under a regime overlay. The everyday work-horse.

momentum_breakout_daily

Momentum Breakout

Concentrated, built from zero. Enters only on a confirmed breakout, a blue-sky high, or a strong Stage-2 leader. Aggressive by design.

inverse_hs_rs_daily

Inverse H&S · RS Ladder

A pattern specialist: enter on a confirmed inverse head-and-shoulders breakout in a relative-strength leader, equal-weighted.

rs_leader_rotation_daily

RS-Leader Rotation

Start from the current book, then continuously rotate capital toward the strongest Stage-2 relative-strength leaders.

regime_router_daily

Regime Router

A meta-strategy: each day it routes the book to whichever validated child strategy fits the current market regime.

regime_factor_tilt_daily

Regime Factor-Tilt

One engine, two sleeves — tilt to small-caps when the market is calm and rising, defensive quality when it isn't.

Adding a new class is a development task, not a user one — but once a class exists, anyone can spin up a strategy from it, tune its fields in a structured builder or edit its rules directly, and the desk compiles the result into the same kind of runnable, sealed recipe as a built-in.

Live right now

The strategies currently running

Every strategy runs as a paper book — real market data, real rules, real trades, but no real capital at stake — so a dozen ideas can run forward, side by side, and prove themselves (or not) before a rupee is ever committed. Here is the desk today:

StrategyClassSeeded fromStatus
Portfolio Auto-PilotPortfolio Rebalancethe current real bookrunning
Breakout & Blue-Sky MomentumMomentum Breakout₹1 Cr paper cashrunning
Inverse H&S RS-LadderInverse H&Sfrom zerorunning
Regime RouterRegime Factor-Tiltthe current real bookrunning
Small-Cap Auto-PilotPortfolio Rebalancesmall-cap universerunning
Large-Cap MomentumPortfolio Rebalancelarge-cap universerunning
Reset & Concentrate 30Portfolio Rebalancethe current real bookdraft

Notice the "seeded from" column — it's one of the most important differences between strategies, and it's worth dwelling on with the two we'll now open up.

Two strategies, taken apart

Portfolio Auto-Pilot vs. Breakout & Blue-Sky Momentum

Both are momentum strategies. Both share the same non-negotiable risk skeleton — a regime overlay, a 25%-per-sector cap, hard single-stock caps, ATR-based stops. But in temperament they are near-opposites, and the rules make it obvious. First, where they begin:

A Portfolio Auto-Pilot

Seeds from the current real book — it picks up your actual portfolio and keeps flying it. A steady auto-pilot for a whole book.

B Breakout & Blue-Sky

Seeds from zero — ₹1 crore of paper cash and an empty book, filled only by fresh breakouts. A hunter that builds its own book.

That single choice cascades through everything else. Here are the two entry rules, side by side — the heart of each strategy's character:

Auto-Pilot · ENTRY
ENTRY  # diversified, fundamentals-gated
  early-to-mid Stage 2 uptrend
  AND a fresh breakout or rising volume
  AND earnings & cash-flow improving
  AND near a 52-week high
  AND NOT overextended
Breakout · ENTRY
ENTRY  # pure price & momentum
  a confirmed breakout with volume
  OR a blue-sky 52-week high
  OR a Stage-2 relative-strength leader
  # (no fundamentals required)
  AND NOT overextended

Auto-Pilot insists on improving fundamentals before it buys — it wants a real business behind the chart. Breakout doesn't care about the balance sheet at all; it's pure price and momentum, trading confirmed strength wherever it appears. And how they size a position is the mirror image of that:

 Portfolio Auto-PilotBreakout & Blue-Sky
Book sizeup to 50 namesup to 30 names
First buy1.5% of the book — a toe in5% of the book — a real stake
Pyramid up to2.5% cost basis8% cost basis
Single-stock cap10%8%
Buys per day2 buys · 5 adds4 buys · 3 adds
Entry gateprice + fundamentalsprice / momentum only
Trimslooser (40% above trend)tighter (30% above trend)
Temperamentdiversified, patientconcentrated, aggressive

Auto-Pilot spreads across up to fifty names and builds each one slowly, a toe at a time — a diversified caretaker. Breakout runs a tighter book of thirty, takes a real stake on the first buy, and lets its winners grow to twice Auto-Pilot's per-name weight — a concentrated hunter.

We read Auto-Pilot's full recipe at the top. Here is Breakout & Blue-Sky in full — the same non-negotiable risk skeleton, a very different animal:

Breakout & Blue-Sky Momentum — full recipe daily · sealed (ir_hash)
ALGO   Breakout & Blue-Sky Momentum    [daily profile]
================================================================
REGIME (master overlay)
    cash ladder: {CRISIS: 20, NEUTRAL: 0, RISK_ON: 0, RISK_OFF: 0}
    halt new buys in [CRISIS]
    max 25% per sector
UNIVERSE  liquid IN equities
    where market cap >= ₹1000 Cr
    where ADV >= ₹5 Cr
PORTFOLIO  up to 30 holdings · rank by blue_sky, mansfield_rs_level, volume_expanding, stage_in, ad_accumulation
ENTRY  (open a NEW position when)
  ALL of:
    ANY of:
      ALL of:
        - confirmed breakout within 15d, measured-move target >= +10%
        - triple_confirmation (rolling-week)
      - blue sky (at 52w high, no overhead resistance)          # no confirmation required
      ALL of:
        - Weinstein stage in [2A_EARLY, 2B_MID, 2C_LATE]
        - Mansfield RS level >= 10 (leadership)
        - triple_confirmation (rolling-week)
      - quad_confirmation (rolling-week)                        # standalone high-conviction BUY
    NONE of:
      - overextended_blowoff {rsi: 70, ext_pct: 20}
      - hollow_breakout {stages: [2A_EARLY, 2B_MID], slope_max: 0.0, vol_ratio: 1.5}
    NONE of:
      - A/D state == DISTRIBUTION (Wyckoff distribution)
HOLD   (keep while)
  ANY of:
    - Weinstein stage in [2A_EARLY, 2B_MID, 2C_LATE]
    - unrealized return >= 100%
    - weekly trend holds (Stage 2 + above 30W SMA)
    - close > 30-week SMA
ADD    (pyramid a winner when)
  ALL of:
    - unrealized return >= 8%
    - Weinstein stage in [2A_EARLY, 2B_MID, 2C_LATE]
    NONE of:
      - overextended_blowoff {rsi: 70, ext_pct: 20}
    - triple_confirmation (rolling-week)
    -> +1.5% of value until invested = 8.0% (max 3/day)
TRIM   (reduce when)
    - position value > 8% single-stock cap
      -> to_cap 8% [HARD]
TRIM   (reduce when)
    - weekly RSI > 70
      -> by_pct 25%
TRIM   (reduce when)
    - price > 30% above 30W SMA
      -> by_pct 25%
TRIM   (reduce when)
    - Weinstein stage in [3_DISTRIBUTION]
      -> by_pct 33% [HOLD-shielded]
TRIM   (reduce when)
    ALL of:
      - results filed within 15d
      - earnings OR OCF deteriorating
      -> by_pct 33%
    EXCEPT (never soft-trim; HARD cap still fires) when
      ANY of:
        - blue sky (at 52w high, no overhead resistance)
        - Mansfield RS level >= 8 (leadership)
EXIT   (close when)
  ANY of:
    - Stage-4 breakdown >= 10d, not recovering
    - 3xATR(14) from entry (8-20%)
    - 2.5xATR(14) in one bar (6-12%)
    - 6xATR(14) from peak (15-35%)
    ALL of:
      - held >= 30 sessions
      - unrealized return between -8% and 8% (flat / dead money)
      NONE of:
        - Weinstein stage in [2A_EARLY]
    - A/D state == DISTRIBUTION
EXIT-WEEKLY   (re-check weekly; close when)
  ANY of:
    ANY of:
      NONE of:
        - Weinstein stage in [2A_EARLY, 2B_MID, 2C_LATE]
      - Mansfield RS level < 10 (leadership lost)
      NONE of:
        - close > 30-week SMA
EXECUTION
    LIMIT orders, stop -10%; max 4 buys / 3 adds per day
    initial tranche 5.0% of value; pyramid to 8.0% cost basis; single-stock cap 8%
Neither is "better" — they are different bets, and the desk runs both so the market can settle the argument.Two strategies, taken apart
Where they stand

Live, on paper — the early scoreboard

Both books were seeded on 14 August 2026 and have run every trading day since. It is far too early to read anything into four weeks of returns — but the behaviour already shows each strategy being itself:

A Portfolio Auto-Pilot
−1.3%
14 Augdaily NAV · 11 Sep
book value₹1.915 → 1.891 Cr
holdings36 of 50 held
activity31 trades · 5 days
characterhold-heavy

Held a full 50-name book, then trimmed to 36 as leadership faded — a caretaker that acts rarely, and only in size.

B Breakout & Blue-Sky
+5.8%
14 Augdaily NAV · 11 Sep
book value₹1.00 → 1.058 Cr
holdings25 of 30 built
activity56 trades · 14 days
characteractively building

Deployed ₹1 Cr of cash into fresh breakouts, trading on 14 of ~20 sessions to build a 25-name book.

Read this honestly

Four weeks is noise, not signal — these numbers prove the machinery works, not that one strategy beats another. The point of running them as paper books is exactly this: let them compound forward across real markets and regimes, on the record, until the evidence is actually worth something.

Under the hood

From a written rule to a running book

Whichever strategy you're looking at, the path from rules to results is the same — and it's what makes the whole desk trustworthy:

Author the rules form builder or DSL Compile & seal → sealed recipe fingerprint (ir_hash) Back-test replay on history Run as a paper book seed → live data, daily from holdings · or from cash Performance scored, on the record Real market data — prices, stages, relative strength, fundamentals
Author → compile & seal → back-test on history and run live on paper → scored performance. The seed step is where a strategy's character starts: from your real holdings, or from cash.

Two properties do the heavy lifting. First, the sealed recipe: every strategy — and every later edit — is stamped with a fingerprint, so what ran last Tuesday is provably the exact rules you can read today. Second, the paper book: because nothing risks real capital, the desk can run many strategies forward at once and let evidence, not opinion, decide which deserve attention.

Strategies as readable rules Six strategy classes Structured builder or direct DSL Compiled & fingerprint-sealed Back-tested on history Run live as paper books Seed from holdings or cash Many strategies, side by side

Where it sits

The desk in the bigger picture

The Data PlatformBelow it

The clean, point-in-time market data every strategy reads — prices, Weinstein stages, relative strength, accumulation, fundamentals — for Indian and US equities. Covered in its own article.

The Market-Intelligence & Charting TerminalBeside it

The interactive terminal where a human reads the same signals a strategy trades on — stage analysis, relative strength, institutional accumulation. Covered separately.

The Agentic LayerAbove it

An optional layer that lets a strategy improve itself — an AI proposing changes to its own rules, behind a deterministic guardrail. It builds directly on the sealed recipes described here. Read the agentic-layer article →

The close

Rules you can read, results you can trust

The whole point of the Algo Desk is to take the mystery out of a systematic strategy. You can read exactly what it does. You can watch it run on real data without risking a rupee. You can compare a patient caretaker against an aggressive hunter and let the market referee. And whatever a strategy did, the sealed recipe proves precisely which rules it followed.

Dhakua Research builds research infrastructure. Nothing here is a recommendation, a tip, or a promise of returns — it is a description of how strategies are engineered, tested, and run in the open.