Python
Extracting Market Mood Index (MMI) from TickerTape

FabTrader
Introduction
Market sentiment plays a crucial role in trading and investing decisions. One of the popular indicators for market sentiment is the Market Mood Index (MMI), available on TickerTape. This index, which ranges from 0 to 100, provides insights into whether the market is experiencing Extreme Fear, Fear, Greed, or Extreme Greed.
For algo traders, having access to MMI data can be valuable for integrating sentiment analysis into automated trading strategies. In this article, we will demonstrate how to extract MMI data programmatically using Python and Selenium.

Courtesy : TickerTape.in
What does the Market Mood Index Score Indicate?

Courtesy : TicketTape.in
Why Extract Market Mood Index Programmatically?
TickerTape displays the Market Mood Index on its website, but it does not provide an easily accessible API. To integrate this data into algo trading dashboards, financial models, or market analysis tools, we need to scrape the data using automation.
With Selenium, we can extract this information dynamically, ensuring that our trading models stay updated with the latest market sentiment.
Prerequisites
To follow along, ensure you have the following installed:
- Python (3.x recommended)
- Selenium for web automation
- webdriver-manager to manage the Chrome WebDriver
pip install selenium webdriver-managerPython Script to Scrape Market Mood Index
Below is a Python script that fetches the MMI Score from TickerTape:
# ---------------------------------------------------------------------------------------
# Extract Market Mood Index from TickerTape.in website
#
# Usage: Educational Purposes & training use only. Not for commercial redistribution.
# FabTrader Algorithmic Trading - Tutorials
# ---------------------------------------------------------------------------------------
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
# Setup Chrome Options
chrome_options = Options()
chrome_options.add_argument("--headless") # Run in background
# Initialize WebDriver
service = Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=service, options=chrome_options)
# Open TickerTape MMI Page
url = "https://www.tickertape.in/market-mood-index"
driver.get(url)
# Wait for page to load
driver.implicitly_wait(5)
# Locate MMI Score Element (Inspect the page to get correct XPath or CSS Selector)
mmi_score_element = driver.find_element("xpath", "//span[contains(@class, 'jsx-3654585993 ')]")
# Extract Text
mmi_score = float(mmi_score_element.text)
# Extract Market Mood
if mmi_score >= 70:
mmi_mood = "Extreme Greed"
elif mmi_score >= 50:
mmi_mood = "Greed"
elif mmi_score >= 30:
mmi_mood = "Fear"
else:
mmi_mood = "Extreme Fear"
print("Market Mood Index by TickerTape")
print(f"MMI Score: {mmi_score} - Market Mood: {mmi_mood}")
# Close Browser
driver.quit()
How to Use This Data in Algo Trading?
Algo traders can integrate MMI data into their trading strategies in multiple ways:
- AI & Machine Learning Models: Use historical MMI data as a feature for training trading models.
- Filter Trades Based on Sentiment: Avoid aggressive trading during Extreme Greed or Extreme Fear.
- Mean Reversion Strategies: Trade reversals when MMI reaches extreme levels.
- Portfolio Hedging: Adjust hedging strategies based on market sentiment.
Final Thoughts
The Market Mood Index provides valuable insights into market sentiment. By automating the extraction of this data, algo traders and quantitative analysts can enhance their decision-making processes.
With Selenium, fetching live MMI data is now simple. Traders can integrate this script into their trading dashboards, algo trading bots, or market analysis tools to stay updated on real-time market sentiment.
If you found this useful, feel free to share it with your trading community! 🚀
More from Python
Finding the Most Liquid Equity ETFs in each Category using Python
Not all ETFs are created equal — especially when it comes to liquidity. While NSE provides a full ETF list, identifying the...
The Market’s Coiled Spring — Building the Momentum Squeeze Indicator in Python
Volatility doesn’t expand randomly — it contracts first. The Momentum Squeeze Indicator, popularized by LazyBear, is built on this simple but powerful...
Price Consolidation Boxes: Ranges, Breakouts, and Retests Using Python
Markets don’t trend most of the time — they pause, compress, and consolidate. Before every meaningful move up or down, price typically...
