This directory is the source bundle for the public examples repository: https://github.com/fxmacrodata/examples
Use these projects to publish demos across app stores, template directories, and hosting platforms so developers discover FXMacroData quickly and then move to a paid plan at:
Public endpoints (USD announcements, forex, calendar, market sessions, data catalogue) can be used without an API key. Protected endpoints (non-USD announcements, COT, commodities) require a paid key from the subscribe flow.
| App | Framework | Hosted on | Live URL |
|---|---|---|---|
| Central Bank Rate Monitor | Streamlit | Streamlit Community Cloud | deploy link |
| FX Trade Setup Studio | Web (Vanilla JS) | GitHub Pages / Netlify / Vercel Static | deploy link |
| FX & Macro Explorer | Gradio | Hugging Face Spaces | deploy link |
| FX Macro Heatmap | Plotly Dash | Render | deploy link |
| Macro Intelligence Dashboard | HoloViz Panel | Hugging Face Spaces | deploy link |
| FX Market Intelligence | Next.js | Vercel | deploy link |
| USD Macro Snapshot API | FastAPI | Railway/Render/Fly.io | deploy link |
| USD Macro Landing App | Flask | Render/Railway | deploy link |
| Edge Macro Widget Proxy | Cloudflare Worker | Cloudflare | deploy link |
| Netlify Macro Widget | Netlify Functions + static | Netlify | deploy link |
| Policy Rate Divergence | Backtrader | Local script | — |
| Policy Rate Divergence | Zipline | Local script | — |
| Macro Signal (BTC/USDT) | Freqtrade | Local strategy | — |
| FX Strategy Backtesting | VectorBT (Jupyter) | Run locally / JupyterHub | — |
| Macro Data Access | pandas-datareader | Local script | — |
| Macro Carry Scanner | CCXT | Local script | — |
| Carry Rebalance Bot | Blankly | Local strategy | — |
- Launch each app in the public examples repo.
- Add a visible CTA to https://fxmacrodata.com/subscribe in app header/footer.
- Submit links to framework galleries and community indexes.
- Add badges/screenshots to this README once each app is live.
Suggested distribution targets:
- Vercel templates
- Streamlit gallery
- Hugging Face Spaces
- Netlify templates/examples
- Cloudflare Worker examples
- Plotly Dash Show and Tell
- Reddit (
r/algotrading,r/quant,r/forex) and X build threads
Never commit or print real API keys. Use only these patterns:
- Environment variables (
FXMACRODATA_API_KEY) - Host-level encrypted secrets (Vercel/Netlify/Render/Cloudflare)
.env.exampletemplates only (never real.envfiles)- Optional user-entered key fields that stay in memory only
Before publishing, run a scan:
grep -RInE "(sk-|AIza|FXMACRODATA_API_KEY\s*=\s*['\"][^'\"]+)" . || trueUse FXMacroData as a custom data source inside QuantConnect backtests and live-trading algorithms.
cd quantconnect # copy fxmacrodata/ into your LEAN projectSee quantconnect/README.md for setup instructions and two
example algorithms:
- Macro Monitor — plot USD indicators in QuantConnect charts (free, no key)
- Policy Rate Divergence — FX carry strategy driven by central-bank rate differentials
Use FXMacroData as a macro signal source inside Freqtrade strategies.
cd freqtrade
cp fxmacrodata_ft.py MacroSignalStrategy.py \
~/.freqtrade/user_data/strategies/
freqtrade backtesting --strategy MacroSignalStrategy --timeframe 1d \
--timerange 20200101-20251231 --pair BTC/USDTSee freqtrade/README.md for setup and the included
Macro Signal strategy (BTC/USDT driven by the USD real policy rate).
Use FXMacroData as a custom bundle and macro data source inside zipline-reloaded backtests.
cd zipline && pip install -r requirements.txt && python example.pySee zipline/README.md for setup and the included
Policy Rate Divergence strategy (EUR/USD carry driven by central-bank rate
differentials).
Use FXMacroData through the CCXT unified interface. The adapter implements the standard CCXT exchange API so you can plug FXMacroData into any existing CCXT-based trading or analysis workflow.
cd ccxt && pip install -r requirements.txt && python example.pySee ccxt/README.md for setup and usage. Supported CCXT
methods:
load_markets()— 30 FX pairs + XAU/USD, XAG/USD, XPT/USDfetch_ohlcv(symbol, '1d', since, limit)— daily mid-market candlesfetch_ticker(symbol)/fetch_tickers(symbols)— latest ratesfetch_macro_indicator(currency, indicator)— macro extension
# Python apps (pick one)
cd streamlit && pip install -r requirements.txt && streamlit run app.py
cd gradio && pip install -r requirements.txt && python app.py
cd dash && pip install -r requirements.txt && python app.py
cd panel && pip install -r requirements.txt && panel serve app.py --autoreload
cd flask && pip install -r requirements.txt && python app.py
cd fastapi && pip install -r requirements.txt && uvicorn app:app --reload --port 8010
cd backtrader && pip install -r requirements.txt && python example.py
cd zipline && pip install -r requirements.txt && python example.py
cd freqtrade # copy fxmacrodata_ft.py + MacroSignalStrategy.py into user_data/strategies/
# pandas-datareader
cd pandas-datareader && pip install -r requirements.txt && python example.py
# VectorBT Jupyter notebook
cd vectorbt && pip install -r requirements.txt && jupyter notebook fxmacrodata_vectorbt.ipynb
# CCXT macro scanner
cd ccxt && pip install -r requirements.txt && python example.py
# Next.js app
cd vercel && npm install && npm run dev
# Netlify app
cd netlify-widget && npm install && npm run dev
# FX Trade Setup Studio (static app)
cd pollinations/fx-trade-setup-studio && python -m http.server 8080
# Cloudflare Worker
cd cloudflare-worker && npm install && npm run dev
# QuantConnect / LEAN — copy the fxmacrodata/ package into your LEAN project
# then follow quantconnect/README.md- Fork this repo (or push
streamlit/to your own public repo). - Go to share.streamlit.io, sign in with GitHub.
- New app → select repo → set main file to
streamlit/app.py. - Click Deploy.
- Create a Space at huggingface.co/spaces → SDK: Gradio.
- Upload
gradio/app.pyandgradio/requirements.txt. - Space builds automatically.
- Fork this repo.
- Go to render.com → New Web Service → connect repo.
- Set root directory to
dash/, start command:gunicorn app:server. - Or use the included
render.yamlblueprint: New → Blueprint → connect repo.
- Create a Space at huggingface.co/spaces → SDK: Docker.
- Upload
panel/app.py,panel/requirements.txt, andpanel/Dockerfile. - Space builds automatically.
cd vectorbt
pip install -r requirements.txt
jupyter notebook fxmacrodata_vectorbt.ipynbOr launch on any hosted Jupyter environment (Google Colab, JupyterHub, Binder)
by uploading fxmacrodata_vectorbt.ipynb and requirements.txt.
Or manually: vercel.com → Add New → Project → import repo → root directory: vercel/.
- Push
flask/orfastapi/to your public examples repo. - Create a new service on Render/Railway.
- Set start command:
- Flask:
gunicorn app:app - FastAPI:
uvicorn app:app --host 0.0.0.0 --port $PORT
- Flask:
- Add
FXMACRODATA_API_KEYas an environment variable only if you need protected endpoints.
- Import the repo into Netlify.
- Set base directory to
netlify-widget/. - Add optional environment variable:
FXMACRODATA_API_KEY. - Deploy and share your
.netlify.appURL.
- Deploy
cloudflare-worker/viawrangler deploy. - Add optional secret with
wrangler secret put FXMACRODATA_API_KEY. - Use the Worker URL from any frontend widget.
All apps accept an API key at runtime via a sidebar input. To pre-configure:
| Platform | Method |
|---|---|
| Streamlit Cloud | Settings → Secrets → FXMACRODATA_API_KEY = "key" |
| HF Spaces | Settings → Secrets → FXMACRODATA_API_KEY |
| Render | Environment → FXMACRODATA_API_KEY |
| Vercel | Settings → Environment Variables → FXMACRODATA_API_KEY |
Use FXMacroData as a drop-in data source inside any workflow that already uses pandas-datareader.
cd pandas-datareader && pip install -r requirements.txt && python example.pySee pandas-datareader/README.md for the full
guide and two usage patterns:
- Standalone readers —
FXMacroDataIndicatorReader,FXMacroDataForexReader,FXMacroDataCommoditiesReader,FXMacroDataCOTReader - DataReader interface — register once and use
pdr.DataReader("USD/inflation", "fxmacrodata", ...)
| Endpoint | Auth | Used by |
|---|---|---|
GET /v1/announcements/usd/{indicator} |
Free | Streamlit, Dash, Gradio, Panel |
GET /v1/announcements/{currency}/{indicator} |
API key | All |
GET /v1/forex/{base}/{quote} |
Free | Gradio, Backtrader, VectorBT |
GET /v1/calendar/{currency} |
Free | Gradio, Vercel |
GET /v1/commodities/{indicator} |
API key | Panel, Vercel, Backtrader |
GET /v1/cot/{currency} |
API key | Vercel |
Full reference: fxmacrodata.com/documentation