Reiad's Library
Case study · Data analysis · Python-equivalent

Volatility is a statistic. A drawdown is a year of your life.

Six views over one price series: the index itself, rolling volatility, the underwater curve, the shape of the return distribution against a normal one, and, the reason for all of it, what actually happened to people who held for a day, a year, or five.

This series is simulated, not the real DSEX

Have real data? Drop a CSV below and every number on this page becomes about your series.

Run this on real data

Two columns: a date and a closing level. DSE publishes daily index history; export it, drop it here, and the whole page recomputes. Nothing is uploaded: the parsing and the maths happen in your browser, and the file never leaves your machine.

or drag one here, or paste below

Annualised returnCompound, over the whole series
Annualised volatilityDaily sd × √252
Maximum drawdownWorst fall from a previous peak
Best single day
Worst single day
Excess kurtosis0 would be a normal distribution
The index, with its three worst drawdowns shaded

A linear axis makes early moves look trivial and recent ones look dramatic; on a log axis equal vertical distances are equal percentage moves, which is what a holder actually experiences. Worth toggling: it changes the story the chart tells.

Volatility is not one number

Rolling annualised volatility

Underwater

How far below the previous peak, every day

The flat stretches at the top are the only times a holder was making new money. Everything below the line is time spent waiting to get back to where they already were, and that waiting, not the volatility number, is what makes people sell.

An episode runs peak → trough → the day the index first regains that peak. One still underwater at the end of the data is reported as such rather than quietly closed off, because pretending it ended would understate exactly the risk being measured.

The tails are fatter than the textbook

Daily returns, against a normal curve with the same mean and standard deviation

Bad days arrive together

What holding periods actually teach

Share of holding periods that ended positiveevery overlapping window in the series
Look closer at
Ended positiveOf all 1 year windows
Worst outcomeThe unluckiest start date
Median outcomeThe typical experience
Best outcomeThe luckiest start date

These windows overlap, on purpose. The question being asked is "if I had started on any given day", and every given day was a real starting point for somebody. They are not independent draws and this is not a significance test; it is a record of what happened.

Year by year

The data question, answered honestly

The shipped series is simulated and labelled as such on the page, in the banner and in the export. Inventing numbers and calling them the DSEX would be inventing that index's record, and anyone who checked would find it doesn't match. What's on display is the method, so the page takes your CSV and runs the identical analysis on real prices.

Nothing is uploaded

The CSV is parsed and analysed in the browser. There is no endpoint, no storage, and no request, which is both a privacy property and the reason it works on a file you would not be allowed to send anywhere.

Windows that admit what they are

Rolling volatility returns nothing until the window is full, rather than quietly computing a three-day "sixty-day volatility" at the start of the series. A chart that begins with a confident wrong number is worse than one that begins late.

Drawdowns measured properly

Peak to trough to recovery, as distinct episodes, with an unrecovered one flagged instead of closed at the last data point. The recovery time is usually the more painful number and the one most summaries leave out.

Tail risk past the headline

Value-at-risk says how bad a bad day is at the threshold; expected shortfall says how bad they are once you're past it. Both are here, at 95% and 99%, next to a count of how many days moved beyond three, four and five standard deviations against what a normal distribution would allow.

Checked against hand-worked cases

Fifty-two tests on the engine: standard deviations against known values, drawdowns on a seven-point series checkable by eye, holding periods on monotonic series that must come out 100% and 0%, VaR against its own empirical frequency, and a CSV parser fed headers, reversed files, junk rows and quoted thousands separators.

The bundled series is simulated with deliberately realistic behaviour (volatility clustering, fat tails, multi-year drawdowns), so the analysis has something worth analysing. It is not the Dhaka Stock Exchange's history, not a forecast, and not advice about any security. Load real prices to make every figure on this page real.
Working together

Have a series that needs interrogating?

Return and risk analysis in Python or R: cleaning, statistics, charts and a written answer to the question you actually asked, with the notebook handed over so the work can be rerun.