Author: shyam

Trend-following Strategies on MCP Server

We have added two new trend-following strategies to our Mutual Fund MCP server. They track midcap and small cap indices.

  1. Indian MF Tactical Midcap (tactical-midcap)

    • Frequency: Daily
    • Rule: Holds midcap equity when the NIFTY Midcap 150 TRI is above its 20-session SMA; otherwise holds an overnight fund.
    • Benchmark: NIFTY Midcap 150 TRI
    • Coverage: March 2017–October 2026
    • Current allocation: Nippon India Overnight Fund — Direct Growth
  2. Indian MF Tactical Smallcap (tactical-smallcap)

    • Frequency: Daily
    • Rule: Holds smallcap equity when the NIFTY Smallcap 250 TRI is above its 50-session SMA; otherwise holds an overnight fund.
    • Benchmark: NIFTY Smallcap 250 TRI
    • Coverage: April 2023–October 2026
    • Current allocation: Nippon India Overnight Fund — Direct Growth

The same strategies are being currently run using ETFs: Tactical MIDCAP 150 and Tactical SMALLCAP 250. We ran a few scenarios on how their returns would look like under different brokerage slabs and if implemented through mutual funds.

Fun fact: because of the way mutual fund transactions work, you are better off not switching to overnight funds when the SMA exits equities. Cash works better because if there is a whipsaw the next day, you can get long fast.

The deep dives for midcaps and smallcaps are on github.

Kalman vs SMA

This post is inspired by A Stochastic Model Against a Geometric Rule: the Kalman Filter and the 200-Day Line. We took the basic idea and translated it to Indian equity indices. Then we extended it to different SMA look-back periods (20-, 50- & 100-days) and different Kalman configurations (fixed, calibrated & adaptive.)

tl;dr: you are better off with moving averages (details).

NIFTY 50 and NIFTY BANK doesn’t trend on a daily time-frame so none of the trend-following approaches work on that. On MIDCAPs and SMALLCAPs, short moving averages reduce drawdowns. So if you can get cheap leverage or benchmark to NIFTY 50, it might make sense.

Code and charts are on github.

Introducing the StockViz Mutual Fund MCP Server

There are many instances (corporate compliance, for one) where investors cannot maintain a direct equity portfolio. This was a tough hill to climb earlier. However, thanks to the flood of index funds that scratch every itch in the market over the last couple of years, it is now possible to port some of our low-frequency quant strategies in to the domain of mutual funds.

As a Mutual Fund Distributor, if you ask us to execute this, we will obviously put you on “regular” funds. However, if you are a little tech savvy, you can do it yourself for free.

Point your AI agent to https://mutual-fund-mcp.stockviz.workers.dev/mcp and start exploring this brave new world.

We have set up a live model portfolio that tracks Factor Momentum with Index Funds. This is going to be the first of many.

Once your AI agent gets the model portfolio, you can ask it to execute it for you using any API of your choice with any broker of your choice.

Here’s a brief intro video that walks you through how to setup the MCP in an agent. We’ve shown it using Goose, but it should work in Hermes, Claude, etc… We’ve also thrown in some questions that you can ask it about the strategy, historical index metrics, etc…

We also have a ChatGPT plugin that you can use through Codex.

If you have any questions or suggests, please post them on this substack chat thread.

Factor Momentum with Index Funds

Factor Momentum is an interesting concept – it posits that factor portfolios (value, quality, low-volatility, momentum, etc.) themselves exhibit momentum. If a certain factor worked in the past, it will continue working in the near-term. We had introduced this in Factor Momentum Everywhere and setup a couple of model portfolios – Model Momentum that uses our own factor models, and Factor Momentum that uses ETFs.

While discussing Factor MAX, we realized that there are now index funds that reference the basic factors that can be used instead of ETFs. ETF liquidity tends to be patchy and does not support large portfolios. Index funds are more convenient in that sense.

Here’s how factor momentum using just these basic factor indices looks like:

Like every investment/trading strategy, there will obviously be years where it under-performs.

However, it looks like this has held its own.

Financial News Sentiment Analysis: Qwen vs. Jev

Ever since Typesafe’s Jev came out, people have been raving about its “one-shot” classification capability. We decided to put our news archives through Qwen (a “regular” llm) and Jev (a classifier) to bucket the sentiment expressed in each of them into Positive, Neutral and Negative.

Is Jev lazy? Picking “Neutral” is the path of least resistance, isn’t it? What if we split it by media type?

It looks like Jev loves being neutral. Either Indian financial media is mostly unbiased or Jev is not as “one-shot” as claimed to be. Thanks to Jev’s neutrality, the two models agree only 43% of the time.

Given their differences, are they useful?

There is no evidence that extreme media sentiment reliably predicts subsequent index direction. The positive post-event paths may simply reflect the general upward drift of the indices.

It appears that sentiment is in the eye of the analyzer and largely useless in predicting low frequency market direction. Details about the methodology and results are here.

Code and charts are on github.