• Products
    Investment Suite
    Stocks
    Mutual Funds
    Future and Options
    IPO
    Exchange Traded Funds
    Commodity
    Stockcase (Stock Baskets)
    Non Convertible Debentures
    Sovereign Gold Bond
    Exclusive
    NRI Account
    Corporate/HUF Trading Account
    Private Client Group
    Features
    SipIt
    MTF
    Investment Suite
    Exclusive
    Features
    Stocks
    Mutual Funds
    Future and Options
    IPO
    Exchange Traded Funds
    Commodity
    Stockcase (Stock Baskets)
    Non Convertible Debentures
    Sovereign Gold Bond
    NRI Account
    Corporate/HUF Trading Account
    Private Client Group
    SipIt
    MTF
  • Platform
    Trading Platforms
    Kotak Neo App & Web
    Nest Trading Terminal
    NEO Trade APIs
    Trade From Charts
    Features and Tools
    MTF
    Securities Accepted as Collateral
    Margin Requirements
    Equity Screeners
    Payoff Analyzer
    Calculators
    SIP Calculator
    Lumpsum Calculator
    Brokerage Calculator
    Margin Calculator
    MTF Calculator
    SWP Calculator
    CAGR Calculator
    Simple Interest Calculator
    ELSS Calculator
    Step up SIP Calculator
    All Calculators
    Trading Platforms
    Features and Tools
    Calculators
    Kotak Neo App & Web
    Nest Trading Terminal
    NEO Trade APIs
    Trade From Charts
    MTF
    Securities Accepted as Collateral
    Margin Requirements
    Equity Screeners
    Payoff Analyzer
    SIP Calculator
    Lumpsum Calculator
    Brokerage Calculator
    Margin Calculator
    MTF Calculator
    SWP Calculator
    CAGR Calculator
    Simple Interest Calculator
    ELSS Calculator
    Step up SIP Calculator
  • Pricing
  • Research
    Research Calls
    Long Term calls
    Short Term calls
    Intraday calls
    Derivatives calls
    Pick of the week
    Top Monthly Picks
    Stock Research Recommendations
    MTF Stock Recommendations
    Research Reports
    Fundamental Research Report
    Technical Research Report
    Derivative Research Report
    Commodities Research Report
    Research Calls
    Research Reports
    Long Term calls
    Short Term calls
    Intraday calls
    Derivatives calls
    Pick of the week
    Top Monthly Picks
    Stock Research Recommendations
    MTF Stock Recommendations
    Fundamental Research Report
    Technical Research Report
    Derivative Research Report
    Commodities Research Report
  • Market
    Market Movers
    Share Market Today
    Top Gainers
    Top Losers
    Stocks
    Large Cap
    Mid Cap
    Small Cap
    Indices
    Nifty 50
    Nifty Bank
    FinNifty
    Nifty Midcap India
    India VIX
    All Indices
    Mutual Funds
    SBI Mutual Funds
    HDFC Mutual Funds
    Axis Mutual Funds
    ICICI Prudential Mutual Funds
    Nippon India Mutual Funds
    All AMC's
    IPO
    Upcoming IPO
    Current IPO
    IPO Allotment Status
    IPO Subscription Status
    Closed IPO
    Recently Listed IPO
    Quarterly Results
    Australian Premium Solar (India)'s Q2 FY 2025-26 Quarterly Results
    SG Mart's Q2 FY 2025-26 Quarterly Results
    Rajoo Engineers' Q2 FY 2025-26 Quarterly Results
    Hybrid Financial Services' Q2 FY 2025-26 Quarterly Results
    Market Movers
    Stocks
    Indices
    Mutual Funds
    IPO
    Quarterly Results
    Share Market Today
    Top Gainers
    Top Losers
    52 Week High
    52 Week Low
    Volume Shockers
    Large Cap
    Mid Cap
    Small Cap
    State Bank of India
    Reliance Industries Ltd
    HDFC Bank Ltd
    Infosys Ltd
    Tata Capital
    LG Electronics India
    Tata Consultancy Services Ltd
    Hindustan Unilever Ltd
    ITC Ltd
    IRCTC
    NSE
    Nifty 50
    Nifty Bank
    FinNifty
    Nifty Midcap India
    India VIX
    BSE
    Sensex
    BSE Bankex
    BSE Small Cap
    BSE Mid Cap
    BSE 100
    Global Indices
    Gift Nifty
    Dow Jones
    Nikkei Index
    Hong Kong Index
    KOSPI Index
    AMC's
    SBI Mutual Funds
    HDFC Mutual Funds
    Axis Mutual Funds
    ICICI Prudential Mutual Funds
    Nippon India Mutual Funds
    Schemes
    Parag Parikh Flexi Cap
    SBI Small Cap Fund
    SBI Contra Fund
    Nippon Small Cap Fund
    ICICI Pru Technology Fund
    NFO
    Upcoming IPO
    Current IPO
    IPO Allotment Status
    IPO Subscription Status
    Closed IPO
    Recently Listed IPO
    Safecure Services IPO
    Orkla India IPO
    Studds IPO
    Lenskart IPO
    Curis Lifesciences IPO
    Finbud Financial Services IPO
    Shreeji Global FMCG IPO
    Groww IPO
    Australian Premium Solar (India)'s Q2 FY 2025-26 Quarterly Results
    SG Mart's Q2 FY 2025-26 Quarterly Results
    Rajoo Engineers' Q2 FY 2025-26 Quarterly Results
    Hybrid Financial Services' Q2 FY 2025-26 Quarterly Results
    Inventurus Knowledge Solutions' Q2 FY 2025-26 Quarterly Results
    Onelife Capital Advisors' Q2 FY 2025-26 Quarterly Results
    Jet Freight Logistics' Q2 FY 2025-26 Quarterly Results
    Xchanging Solutions' Q2 FY 2025-26 Quarterly Results
    Welspun Corp's Q2 FY 2025-26 Quarterly Results
    United Spirits' Q2 FY 2025-26 Quarterly Results
    Union Bank of India's Q2 FY 2025-26 Quarterly Results
    TD Power Systems' Q2 FY 2025-26 Quarterly Results
  • Learn
    Stockshaala
    Basics of Stock Market
    Introduction to Fundamental Analysis
    Introduction to Technical Analysis
    Derivatives, Risk management & Option Trading Strategies
    Personal Finance
    Explore More
    Resource
    Market Ready
    Kotak Insights
    Infographic
    Podcast
    Webinars
    Youtube Channel
    Investing Guide
    Demat Account
    Trading Account
    Share Market
    Intraday Trading
    IPO
    Mutual Funds
    Events
    Budget 2025
    Muhurat Trading
    Share Market Holiday
    Market Outlook 2025
    Stockshaala
    Resource
    Investing Guide
    Events
    Basics of Stock Market
    Introduction to Fundamental Analysis
    Introduction to Technical Analysis
    Derivatives, Risk management & Option Trading Strategies
    Personal Finance
    Market Ready
    Kotak Insights
    Infographic
    Podcast
    Webinars
    Youtube Channel
    Demat Account
    Trading Account
    Share Market
    Intraday Trading
    IPO
    Mutual Funds
    Budget 2025
    Muhurat Trading
    Share Market Holiday
    Market Outlook 2025
  • Partner
    Business Associates
    Kotak Connect Plus
    Startup connect
    Business Associates
    Kotak Connect Plus
    Startup connect
  • Support
    FAQs
    Circulars
    Bulletins
    Contact Us
    Forms Download
    Get your Statement
    FAQs
    Circulars
    Bulletins
    Contact Us
    Forms Download
    Get your Statement
  • News

logo
Algorithmic Trading
6 Modules | 23 Chapters
Module 5
Popular Algo Trading Strategies
Course Index

Algo Strategy: Sentiment Driven Trades

Ever seen a stock jump 8% within minutes of a breaking news alert?

That’s sentiment in action.

While traditional strategies focus on price, volume, and indicators — sentiment-based algos try to understand what the market is feeling and react faster than any human possibly can.

In simple words — it’s about figuring out whether the tone of the news, tweets, articles, or announcements is positive, negative, or neutral.

Just like we say, “The vibes are good,” algos try to read market vibes from:

  • News websites
  • Social media (like Twitter/X)
  • Company announcements
  • Forums and blogs

Algos are programmed with Natural Language Processing (NLP) tools. These tools can:

  • Scan hundreds of headlines in seconds

  • Understand keywords and tone

  • Score the sentiment (e.g., +0.8 for very positive, -0.6 for negative) If a stock gets a sudden wave of positive news, the algo may:

  • Go long (buy the stock)

  • Place a tight stoploss (in case it's a false signal)

  • Exit when the euphoria cools down

Example

Let’s say a big news headline breaks: "Company XYZ bags ₹1,200 crore defence contract"

Algo scans the word “bags,” “₹1,200 crore,” and “defence” → assigns a positive score.

Stock is already up 2% in the pre-market.

Algo:

  • Confirms spike in volume
  • Confirms tweet storm building up
  • Triggers a quick buy trade

import pandas as pd import re from datetime import datetime

#---- Example inputs (exactly as described) ---- headline = "Company XYZ bags ₹1,200 crore defence contract" tweets = [ "Big win for $XYZ as it bags massive defence order!", "Volume building up fast. Watching XYZ closely." ]

premarket_change = 0.02 #+2% pre-market volume_spike = True #confirmed tweet_surge = True #confirmed

last_price = 100.0 #mock LTP vwap_now = 100.8 #mock intraday VWAP

#---- Tiny lexicon sentiment scorer (fast + transparent) ---- LEXICON = { "bags": 0.9, "wins": 0.7, "secures": 0.7, "award": 0.6, "order": 0.5, "contract": 0.7, "defence": 0.2, "crore": 0.2, "probe": -0.6, "downgrade": -0.7, "loss": -0.6, "delay": -0.4, "ban": -0.7, "default": -0.9, "fraud": -1.0, "penalty": -0.6 }

def score_text(text: str, lex=LEXICON) -> float: tokens = re.findall(r"[a-zA-Z]+", text.lower()) hits = [lex[t] for t in tokens if t in lex] if not hits: return 0.0 return max(-1.0, min(1.0, sum(hits)/len(hits)))

#---- Sentiment on the provided example ---- news_scores = [score_text(headline)] tweet_scores = [score_text(t) for t in tweets] sentiment = round(pd.Series(news_scores + tweet_scores).mean(), 3)

#---- Trading rule (quick, sentiment-led scalp toward VWAP) ---- POS_THRESH = 0.25 PREMARKET_MIN = 0.02

conditions_ok = ( sentiment >= POS_THRESH and premarket_change >= PREMARKET_MIN and volume_spike and tweet_surge )

if conditions_ok: entry = round(last_price, 2) target = round(min(vwap_now, entry * 1.01), 2) #~1% or VWAP, whichever lower stop = round(entry * 0.985, 2) #~1.5% tight SL action = "BUY" why = f"sentiment={sentiment}≥{POS_THRESH}; premarket={int(PREMARKET_MIN*100)}%+; volume spike; tweet surge" else: action = "NO TRADE" entry = target = stop = None why = "conditions not met"

#---- Output ---- result = { "time": datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "headline": headline, "sentiment": sentiment, "premarket_change_%": round(premarket_change*100, 2), "volume_spike": volume_spike, "tweet_surge": tweet_surge, "action": action, "entry": entry, "target": target, "stop": stop, "vwap_now": vwap_now, "why": why }

print(pd.Series(result))

These trades are usually short-term momentum plays, lasting from a few minutes to an hour.

  • Sarcasm & slang: Hard for algos to detect (e.g., “Wow, what a brilliant loss!” might be negative but sounds positive)
  • Fake news: Algos can’t always detect reliability
  • Speed race: Many institutions are doing this, so latency (speed) matters a lot

As a beginner:

  • Don’t build a sentiment engine from scratch — it’s complex
  • Use basic API-based sentiment data (if available)
  • Combine sentiment with price action or volume confirmation

For example: “If sentiment score > 0.7 and price > previous day’s high, go long.”

Sentiment algos are often used in event-based trading:

  • Budget days
  • Election results
  • Quarterly earnings
  • Global news (like Fed interest rate changes)

Here, news = trigger, and algos are always listening.

That wraps up our look at popular algo strategies!

Next, we’ll begin Module 6, where we shift from theory to action:
Let’s Build a Simple Algo!

Is this chapter helpful?
Share
What could we have done to make this article better?

Algo Strategy: VWAP Strategy – Trade Like Big Players
Tweak & Improve Your Strategy

Disclaimer: This article is for informational purposes only and does not constitute financial advice. It is not produced by the desk of the Kotak Securities Research Team, nor is it a report published by the Kotak Securities Research Team. The information presented is compiled from several secondary sources available on the internet and may change over time. Investors should conduct their own research and consult with financial professionals before making any investment decisions. Read the full disclaimer here.

Investments in securities market are subject to market risks, read all the related documents carefully before investing. Brokerage will not exceed SEBI prescribed limit. The securities are quoted as an example and not as a recommendation. SEBI Registration No-INZ000200137 Member Id NSE-08081; BSE-673; MSE-1024, MCX-56285, NCDEX-1262.

Algo Strategy: VWAP Strategy – Trade Like Big Players
Tweak & Improve Your Strategy

Disclaimer: This article is for informational purposes only and does not constitute financial advice. It is not produced by the desk of the Kotak Securities Research Team, nor is it a report published by the Kotak Securities Research Team. The information presented is compiled from several secondary sources available on the internet and may change over time. Investors should conduct their own research and consult with financial professionals before making any investment decisions. Read the full disclaimer here.

Investments in securities market are subject to market risks, read all the related documents carefully before investing. Brokerage will not exceed SEBI prescribed limit. The securities are quoted as an example and not as a recommendation. SEBI Registration No-INZ000200137 Member Id NSE-08081; BSE-673; MSE-1024, MCX-56285, NCDEX-1262.

Beyond Stockshaala

Discover our extensive knowledge center

Kotak Insights

An insightful weekend read on market trends, company stories, and historical events.

Neo Shorts

A visual spotlight on buzzing sectors and rising stars of the Indian stock market.

Investing Guide

Comprehensive library of blogs focussed to build your financial confidence.

Market Ready

Stay ahead of the game with daily market trends, global insights, and key investment updates.

Webinars

Live sessions with industry leaders for in-depth market knowledge.

Podcast

Latest trends, strategies, and market updates with our seasoned experts.