Skip to content

Add FXMacroData bar source#60

Draft
roberttidball wants to merge 1 commit into
gbeced:developfrom
roberttidball:agent/fxmacrodata-bars
Draft

Add FXMacroData bar source#60
roberttidball wants to merge 1 commit into
gbeced:developfrom
roberttidball:agent/fxmacrodata-bars

Conversation

@roberttidball

Copy link
Copy Markdown

Summary

Adds a direct FXMacroData daily bar source under basana.external.fxmacrodata.bars.

The new BarSource:

  • fetches https://fxmacrodata.com/api/v1/forex/{base}/{quote} with start_date and end_date
  • supports API keys via constructor, FXMACRODATA_API_KEY, or FXMD_API_KEY
  • converts FXMacroData daily spot/reference rows into close-only BarEvents where open/high/low/close are equal and volume is 0
  • sorts emitted events by timestamp for dispatcher consumption

This is intended for FX and macro research/backtesting where daily official-source reference rates are useful, not for intraday exchange-traded candles.

Validation

  • python -m pytest tests\test_fxmacrodata_bars.py -q
  • python -m ruff check basana\external\fxmacrodata tests\test_fxmacrodata_bars.py
  • python -m compileall -q basana\external\fxmacrodata
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant