Skip to content

Dow Price/Sentiment Divergence

Flags Dow 30 names where 7-day price and sentiment are pulling in opposite directions, a contrarian shortlist.

Analyze Stocks 2 tools 240 Tokens / Run Python · Node.js

What this recipe solves

A large cap grinding higher while its coverage sours, or selling off while the mood turns constructive, is the setup a screener built on price alone cannot see. This scans all thirty for that gap.

Copy, run, ship

Drop this script into your project and run it locally or on a cron. Set GUAVY_KEY in your environment, swap the symbols, and go.

Python
# dow_divergence.py
import os, requests

API = "https://guavy.com/api/v2/stocks"
H   = {"Authorization": f"Bearer {os.environ['GUAVY_KEY']}"}
DOW = "AAPL AMGN AMZN AXP BA CAT CRM CSCO CVX DIS DOW GS HD HON IBM JNJ JPM KO MCD MMM MRK MSFT NKE NVDA PG SHW TRV UNH V WMT".split()

for sym in DOW:
    prices = requests.get(
        f"{API}/technical-analysis/get-price-history/{sym}", headers=H
    ).json()["price_history"]
    prices.sort(key=lambda p: p["timestamp"])
    if len(prices) < 8:
        continue
    change = (prices[-1]["price"] - prices[-8]["price"]) / prices[-8]["price"] * 100

    sent = requests.get(
        f"{API}/sentiment/get-sentiment-history/{sym}",
        headers=H, params={"limit": 7}
    ).json()["sentiment"]
    net = sum(r["positive"] - r["negative"] for r in sent)

    if change > 5 and net < 0:
        print(f"{sym}: price +{change:.1f}% but sentiment net-negative ({net})")
    elif change < -5 and net > 0:
        print(f"{sym}: price {change:.1f}% but sentiment net-positive (+{net})")

2 tools, one script

This script calls 2 endpoints from the Guavy REST API. Every data point maps back to the endpoint it came from.

Run this recipe in under 2 minutes

Grab a free API key, set it as an env var, and run the script. Free sandbox forever.

Disclaimer: Guavy is a data and market intelligence provider, not an investment advisor. The information, signals, and market analysis provided by the Guavy API and related services are for informational purposes only and are not intended as financial advice, investment recommendations, or an endorsement of any particular trading strategy. Trading in volatile markets, including cryptocurrency, carries significant risk and may not be suitable for all investors. Past performance is not indicative of future results. Users should consult with a qualified financial professional before making any investment decisions. Guavy makes no guarantee of trading profits or financial returns.

Market sentiment intelligence for apps, funds & agents

Location

729 55 Ave SW
Calgary AB T2V 0G4
Canada

© 2026 Guavy Inc