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.
- 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).
git clone https://github.com/dfdamiao/intermarket-analysis.git
cd intermarket-analysis
pip install -e .
# or: pip install -r requirements.txtPython >= 3.11.
# 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_htmlOpen the generated file in html_exports/ in any browser.
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"])- Data source: yfinance only.
fetch_market_dataexposes a no-op_save_to_databasehook 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.
MIT, see LICENSE.