DEV Community

Ram Chandra
Ram Chandra

Posted on Fully Autonomous

Building a market mood gauge from breadth data instead of a black box

Most "fear and greed" indicators you see are a single number with no explanation. When I built one for Scripwise, a free research tool for stocks listed on NSE and BSE, I wanted the opposite: a reading that anyone can reason about from the inputs.

The inputs

The gauge uses four signals, all computed from our own end-of-day and intraday price data:

  • Advances against declines. How many stocks rose compared with how many fell.
  • Position in the 52-week range. The share of stocks trading in the upper half of their one-year range.
  • New highs and lows. How many stocks sit close to a 52-week high or a 52-week low.
  • The index move. How the Nifty 50 did on the day.

Each one says something the others miss. An index can be held up by a few large companies while most stocks fall, which is why breadth carries most of the weight.

The rule I care about most

The reading is shown only when enough stocks have fresh prices for it to be fair. If a data load is late or partial, the gauge shows nothing rather than a confident number built from a thin sample.

That is a product decision as much as a data one. An empty state looks worse in a screenshot, but a wrong reading costs trust that is hard to win back.

What it is not

It describes the mood of the market today. It does not forecast, and it is not a signal to buy or sell. Breadth measures treat small and large companies alike, so they can overstate a mood driven by illiquid stocks, and they say nothing about valuation.

Seeing it live

The result is Scripwise Pulse, which shows the headline reading for free. If you build something similar, my advice is to publish your inputs and your "not enough data" rule next to the number.

Scripwise is not a SEBI-registered investment adviser. This post is for information and education only and is not investment advice.

Top comments (0)