Strategy Docs

Investment Modes

Understand how each mode allocates capital and constructs your portfolio before you create your strategy.

Back to Strategy Builder
🎯
Max Position
max_position_legacy

Ranks all stocks in the universe by your alpha score on each day and allocates as much capital as possible into the top-ranked name. A single stock can receive 100% of the portfolio if it scores highest. This is the most aggressive, concentration-maximizing mode.

Simple Example
You run an alpha on a 50-stock universe. Today, RELIANCE scores 0.95 (highest). The engine allocates your entire portfolio into RELIANCE. Tomorrow, if INFY scores highest, it switches fully into INFY. Best used for high-conviction, single-name momentum signals.
Low Complexity Long Only High Concentration
⚖️
Equal-weight Top-N
equal_weight_top_n

Selects the top-N highest scoring stocks each day and divides the portfolio equally among them. Each stock gets the same weight, regardless of how much higher its score is relative to others. This provides diversification while still using the alpha ranking to filter names.

Simple Example
You set Top Stocks = 5. On a given day, the engine picks the 5 highest-scoring stocks and allocates 20% of the portfolio to each of them, irrespective of their individual scores. Ideal for factor strategies (momentum, quality) where you believe in the group, not a single pick.
Low Complexity Long Only Diversified
📊
Score-weighted Top-N
score_weighted_top_n

Like Equal-weight Top-N, but allocates capital proportionally to each stock's alpha score. A stock with twice the score of another gets approximately twice the capital. Combines the filtering benefit of Top-N with a signal-strength-based weighting.

Simple Example
Top 3 stocks score: HDFC=0.8, TCS=0.5, WIPRO=0.3. Total = 1.6. Weights: HDFC = 50%, TCS = 31%, WIPRO = 19%. Higher-conviction picks get more capital — useful when your alpha has strong ordinal predictive power.
Medium Complexity Long Only Signal-weighted
🔄
Scheduled Rebalance Rotation
scheduled_rebalance_rotation

Rebalances the portfolio only at fixed intervals (daily, weekly, monthly, or quarterly) instead of every trading day. Between rebalance dates, the portfolio is held static. Includes optional stop-loss and stop-gain guardrails on individual positions.

Simple Example
You set Frequency = Monthly, Stop Loss = 5%, Stop Gain = 20%. On the 1st of each month, the engine picks the top-N stocks and equal-weights them. If any position drops 5% before month-end, it's exited early and cash is held until the next rebalance. Great for lower-turnover, swing-trading style strategies.
Medium Complexity Long Only Low Turnover Stop-loss enabled
💱
Daily Top/Bottom (Capital-neutral)
daily_top_n_long_short

A market-neutral long/short strategy. Goes long the top-N highest-scoring stocks and simultaneously short the bottom-N lowest-scoring stocks. The total dollar value of longs equals the total dollar value of shorts — hedging market beta. P&L is driven purely by the spread between good and bad stocks.

Simple Example
Portfolio = ₹10L. You long the top 5 stocks at ₹1L each, and short the bottom 5 at ₹1L each. If the market falls 5% uniformly, both legs lose/gain equally — your net exposure is ~zero. You profit only if longs outperform shorts. Best for mean-reversion or cross-sectional momentum alphas.
High Complexity Long / Short Market Neutral
📐
Top/Bottom (Beta-neutral)
beta_neutral_top_n

Similar to Capital-neutral but adjusts long and short sizes so that the portfolio's net market beta is zero. High-beta shorts are sized smaller, and high-beta longs get less capital. This removes residual market exposure even when individual position betas differ.

Simple Example
You long HDFC (β=0.8) and short ZOMATO (β=1.5). Capital-neutral would give each equal capital, leaving you net short beta. Beta-neutral scales ZOMATO's short down so that 0.8 × long_₹ = 1.5 × short_₹, eliminating the residual beta. Best when high-beta stocks dominate either side.
High Complexity Long / Short Beta Hedged
🏭
Top/Bottom (Sector-neutral)
sector_neutral_top_n

Runs a long/short portfolio where long and short exposure is balanced within each sector. For each sector, the engine longs the top-scored stocks and shorts the bottom-scored in equal measure. Removes sector-level macro risk — your alpha is tested purely within-sector.

Simple Example
In the Banking sector: long HDFC, ICICI and short BANDHAN, IDFC. In the IT sector: long TCS, INFY and short MPHASIS, HEXAWARE. If IT sector rallies 10%, both the long and short IT legs gain and lose equally — you're only exposed to the relative stock rankings within IT.
High Complexity Long / Short Sector Neutral
🛡️
Regime-Switching (Dynamic)
regime_switching_dynamic

An all-weather mode that reads the market's current regime every trading day and adapts its execution style automatically. Instead of always running long-only or always hedging, it switches between three behaviours depending on what Nifty is doing:

🟢 Bull
Equal-weight long-only top-N. Full market participation, no hedges.
🔴 Bear
Beta-neutral long/short hedge. Longs the best stocks, shorts the worst, net beta ≈ 0.
🟡 Sideways
Score-weighted long-only. Selective exposure, larger weight to higher-conviction picks.
Detection Methods

Choose how the engine reads the market regime. Each method has different speed and sensitivity trade-offs.

EMA Crossover  ema_crossover
Calls Bull when Nifty is above both its short EMA and long EMA and the short EMA is above the long EMA (Golden Cross). Calls Bear when the reverse is true (Death Cross). Everything else is Sideways.

Best for: sustained multi-month bear markets (e.g. 2022 global selloff).
Weakness: slow — can lag a sudden crash by 4–8 weeks since EMA crossovers take time to form.
Drawdown from High  drawdown_from_high
Calls Bear as soon as Nifty drops ≥ Threshold % from its highest point in the last Lookback Days. Calls Bull when the drop is ≤ 2% from the recent high.

Best for: catching sudden crash events fast (e.g. COVID Feb 2020).
Weakness: triggers on short corrections too — may whipsaw in choppy markets.
Hybrid  hybrid
Combines both signals. Calls Bear if either the EMA crossover fires or the drawdown threshold is breached. Returns to Bull only when both signals confirm recovery.

Best for: balancing speed and reliability.
Weakness: the asymmetry (easy to enter bear, hard to exit) can keep the strategy in hedge mode too long after a short correction recovers.
Confirmed Hybrid  confirmed_hybrid  RECOMMENDED
Same logic as Hybrid, but the Bear or Bull signal must persist for N consecutive trading days (Confirmation Days) before the portfolio switches regime. During mixed signals it holds the last confirmed regime instead of reacting to noise.

Best for: choppy markets with frequent short corrections that recover quickly (e.g. 2024–2025 Indian market).
Weakness: introduces a small lag (~N days) when entering a real bear — catches ~90% of a sustained crash, misses the first week.
Settings Reference
Setting What it does Recommended Applies to
Short EMA Window Fast EMA period used to detect Golden/Death Cross 50 EMA Crossover, Hybrid, Confirmed Hybrid
Long EMA Window Slow EMA period for the crossover signal 200 EMA Crossover, Hybrid, Confirmed Hybrid
Bear Drawdown Threshold % % drop from recent high that triggers Bear mode 12 (choppy) / 9 (sensitive) Drawdown, Hybrid, Confirmed Hybrid
High Lookback Days How many days back to measure the recent high from 40 (choppy) / 25 (sensitive) Drawdown, Hybrid, Confirmed Hybrid
Confirmation Days How many consecutive days the Bear/Bull signal must hold before switching 5 Confirmed Hybrid only
Real-World Scenarios
Scenario 1 — COVID Crash (Feb–Mar 2020)
Nifty fell ~40% in 33 trading days.

Hybrid / Drawdown detector: Bear triggered on day ~1–2 of the crash (8% drop breached quickly). Strategy switched to beta-neutral hedge immediately — captured most of the downside protection.

Confirmed Hybrid (5 days): Bear confirmed by day ~9 (all 5 days agreed). Missed the first ~10% of the crash but protected against the remaining 30%. V-shaped recovery meant the exit to Bull was also clean.
Scenario 2 — 2024–2025 Choppy Market
Nifty had multiple 8–15% corrections that each recovered within 2–4 weeks — no sustained bear.

Hybrid (8% / 20 days): Bear triggered on every correction → strategy went short → market recovered → short positions lost money. Repeated 4–6 times = significant whipsaw losses.

Confirmed Hybrid (12% / 40 days / 5 confirmation days): Short corrections never held the bear signal for 5 consecutive days → no false switches → strategy stayed long-only or sideways and participated in the recovery. Outperformed by ~9% in 2025 alone.
Scenario 3 — Demonetization (Nov 2016)
Nifty fell ~9% in 3 days then recovered within 6 weeks.

Hybrid (8% threshold): Bear triggered on day 2 → went short → market bounced back → losses on short positions.

Confirmed Hybrid (12% threshold): 9% drop did not cross the 12% threshold → no regime switch → stayed long-only and participated in the recovery.

Key lesson: raising the threshold from 8% to 12% is the single most impactful setting change for filtering event-driven noise.
Scenario 4 — 2021 Bull Run
Nifty rallied ~86% from COVID lows through 2021 with no meaningful correction exceeding 8%.

All detectors: Bull regime held throughout → equal-weight long-only the entire year → full participation in the rally. No regime switches = no unnecessary hedges dragging performance.

In a clean bull market, all detectors behave identically — the differences only show up at turning points.
Which Settings Should I Use?
Your market expectation Recommended detector Threshold Lookback Confirmation
Choppy / frequent corrections (2024–2025 style) Confirmed Hybrid 12% 40 days 5 days
Sudden crash risk (COVID-style) Confirmed Hybrid 9% 25 days 3 days
Slow sustained bear (2022 style) EMA Crossover
Unknown / general all-weather Confirmed Hybrid 12% 40 days 5 days
High Complexity Dynamic (Long / Long+Short) Regime Adaptive Crash Protection Whipsaw Resistant
Mode Comparison
Mode Direction Rebalances Daily Stop Controls Best For
Max Position Long only High-conviction, concentrated bets
Equal-weight Top-N Long only Diversified factor strategies
Score-weighted Top-N Long only Alphas with strong ordinal power
Scheduled Rotation Long only Low-turnover, swing trading
Capital-neutral L/S Long + Short Market-neutral, stat-arb
Beta-neutral L/S Long + Short Beta-hedged long/short books
Sector-neutral Long + Short Within-sector ranking strategies
Regime-Switching Dynamic All-weather strategies, crash protection + choppy market survival
Research Reminder

All modes use simulated backtests. Past simulated performance does not guarantee future returns. Long/short modes require margin and may not reflect real brokerage constraints. Start with Equal-weight Top-N if you are new to quantitative strategy design.

Back to Strategy Builder