> ## Documentation Index
> Fetch the complete documentation index at: https://kalpi.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Portfolio Backtester

> Engineered to stress-test custom asset allocations, simulate rebalancing strategies, and audit institutional-grade risk metrics.

The **Portfolio Backtester** is one of the most powerful core MVP engines within the Kalpi platform. Instead of guessing how a specific basket of equities or sector weights might perform under diverse macroeconomic regimes, this terminal allows you to mathematically simulate your investment strategies against historical exchange data.

Refer to the complete setup and multi-tab output demonstration below to see the engine execute live simulations.

<video src="https://mintcdn.com/kalpiai/rSS56CzMtP00TCYP/videos/portfolio-backtester.mov?fit=max&auto=format&n=rSS56CzMtP00TCYP&q=85&s=a6252aff63df275ad4c871a1c5c7aa78" controls data-path="videos/portfolio-backtester.mov" />

## Phase 1: Configuring Your Simulation

Building a statistically sound backtest requires setting up precise architectural constraints. Follow these structured steps within the input interface to configure your model:

<Steps>
  <Step title="Establish Your Baseline Benchmark">
    Select the core comparative baseline index (e.g., *Nifty 50, Nifty Energy, Nifty Financial Services*) against which your portfolio's alpha generation will be directly measured.
  </Step>

  <Step title="Define Rebalancing Frequency">
    Specify how often the engine should mathematically re-align your asset allocations back to their target constraints. Choose from:

    * **Never (Buy & Hold):** Assets drift naturally based on price action.
    * **Monthly / Quarterly / Yearly:** Automated programmatic re-allocations to lock in gains and manage risk concentrations.
  </Step>

  <Step title="Select the Historical Time Horizon">
    Open the **Configure Dates** module to input your custom simulation start and end parameters. This boundary sets the exact structural window your strategy will navigate.
  </Step>

  <Step title="Curate Positions & Optimize Weights">
    Input your target equity symbols into the holdings table. To instantly remove calculation errors, utilize the green **Distribute Equally** utility to split allocation percentages perfectly evenly across all assets (e.g., mapping 4 assets to exactly 25.0% each). Once optimized, execute the simulation by clicking **Analyze Portfolio**.
  </Step>
</Steps>

***

## Phase 2: Evaluating the Analytics Suite

Once calculation concludes, the interface generates a specialized, comprehensive analytics report broken into individual high-end tabs.

*Click through the diagnostic scopes below to explore each analytical matrix:*

<Tabs>
  <Tab title="Overview & Fundamentals">
    Provides a high-level summary of your portfolio's underlying core fundamental metrics and capital distributions.

    <Frame>
      <img src="https://mintcdn.com/kalpiai/fXbpCTw8a6Sl6b6I/images/overview-analytics-dashboard.png?fit=max&auto=format&n=fXbpCTw8a6Sl6b6I&q=85&s=549c1e83d3787841bd4975b66a4c535e" alt="Overview Analytics Dashboard" width="2936" height="1754" data-path="images/overview-analytics-dashboard.png" />
    </Frame>

    ### Core Variables Tracked:

    * **Portfolio PE & PB:** Integrated fundamental valuations measured directly against the benchmark's multiple limits.
    * **Dividend Yield:** Aggregate cash-flow yield derived from your specific asset allocation.
    * **Visual Alignment:** Interactive portfolio pie charts map your current holding concentrations alongside individualized stock performance return profiles.
  </Tab>

  <Tab title="Cumulative Returns & Drawdowns">
    Tracks the absolute growth trajectory of your capital over time, providing direct insight into outperformance periods and structural downside risks.

    <Frame>
      <img src="https://mintcdn.com/kalpiai/TwmBnHSnHL_HU6Gs/images/creturns-backtester.png?fit=max&auto=format&n=TwmBnHSnHL_HU6Gs&q=85&s=6a752bb1849690f8a56d006c7f609a43" alt="Creturns Backtester" width="2936" height="1754" data-path="images/creturns-backtester.png" />
    </Frame>

    ### Core Variables Tracked:

    * **Historical Growth Curve:** Interactive line chart overlay tracking your custom portfolio's valuation path against the benchmark over multi-year cycles.
    * **CAGR vs Max Drawdown:** Compares your absolute compound annualized growth rate directly against the maximum peak-to-trough drawdowns experienced during market corrections.
  </Tab>

  <Tab title="Risk-Adjusted Performance Statistics">
    Looks beyond simple absolute returns to audit the true efficiency of your strategy based on volatility metrics.

    <Frame>
      <img src="https://mintcdn.com/kalpiai/c0T0juK3FwdIojrc/images/performmance-backtester.png?fit=max&auto=format&n=c0T0juK3FwdIojrc&q=85&s=722f869ef537ed0d220e9449498c9608" alt="Performmance Backtester" width="2936" height="1754" data-path="images/performmance-backtester.png" />
    </Frame>

    ### Core Variables Tracked:

    * **Sharpe Ratio:** Measures the excess return generated per unit of absolute volatility. Higher numbers indicate clean structural alpha.
    * **Sortino Ratio:** Isolates harmful downside volatility rather than overall variance, offering a precise look at your true downside risk management.
  </Tab>

  <Tab title="Monthly Returns & Distribution Histograms">
    Deconstructs performance into localized calendar time blocks to spot underlying patterns and check return consistency.

    <video src="https://mintcdn.com/kalpiai/LiewC4OqU6_CaDHV/videos/portfolio-returnsbacktester.mov?fit=max&auto=format&n=LiewC4OqU6_CaDHV&q=85&s=738e51b9f95561dcf6e00cdd14fbed9b" controls data-path="videos/portfolio-returnsbacktester.mov" />

    ### Core Variables Tracked:

    * **Monthly Distribution Histogram:** Breaks down the frequency of positive vs. negative months to map return consistency.
    * **Color-Coded Return Grid:** An interactive heatmap layout presenting precise percentage gains or losses across every calendar month and year in your backtest history.
  </Tab>

  <Tab title="Rolling Statistics & Correlations">
    Audits structural stability by testing metrics across rolling holding cycles and calculating asset relationship behavior over time.

    <Frame>
      <img src="https://mintcdn.com/kalpiai/48NPvnAVnR84pyIn/images/rollingstats-backtester.png?fit=max&auto=format&n=48NPvnAVnR84pyIn&q=85&s=0b5cf63e1fc1421dcd6cb752fd459205" alt="Rollingstats Backtester" width="2936" height="948" data-path="images/rollingstats-backtester.png" />
    </Frame>

    ### Core Variables Tracked:

    * **Rolling Returns Analysis:** Tracks how your average yields fluctuate across constant rolling periods to remove endpoint bias from your data.
    * **Correlation Matrix:** Monitors the statistical relationship between your underlying assets to confirm your portfolio is genuinely diversified.
  </Tab>

  <Tab title="Sector & Market Cap Breakdown">
    Maps your asset allocation rules to reveal underlying structural exposures and identify hidden systemic factor risks.

    <video src="https://mintcdn.com/kalpiai/76fEWR8xe1mifv2T/videos/sectorcap-backtester-1.mov?fit=max&auto=format&n=76fEWR8xe1mifv2T&q=85&s=4f069ee2fe23d6a1633d13c0dfc7585e" controls data-path="videos/sectorcap-backtester-1.mov" />

    ### Core Variables Tracked:

    * **Sector Distribution:** Donut charts detailing exactly how your capital is distributed across major industries (e.g., *Capital Goods, Power, Oil & Gas*).
    * **Market Cap Allocation:** Breaks down exposures into Large, Mid, or Small-cap tiers, generating an absolute *Diversification Score* out of 10.
  </Tab>
</Tabs>
