Sunday, May 10, 2026

Needle in the Haystack - The best-performing mutual fund


Mutual funds were supposed to solve a problem commoners face while investing - Not having enough knowledge or insights to identify the best stock/debt instrument to invest in, for best returns of course. However, it ended up creating the equivalent problem of its own and the ever elusive question - Which is the best mutual fund to invest in among the ten thousand odd mutual funds?

The answer changes depending on what data you look at.

  • Sort by 10-year return → one set of funds wins.
  • Sort by 5-year return → rankings change completely.
  • Look at recent momentum → another list appears.
  • Look at risk-adjusted returns → yet another answer emerges.

And once you start searching for answers from the "experts", discussions quickly move toward:

  • Asset allocation
  • Goal-based investing
  • SIP discipline
  • Diversification

All important topics — but the original question still remains: Among thousands of mutual funds, which ones are actually worth considering?


The Problem - Existing Solutions and Their Limitations

For reasons beyond my understanding, the omnipresent free hand of market always provides a solution but the one that is not perfect.

Platforms like - Value Research Online, Morningstar India, ET Money are very useful for researching funds, comparing a few schemes, checking returns and ratios, etc. But I found one important limitation  - They help compare selected funds, but do not fully help discover whether those are even the best funds to compare.

There are also excellent data-backed approaches like Freefincal but many advanced tools are paid, static, not automatically refreshable, difficult to customize.

And hence the quest to build an Open, Transparent, Free Forever, Refreshable, and Customizable mutual fund analysis system in Google Sheets. 


The Goal

The goal was simple - Build an open system that can fetch data for thousands of mutual funds, rank them using formulas of my choice, and allow complete customization of the analysis.

  • Automatic refresh
  • Transparent formulas
  • Editable weights
  • Risk-adjusted metrics
  • Category-aware ranking
  • Portfolio-aware tracking
  • Most importantly - No black box.


The Solution

I built a Google Apps Script-based system that automatically creates and manages a complete mutual fund analysis setup inside Google Sheets. The system:

  • Fetches NAV data automatically
  • Processes thousands of funds
  • Calculates return and risk metrics
  • Ranks funds using configurable formulas
  • Supports automatic refresh
  • Highlights existing holdings

The scoring currently includes:

  • Weighted annual returns
  • CAGR-based scoring
  • Sharpe ratio
  • Sortino ratio
  • consistency score
  • Downside protection
  • Momentum score
  • Category percentile ranking
  • A composite Final Score to compare funds across.

Key Limitation - One limitation of this system is that the analysis is primarily based on annual returns instead of rolling returns. Rolling returns would be more robust, but computing them across thousands of funds requires significantly more processing and complexity than a spreadsheet-oriented solution can comfortably handle.

This project intentionally prioritizes simplicity and always-free tool over institutional-grade analytics.


How to Setup

1. Using the Spreadsheet Directly

  • Go to the Mutual Fund Analysis.
  • File > Make a copy > Store in your Google Drive
  • You will find a Quick Start Guide on the first sheet.
  • Skip First-Time-Setup if you don't want to reset everything and keep the all the existing data.
  • Start Refresh to fetch latest data.
  • Explore as you wish.

2. Using the Code

  • Download this Apps Script code.
  • Create a blank Google Sheet in your Google Drive.
  • Open Extensions → Apps Script.
  • Paste the code & Save.
  • Refresh the Google Sheet.
  • You will see a new menu - MF Updater.
  • Click MF Updater - First-Time Setup.
  • You will see "Authorization required", click OK.
  • You will see "Google hasn’t verified this app", click Advanced > Click "Go to Untitled project (unsafe)" > Select All > Continue
  • This will grant the permissions required to run the scripts.

3. Getting the List of Funds


Request for Suggestions

This project is meant to be open and customizable. If you have suggestions around approach, formulas, scoring system, please do share your thoughts or updated code. Your contribution will make this system more robust.

Thursday, April 9, 2026

The Beginning of the End (Again)

John Martin - The Great Day of His Wrath
I have noticed this pattern for years now, and I confess I am not entirely immune to it myself. The moment something starts going wrong — markets wobble, a war breaks out, banks begin to fall — conversations shift in a very predictable direction. People stop asking what might happen and start declaring what will definitely happen. And almost always, that declaration goes one way.

“This is the beginning of the end.”

There is something genuinely comforting about that sentence. It removes uncertainty. It gives the chaos a name and a direction. It makes you feel like you understand what is happening — even if what you understand is that everything is about to collapse.

I know not why we do this. Perhaps it is easier to prepare for a definite catastrophe than to live with ambiguity. Perhaps the end of the world simply makes for better conversation than its stubborn continuation. The problem, of course, is that reality has shown very little interest in cooperating with this tendency. 

Big events do change the world — let us not be naive about that. But rarely in the clean, dramatic, everything-breaks-on-Tuesday manner that our minds prefer. More often, systems bend, adapt, patch themselves up in unglamorous ways, and keep going. Not unchanged — but not unrecognizable either. 

If you are skeptical of my skepticism, consider the evidence, some of which you may recall from school textbook and most you would have erased from your memory as something that never happened.

Hypothesis: Population growth will cause mass starvation, with hundreds of millions dying and the global food system collapsing.
Expected Date: 1970–1985
What actually happened: Population exploded. Food production grew faster. The crisis… inverted.

Hypothesis: Acid rain will destroy ecosystems — dead lakes, dying forests, irreversible environmental damage.
Expected Date: 1980s–1990s
What actually happened:  Damage appeared. Then policy, technology, and regulation quietly reduced it. 

Hypothesis: Ozone depletion will make Earth uninhabitable — radiation spikes, ecosystem collapse Expected Date: 1990s–2000s
What actually happened: Global coordination. Montreal Protocol. Slow recovery.

Hypothesis: Computer systems will fail globally, collapsing infrastructure
Expected Date: January 1, 2000
What actually happened: Nothing dramatic. Which proves either panic… or preparation.

Hypothesis: Globalization will reverse — borders harden, trade shrinks, nations retreat
Expected Date: 2002–2010
What actually happened: Security increased. Trade didn’t stop.

Hypothesis: Oil decline will end growth — energy scarcity leading to economic stagnation.
Expected Date: ~2010
What actually happened: Technology found more oil. Apocalypse postponed.

Hypothesis: The global system will fundamentally change — end of big banks, reckless finance, possibly capitalism itself.
Expected Date: 2009–2012
What actually happened: For a moment, it felt broken. Then intervention. Then bailouts. Then continuity.

Hypothesis: The euro will collapse, fragmenting Europe.
Expected Date: 2012–2015
What actually happened: It bent. It negotiated. It survived.

Hypothesis: China will collapse under debt, triggering global recession.
Expected Date: 2014–2017
What actually happened: China slowed. Reality declined to call it collapse.

Hypothesis: Cities will die — urban life ends, offices disappear.
Expected Date: 2020–2022
What actually happened: Cities paused. Then resumed.

Hypothesis: Banking crisis will spread into system-wide collapse.
Expected Date: 2023
What actually happened: A few tense days. Then intervention. Then stability.

So why does this pattern repeat? 
We are storytelling creatures. “This is the beginning of the end” is a better story than “things will continue in a complicated and mildly disappointing way.”

There are probably other reasons too. Old systems do not die easily — they adapt in ways that are too unglamorous to attract much attention. Stress forces the kind of innovation that comfort rarely would. Fear triggers interventions that were not visible before the crisis. And the distance between "this could happen" and "this will definitely happen" collapses faster than it should, in both media and in our own minds.

And the part that is easy to miss.
Pessimistic predictions are not useless. They often point to real risks, sometimes force real action. The ozone layer is arguably the clearest example — the catastrophe was not averted by luck or by the system's natural resilience, but by deliberate, coordinated human effort, and it was the warnings that made that effort possible.

But across most of these cases, the predictions consistently overestimated the speed, the scale, and the finality of collapse. Reality is slower. More stubborn. More willing to patch itself together and keep going than any good collapse narrative requires.

Things do not fall apart on schedule. They stretch, adjust, negotiate with themselves, and continue — often frustratingly so, for those who had predicted otherwise.

Hypothesis: The Iran conflict will fundamentally reshape the global order — World War III, de-dollarization, bifurcated financial systems, persistent inflation/stagflation, fragmented globalization, shift to a multipolar world order, end of cheap energy, weaponized trade/finance. 
Expected Date: 2026–2028

The risks are real, some of these outcomes are genuinely possible. But if history is any guide — and I say this with appropriate humility — the more interesting question is not “whether the world will break?” but “How will it quietly rearrange itself, patch the damage, and keep going in ways that nobody quite predicted and nobody will fully explain until after the fact.”

Saturday, November 21, 2020

What is Peace?

https://www.pxfuel.com/en/free-photo-joyaw
A melancholic “minor key piano” music playing in the television, in distant hall room, right across the wall.

Sitting in the swing in the veranda.
That slow lazy motion of the swing.
The mild fluttering of the breeze, touching the skin and passing by.
The bustling of the leaves, the neem tree in front of me, the coconut trees and the rest of it.
The leaves, the walls washed in the yellow street light.
The rickety noise of the broken swing.
No human sound at the dead of the night, 2 am of April 20.
That eminence of the swing and my leg hitting the adjacent walls.
The nudge of pain on the knees.
That minor irritation of mosquitoes.
The realization that all of this is accepted as is.
All the pains to be endured, all the joys to relished, as is.

The realization that this is all that I want from life.
To sit in a swing, the melancholy, the breeze.

This was peace.