Skip to content

dfdamiao/intermarket-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

intermarket-analysis

Interactive HTML dashboards of cross-asset relative performance across bonds, equities, volatility, commodities, and currencies. It downloads prices from yfinance (no API key), computes relative-return ratios from a set of chart definitions, and renders a self-contained Plotly dashboard.

What it does

  • Reads a catalog of intermarket ratios / charts (intermarket_analysis.json, ratio_definitions.json) covering hundreds of cross-asset relationships.
  • Fetches the underlying tickers from yfinance, with a local pickle cache.
  • Computes relative returns and rebased performance for each pair / basket.
  • Renders an interactive, self-contained HTML dashboard (Plotly via CDN).
  • Optionally annotates with recent central-bank policy decisions (update_central_bank_decisions.py, public central-bank sources).

Install

git clone https://github.com/dfdamiao/intermarket-analysis.git
cd intermarket-analysis
pip install -e .
# or: pip install -r requirements.txt

Python >= 3.11.

Quick start

# Build a small dashboard (a handful of charts) under ./html_exports/
python -m examples.build_dashboard

# Build the full set of charts
python -m intermarket.generate_intermarket_html

Open the generated file in html_exports/ in any browser.

How it fits together

intermarket/
  parse_intermarket_json.py        parse the chart/ratio catalog -> chart defs
  fetch_market_data.py             download tickers from yfinance (+ pickle cache)
  calculate_relative_returns.py    relative-return / rebased-performance math
  generate_intermarket_html.py     assemble the interactive Plotly dashboard
  update_central_bank_decisions.py scrape recent central-bank policy decisions
  *.json                           the chart, ratio, and CB-decision catalogs

Use the pieces directly:

from intermarket.parse_intermarket_json import IntermarketChartParser
from intermarket.fetch_market_data import IntermarketDataFetcher

charts = IntermarketChartParser().parse()
fetcher = IntermarketDataFetcher()
close, open_ = fetcher.fetch_all_tickers(["SPY", "TLT", "GLD"])

Notes

  • Data source: yfinance only. fetch_market_data exposes a no-op _save_to_database hook if you want to persist fetched series to your own store.
  • Telegram delivery is stubbed out (TELEGRAM_ENABLED = False); wire your own sender if you want the dashboard pushed somewhere.

License

MIT, see LICENSE.

About

Interactive cross-asset relative-performance dashboards across bonds, equities, vol, commodities and FX, from yfinance and Plotly.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages