Skip to main content

One-Year Forecast

Research page (sidebar: Research > Forecast, route /forecast, DEVELOPER rank). Code: backend/forecast/, API backend/app/api/forecast.py (/api/forecast/*), page frontend/src/pages/Forecast.jsx.

It forecasts a distribution of the 1-year return, not a price target. Over a year the direction is not reliably predictable; what history can say something about is the spread (volatility, fat tails, drawdown). The output is a fan of percentiles, probability of loss and expected maximum drawdown.

Instruments and data​

CodeSeriesSource
NIFTYNIFTY 50 price index (no dividends), unadjusted index closeseq_store masid 1, from 1991
BANKNIFTYBANK NIFTY price indexeq_store masid 2, from 2000
DOWDow Jones price index, USDscr_global_price DowJones, from 1896
GOLDGlobal spot gold in INR per 10 g (XAUUSD x USDINR)scr_global_price GOLDINR, from 1973
SILVERGlobal spot silver in INR per kgscr_global_price SILVERINR, from 1973

Closes are cleaned (positive, unique dates, sorted) and converted to daily log returns. The horizon is 252 trading days from each series' last close (the index data ends earlier than the global series). Dates on the fan chart use a business-day calendar, so they are approximate for Indian holidays.

The three models​

Each simulator returns n paths of cumulative log return over 252 days (forecast/models.py). All three use the same daily drift mu, so they differ only in the shape and width of the distribution.

  1. Hist vol + Monte Carlo (gbm): normal shocks at the full-history standard deviation. A plain baseline. Understates tails and ignores volatility clustering.
  2. Block bootstrap (bootstrap): resamples random 40-day blocks of actual demeaned returns, then adds mu. Keeps volatility clustering and fat tails without assuming a distribution.
  3. GJR-GARCH(1,1) filtered historical simulation (fhs): fit GJR-GARCH(1,1) with Student-t errors (arch package, zero mean, returns in percent). Take the standardised residuals, re-standardise them, bootstrap them, and push them through the fitted variance recursion s2 = omega + (alpha + gamma * I(e<0)) * e^2 + beta * s2, starting from today's conditional variance. Volatility starts at its current level and mean-reverts, and falls raise volatility more than rises (the leverage effect).
  4. Ensemble (ensemble): equal-weight pool of the paths of the three models. This is the headline view.

Why not GARCH alone: its variance forecast reverts to the long-run level within a few months, so over 252 days it adds value mostly in the first 1 to 3 months. Hence the pooled view.

Drift​

mu defaults to the instrument's full-history mean daily log return. This is the weakest input: the standard error of a mean return over a year is about as large as the mean, and it is optimistic for some series (NIFTY about 13% a year, BANK NIFTY about 16%, gold and silver in INR 11 to 13%). The page lets you type an annual drift (drift_pct, converted as ln(1 + d) / 252 per day) to test another view. The spread of the range is the reliable part, not the median.

Statistics reported​

From the simulated terminal returns: percentiles 5/25/50/75/95 (as returns and price levels), probability of loss, probability of a fall of 20% or more, and the mean and 95th-percentile maximum drawdown over the simulated paths (measured from the starting level).

Validation: walk-forward backtest (forecast/backtest.py)​

At every origin (every 21 trading days, after at least 1,260 days of history) each model is refit using only the data available then, forecasts the next 252 days, and is compared with what happened. Reported:

  • share of outcomes inside the 5-95% band (target 90%) and 25-75% band (target 50%)
  • share below the 5th and above the 95th percentile (target 5% each)
  • pinball loss over quantiles 5, 10, 25, 50, 75, 90, 95% (lower is better)
  • average 90% band width

The realised windows overlap heavily, so these are not independent trials; read them as indicative.

First run (2026-11-11, 3,000 to 10,000 paths): all models land near or above the 90% target. On the Dow the GARCH model covered only 87% (8% of outcomes above its 95th percentile), so its fan was too narrow on the upside; the ensemble covered 90.4%. On silver GARCH had the lowest pinball loss and plain GBM was too wide. Pinball scores differ by a few percent across models, so there is no clear winner.

Running​

cd backend
python -m forecast.run # all five, with the backtest (takes a few minutes)
python -m forecast.run --no-backtest --only NIFTY,GOLD --paths 10000

Writes backend/reports/forecast/: forecast.csv, backtest_summary.csv, info.json, fan_<CODE>.png. The page reads the backtest from backtest_summary.csv; re-run the command to refresh it.

Needs the arch package (in backend/requirements.txt). Tests: backend/tests/test_forecast_leaps.py (LEAP engine) and test_forecast_btresult.py (year-end dates and horizons); the distribution models have none yet.

API​

EndpointPurpose
GET /api/forecast/instrumentsthe five codes and labels
GET /api/forecast/run?instrument=&drift_pct=&paths=fan bands (every 5 days), 1-year table per model, volatility and GARCH facts, 3 years of history
GET /api/forecast/backtestwalk-forward table from backtest_summary.csv
GET /api/forecast/run?back=a past forecast with what actually happened (see Past forecasts)
GET /api/forecast/leaps/expiries, /chain, /templatesfar NIFTY expiries, the chain, template legs with payoffs
POST /api/forecast/leaps/evaluate, /findtest one strategy, or search all strike combinations
GET /api/forecast/bt?instrument=, POST /api/forecast/bt/run, GET /api/forecast/bt/statusthe 10-year backtest for the BT Result tab
GET /api/forecast/voledge?years=, POST /api/forecast/voledge/build, GET /api/forecast/voledge/statusNIFTY implied vs forecast vol (Vol Edge tab)
POST /api/forecast/refreshdrop the cached simulations

Past forecasts (Prev / Next)​

The Distribution tab has Prev / Next buttons and a step selector (1 month, 3 months, 6 months, 1 year). Prev shows the forecast as it would have been made on an earlier date: the models see only the data up to that day (no look-ahead; the drift is that day's history average too). The real price path after that date is drawn in orange over the fan, and a banner gives the realised change, its percentile inside the forecast, and whether it landed inside the 5-95% and 25-75% bands. API: GET /api/forecast/run?back=<trading days>; at least 5 years of history must remain before the forecast date.

NIFTY LEAP option strategies (Strategy tab)​

Code backend/forecast/leaps.py, API /api/forecast/leaps/*, page frontend/src/pages/LeapStrategies.jsx. NIFTY only.

  • Contract: the user picks a NIFTY option expiry 200 or more days out (Dec 2027 by default). The chain is the latest end-of-day F&O prices in scr_nsefo_eod / fo_store (close, volume, OI). Implied vol per strike is Black-76 from the close, the forward from put-call parity at a traded strike. A close is a last trade or a settlement, not a bid / ask, so use the slippage input.
  • Templates (hover for the payoff diagram, click to load): naked selling first (short put, short call, short straddle, short strangle, put ratio 1x2, call ratio 1x2, jade lizard) and defined-risk (iron condor, bull put spread, bear call spread). Default strikes are picked by delta. "Naked" means a net short call or put position with no matching long.
  • Path test: NIFTY paths from the forecast models (one step per trading day to expiry); every leg is repriced each day with Black-76 at its own entry-day IV, keeping the chain's implied carry. IV rises when the market falls: iv = iv0 * exp(-k * ln(S/S0)), k = "IV reacts to spot" (default 1, 0 = flat vol). This is an assumption, not an observation.
  • Exits (checked on daily closes, stop-loss first on the same day): loss of sl_mult x net credit, optional rupee stop, spot stop down / up %, profit target as % of credit, exit N days before expiry; otherwise held to expiry. Intraday stops can trigger earlier and fill worse.
  • Output: net credit, max profit / loss and breakevens at expiry, margin (exchange SPAN of the entry day when archived, else a flat estimate), theta / vega / delta, expected P&L, win rate, worst-5% average, how trades ended, the distribution of results, exits versus hold to expiry, and a robustness table (other models, drift 0% and 8%, flat IV, IV reacting 2x).
  • Finder: tests every strike combination of the ticked templates on one shared simulation (prices cached per strike), searches the stop-loss multiple too, filters by worst-5% loss and win rate, and ranks by return on margin, expected P&L, win rate, tail loss or expected / std dev. Hover a row for its payoff; click to load and test it. More than 4,000 combinations are thinned by a stride.
  • Read the first line: the page compares the option-implied ATM vol with the volatility the forecast simulates. When options are cheap against the forecast, selling premium has a negative expectancy in this test, and the finder says so.

Limits: results depend on the model, drift and IV rule; the finder ranks in-sample on one path set, so re-test a candidate in the robustness table; margin for naked positions moves with volatility and a margin call can force an exit the simulation does not show. Not advice. Tests: backend/tests/test_forecast_leaps.py (synthetic chain, no database).

BT Result tab (10-year backtest)​

Code backend/forecast/btresult.py (+ backtest.py), API GET /api/forecast/bt?instrument=, POST /api/forecast/bt/run, GET /api/forecast/bt/status; page frontend/src/pages/BTResult.jsx. It answers: how would this forecast have done in the past?

  • Year-end test (the headline): the forecast date is the last working day of each calendar year. The model sees only data up to that day and is judged on the following calendar year (its own trading days, 245 to 252). Ten complete years plus the year in progress (judged on the days so far, flagged partial). Each year has a chart: the model's bands with what actually happened over them.
  • Monthly check: the same models forecast the next 252 trading days from every 21st trading day of the last 10 years (about 120 forecasts). They overlap heavily, so they sharpen the calibration picture but are not 120 independent trials.
  • Naive benchmark: the distribution of past 1-year returns known at the forecast date, no model. A model is worth using only if it beats it on pinball loss ("vs naive" column).
  • Reading it: inside 5-95% should be about 90% and inside 25-75% about 50%. Both near 100% means the bands are too wide (safe but uninformative); below about 85% means too narrow (understates risk). The percentile column and the calibration histogram show where reality landed inside the forecast. The page writes a plain-language verdict from these.
  • Limits: ten year-end forecasts are too few to prove anything on their own. The drift is each day's full-history average, so a strong or weak decade shows up as bias. Results are stored as JSON under backend/reports/forecast/bt10/ (git-ignored) and built per environment: press "Run for" the instrument on the page (background job, a minute or two each), or python -m forecast.run --bt10 [--only NIFTY,GOLD] from backend/.
  • First NIFTY result (data to 2026-09-25): all 10 year-end outcomes (2016 to 2025) landed inside the ensemble's 5-95% band and inside its 25-75% band: the band was too wide, because the full-history volatility (about 24% a year, including the 1990s) was far above what NIFTY did. GARCH FHS scored best against the naive benchmark; the year in progress (2026 to 25 Sep, -11.4%) sits near the 13th percentile.

Vol Edge tab (NIFTY implied vs forecast volatility)​

Code backend/forecast/voledge.py, API GET /api/forecast/voledge?years=, POST /api/forecast/voledge/build, GET /api/forecast/voledge/status; page frontend/src/pages/VolEdge.jsx. The only place a forecast turns into an edge is where the option market's volatility differs from the forecast's, so this tab tracks that gap.

  • Gap = implied vol minus forecast vol, in volatility points, for the same number of days. Above +1.5: options rich (a seller is paid more than the forecast says the risk is worth). Below -1.5: cheap. In between: about fair.
  • Implied vol history (daily since 2001): ATM implied vol of the NIFTY option expiring nearest 30 days (14 to 75), from the F&O end-of-day closes of the call and put at the strike nearest spot that traded; Black-76 at a flat 6.5% rate, forward from put-call parity (clamped to +-8% of carried spot). A close is a last trade, not a mid, so single days can be noisy.
  • Forecast vol: GJR-GARCH(1,1)-t. The shock dynamics (alpha, gamma, beta, nu) are fitted once on the whole history (a mild look-ahead in those parameters only). The long-run level is re-targeted every day to the realised variance of the trailing 10 years (no look-ahead): the plain full-history fit mean-reverts to about 32% a year for NIFTY (inflated by 2001-2009 and 2020), which made long-dated options look 11-18 points cheap. Next-day variance after each close, averaged over the option's life: avg = LR + (s2 - LR) * (1 - p^n) / (n * (1 - p)).
  • Premium earned: implied vol minus the realised vol that actually followed over the option's trading days, in vol points (known after the fact). The bucket table groups days by their gap and shows the average premium and how often implied was above what followed, which answers whether the gap has predicted anything.
  • Now table: the nearest ~30-day expiry and every LEAP expiry (200+ days): chain ATM IV against the GARCH term forecast. The Strategy tab's banner compares with the simulated ensemble volatility instead (it includes the full-history level), so the two numbers can differ.
  • First results (history to 2026-09-25): with the trailing-10-year level the long-run vol is 16.2% and the Dec 2027 gap is -3.2 points (was -14.1 before the recalibration). Over 5,632 days the premium implied-minus-realised averaged +1.9 points and implied was above what followed on 72% of days. By gap: very cheap +1.9 (68% of days seller ahead), cheap +0.1 (62%), fair +1.3 (71%), rich +2.2 (78%), very rich +3.6 (77%); correlation of gap with premium 0.09, so the gap is a weak signal. The forecast still overshoots in crisis regimes (forecast 33.6% vs 23.6% that followed when options looked very cheap).
  • Limits: premium is in vol points, not rupees, and says nothing about the stop-loss; neighbouring days overlap (an option lives ~21 trading days), so independent observations are far fewer than days; far strikes and early years have thin trading.
  • Building: needs Postgres (contract master) and the F&O store. Press "Build history" on the tab (background job) or run python -m forecast.voledge build from backend/. Stored as backend/reports/forecast/voledge_nifty.parquet (git-ignored), built per environment. Tests: backend/tests/test_forecast_voledge.py (maths only).

Known limits​

  • A probability range from past behaviour, not a forecast of direction and not advice.
  • Index series are price indices (dividends excluded); gold and silver include rupee moves.
  • Full-history volatility can differ a lot from the current level (NIFTY about 24% against 13% over the last year). gbm uses the full-history level, GARCH starts near today's.
  • Silver's last year includes a single-day move of about 38% (2026-01-30), which inflates its recent volatility; check the source series before relying on it.
  • The fan uses one random seed per run; with 8,000 to 10,000 paths the percentiles move by a fraction of a percentage point between runs.