Skip to content

Add FXMacroData calendar sample#25

Open
roberttidball wants to merge 5 commits into
fbertram:masterfrom
roberttidball:agent/add-fxmacrodata-calendar-20260708
Open

Add FXMacroData calendar sample#25
roberttidball wants to merge 5 commits into
fbertram:masterfrom
roberttidball:agent/add-fxmacrodata-calendar-20260708

Conversation

@roberttidball

Copy link
Copy Markdown

Summary

  • Adds FXMacroData calendar C# sample for using FXMacroData's public release-calendar endpoint in backtesting or strategy-risk workflows.
  • Keeps the integration self-contained and avoids API-key requirements by using the public USD calendar example.

Validation

  • Ran Python syntax checks for all added Python examples where applicable.
  • Ran git diff --check for this repository.
  • Live FXMacroData calendar smoke tested with the July 2026 USD sample window from companion Python examples.

Note: Go, Rust, .NET, Maven, and TypeScript toolchains were not available in the local desktop environment for deeper build checks.

@fbertram

fbertram commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Hello Robert,
Thanks a lot for your contribution. Would you mind providing me some more background how you envision to use this code snippet?

Thank you,
Kindly, Liz

@roberttidball

Copy link
Copy Markdown
Author

Hello Liz,

Thanks for taking a look. The intended use is to give TuringTrader users a small macro-event context helper rather than a new trading engine dependency.

The practical workflow I had in mind is:

  • pull upcoming or recent FXMacroData release-calendar events for a currency such as USD, EUR, GBP, or JPY;
  • filter a TuringTrader backtest, signal review, or chart annotation around high-impact macro events such as CPI, policy-rate decisions, payrolls, GDP, or PMI;
  • keep the example isolated so users who do not use FXMacroData are unaffected.

For example, a user testing a EUR/USD, rates-sensitive ETF, or macro overlay strategy could use the snippet to avoid opening new positions shortly before a central-bank decision, annotate results around CPI/NFP releases, or compare performance inside and outside event windows.

If you prefer, I can narrow this further into a documentation-only example, move it under a contrib/examples area, or close the PR if vendor-specific data examples are outside the project scope.

@fbertram

fbertram commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Hello Robert,
Thanks for the added context. I can see how this makes sense. There are a few thoughts going through my mind:

  • I think we should have some sample strategy that showcases the feature and how it could be used
  • Because TuringTrader is mostly aiming at end-of-day trading, it would be required that there are 10+ years of history available
  • It might be good to write the code in a way that it pulls the date range from the parent Algorithm object
  • We might need to pay some close attention to the handling of time zones in the code; TuringTrader's v2 engine strictly runs in the local timezone, while the FX event calendar is likely in a different timezone.

Thoughts?

Kindly, Liz

@roberttidball

Copy link
Copy Markdown
Author

Updated the sample strategy to make the TuringTrader usage more explicit: it now defaults to a 2007-present history window, uses the parent Algorithm date range when querying FXMacroData, converts �nnouncement_datetime_utc into the market timezone before building blackout dates, and goes flat on macro blackout dates.\n\nLocal build validation could not run because dotnet is not installed in this environment; git diff --check passed.

@roberttidball roberttidball marked this pull request as ready for review July 14, 2026 11:41
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.

2 participants