Strategy Docs

Corporate Actions & Lifecycle Events

How the backtester handles splits, bonuses, mergers, delistings and other corporate events that affect your positions.

Back to Strategy Builder
How the Data Pipeline Works
🔁
End-to-End Pipeline — Every Trading Day
daily-pipeline

Every day we run a fresh pipeline that rebuilds clean, CA-adjusted price data from scratch. Here is exactly what happens in order:

1
Copy raw prices from the Vault
We take the full unmodified price history (every trading day since 2000) and copy it into a fresh staging area. These prices are raw — no adjustments yet.
2
Load all known corporate actions
All historical corporate actions (splits, bonuses, mergers, delistings etc.) are copied in from our historical CA database, then topped up with any newly published announcements since our last run.
3
Cross-verify ratios across data feeds
Original announcements sometimes don't include the split/bonus ratio in machine-readable form. We automatically cross-reference multiple feeds to fill in the ratio. Any that still can't be resolved are flagged for manual review.
4
Apply manually reviewed corrections
If a CA was flagged for manual review and our team has since filled in the correct ratio via the Data Control Center, those corrections are applied now — before any price adjustment runs. Nothing is adjusted without a valid ratio.
5
Append today's intraday-close prices
Recent EOD prices (from the vault max date up to today) are appended from our live feed. These are the most current trading day candles, bridging the gap between the historical vault and today.
6
Apply CA price adjustments backward
For every split, bonus and face-value split: all historical prices before the ex-date are multiplied backward so the series is continuous.

Example: 2:1 split on 1 May → every Close before 1 May is divided by 2. On 30 April the price was ₹100, after adjustment it shows ₹50. On 1 May it opens at ~₹50. No jump, no gap.
7
Derive lifecycle events
From the full CA list, we classify each event: simple ones (splits, bonuses) are auto-parsed. Complex ones (mergers, delistings, demergers) go into a manual review queue. All previously reviewed events are preserved and never overwritten.
8
Promote to live Data
The entire staging area (adjusted prices + lifecycle events) is snapshotted for safety, then promoted to the live Data layer that all strategies read from. If any step fails, the system automatically rolls back to the last good snapshot.
Safety guarantee
Every CA adjustment is tracked with an idempotency key (isin, ex_date, action_type). The same adjustment can never be applied twice. If the pipeline runs again, it skips already-applied events — prices are never double-adjusted.
🔍
How We Verify Every Corporate Action
multi-feed cross-verification

Every corporate action is verified across multiple independent feeds before its ratio is applied to the price series.

LayerWhat it providesUsed for
Primary feed Official CA announcements with ex-dates Event type and ex-date
Secondary feed Machine-readable ratio confirmation Fills any missing ratio from primary
Manual review Team-verified ratio via Data Control Center Final fallback when automated feeds disagree
Bonus ratio normalisation
Different feeds express bonuses differently — some use the total multiplier (e.g. 2.0 for a 1:1 bonus), others use bonus-shares-per-existing-share (e.g. 1.0). We normalise every incoming ratio to the same convention before storing so the price-adjustment formula is always consistent: price_factor = 1 / (1 + ratio).
👁️
Manual Review Queue
Data Control Center → CA & Lifecycle

Not every corporate action can be auto-processed. Complex events and missing ratios go into a review queue where our team fills in the missing information.

Goes to manual review
• Split or bonus with no ratio found in any automated feed
• Merger — needs new ISIN + conversion ratio
• Demerger — needs child ISIN + allocation ratio
• Delisting — needs confirmation and exit handling
• Symbol / ISIN change — needs new symbol/ISIN
Auto-resolved
• Split with confirmed ratio ✓
• Bonus with confirmed ratio ✓
• Face-value split with ratio ✓

These are applied to price history automatically on the next pipeline run.
What happens after manual review is saved
Once our team saves a manual ratio or lifecycle action in the Data Control Center:

1. The correction is stored immediately.
2. On the next pipeline run, the correction is applied to prices before the CA adjustment step runs — so the price history is correctly adjusted.
3. The lifecycle event (used by the backtester) is updated with the correct ratio at the same time.
4. For structural events (mergers, delistings), the reviewed event is written to the live Data layer immediately — the backtester can use it right away without waiting for the next pipeline run.
🚀
Staging → Live Data — Safe Promotion
snapshot → promote → rollback if needed

Your strategies never read from work-in-progress data. All pipeline work happens in a staging area. Only after everything is verified does the data go live.

1. Build in STAGING All 8 pipeline steps run against the staging database. Live data is untouched.
2. Snapshot existing Data Before overwriting anything, the current live data is saved as a timestamped snapshot. Row counts are verified.
3. Promote STAGING → Data All staging collections are copied to Data. If any collection fails to copy, the entire promotion is aborted.
4. Auto-rollback on failure If promotion fails mid-way, the snapshot is automatically restored. Your strategies always see consistent data.
5. Rebuild Universes After a successful promotion, all strategy universes are rebuilt with the fresh data.
Price Adjustment
📉
How Prices Are Adjusted
daily pipeline

Every day, when a new corporate action event arrives (split, bonus, merger etc.), our data pipeline retroactively adjusts all historical prices for that stock in the database. This means by the time you run a new backtest, every price in the history already reflects all past corporate actions — the prices are "clean".

Example — 2:1 Split
Stock XYZ was trading at ₹100 before a 2:1 split on 1 May.

Before pipeline runs: history shows ₹100 on 30 April.
After pipeline runs: history is retroactively changed to ₹50 on 30 April.

On split day (1 May), the price in the DB is still ~₹50 — no sudden drop. The entire history has been divided by 2.

This retroactive adjustment is done so that new strategies never see artificial price jumps or drops at corporate action dates. The price series is continuous.

Splits & Bonuses
✂️
Stock Split
split / face_value_split

A split increases the number of shares and proportionally reduces the price. A 2:1 split means every 1 share becomes 2 shares, price halves.

New strategy (prices already adjusted)
You buy 100 shares at ₹50 (adjusted price, pre-split history already halved by pipeline).
Split happens. Adjusted price stays at ₹50 — no change.
Position stays 100 shares × ₹50 = ₹5,000. No adjustment needed. ✓
Resumed strategy (ran on old unadjusted prices)
Strategy was live. Held 100 shares at ₹100 (real unadjusted price before split).
Split happens. Pipeline halves historical prices. Now DB shows ₹50.
Without adjustment: 100 shares × ₹50 = ₹5,000 — half the real value. Wrong!

Backtester doubles the share count: 200 shares × ₹50 = ₹10,000. Correct. ✓
Applied for resumed strategy Skipped for new strategy
🎁
Bonus Issue
bonus

A bonus issue gives existing shareholders extra shares for free. A 1:1 bonus means for every share you hold, you get 1 more — doubling your share count. The same logic applies as a split: prices are retroactively adjusted, new strategies don't need position correction.

Example — 1:1 Bonus
New strategy: Buys 100 shares at adjusted price ₹50. After bonus, adjusted price stays ~₹50. Position value unchanged at ₹5,000. No adjustment done.

Resumed strategy: Had 100 shares at real price ₹100. After bonus, price drops to ~₹50. Backtester doubles to 200 shares × ₹50 = ₹10,000. Correct.
Applied for resumed strategy Skipped for new strategy
Mergers, Delistings & Other Structural Events

These events change what instrument you hold, not just the price or quantity. No price adjustment in the database can encode these — so the backtester must handle them regardless of whether it's a new or resumed strategy.

🚫
Delisting
delisting

The stock is removed from the exchange. You can no longer trade it. The backtester force-exits your position at the last available price and credits the cash back to your portfolio.

Example
You hold 200 shares of XYZ. XYZ gets delisted on 15 June.
Backtester sells all 200 shares at the last available open/close price and adds the proceeds to your cash. Position is removed from the portfolio.
Applied for both new and resumed strategy
🔀
Merger / Amalgamation / Symbol Change / ISIN Change
merger · amalgamation · symbol_change · isin_change

The old instrument ceases to exist and is replaced by a new one, with a given conversion ratio. The backtester converts your old position into the new instrument.

Example — Merger
You hold 100 shares of ABC. ABC merges into XYZ at a ratio of 0.5 (every 2 ABC shares become 1 XYZ share).
Backtester removes the ABC position and opens 50 shares of XYZ.
Applied for both new and resumed strategy
🌿
Demerger
demerger

A business unit is spun off into a new listed company. Shareholders receive shares of the new (child) company in addition to keeping their original shares.

Example
You hold 100 shares of ABC. ABC demerges its retail division into ABCRETAIL at a ratio of 1 new share per 2 original shares.
Backtester keeps your 100 ABC shares and adds 50 shares of ABCRETAIL to your position.
Applied for both new and resumed strategy
New Strategy vs Resumed Strategy

The key difference is what price series the strategy was originally run on.

🆕 New Historical Backtest
Runs from scratch. All prices in the database are already adjusted for every past corporate action.

Split/bonus events → skip position adjustment (price is already corrected).
Structural events (delisting, merger) → still apply.
🔄 Resumed Strategy
Continues from a saved state. Was run previously on old unadjusted prices before the new CA event arrived.

Split/bonus events → apply position adjustment (price has been halved, need to double shares).
Structural events → still apply.
Why does this matter?
If you apply a 2x share multiplier on an already-adjusted price, your portfolio value doubles for no real reason — fake profit. That's why the backtester skips split/bonus position adjustments for new strategies.
When Lifecycle Events Are Applied (Per Day)

Each trading day in the backtest loop runs in this exact order:

1. Apply Lifecycle Events Correct positions for any CA events effective on or before today
2. Execute Orders Fill yesterday's buy/sell orders at today's open price
3. Calculate Portfolio Value Value all positions at today's close price
4. Run Strategy Compute the model's hypothetical buy/sell positions for tomorrow based on today's research output
Why lifecycle events run first
Orders must be placed against the correct position size. If a split happened yesterday, and today you try to sell 100 shares, but the real holding is now 200 shares, the order quantity is wrong. Running lifecycle correction first ensures every subsequent step sees the right numbers.
Summary — What Applies Where
Event Type What it does to position New Strategy Resumed Strategy
Split / Face Value Split Multiplies share count by ratio Skipped Applied
Bonus Issue Multiplies share count by (1 + ratio) Skipped Applied
Delisting Force-exits position at last price, cash credited Applied Applied
Merger / Amalgamation Converts old position to new instrument at ratio Applied Applied
Symbol / ISIN Change Renames instrument in position book Applied Applied
Demerger Adds child instrument position at ratio Applied Applied
Already applied events are never re-applied

Every lifecycle adjustment is recorded in the database once it is applied to a strategy. If the strategy is paused and resumed later, the same event will not fire a second time — preventing any double-adjustment of your position size.

Likewise, in the data pipeline, every CA price adjustment is tracked with an idempotency key. The same price adjustment is never applied twice — even if the pipeline runs multiple times, prices are always adjusted exactly once per corporate action.

Back to Strategy Builder