feat: add historical account FX lifecycle#125
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Why
The previous scalar
account_currency_fxsetting applied one present-day value to an entire historical run. That retroactively repriced position notional, P&L, and fees, and it also mixed signal-time sizing with fill-time conversion. A second masking defect recomputed already-paid open-entry commission at the new rate during an FX rollover. Together those lifecycle errors could hide or manufacture broker margin actions.The new curve is inclusive as-of with scalar fallback before its first point. Daily provider closes become effective at D+1 00:00 UTC in the harness. Entry fees remain fixed at their fill-time account value while TradingView-compatible realized trade reporting continues to convert the complete trade at exit-time FX.
Verification
ctest --test-dir build --output-on-failure -j 16: 113/113 passedpython3 scripts/fingerprint_self_test.py: 78/78 passedpython3 scripts/run_corpus_self_test.py: 5/5 fail-closed cases passedJOBS=16 scripts/run_corpus.sh: 252/252 strategy executions passed; 247 Excellent / 4 Strong / 1 known anomalydomain-result.jsonSHA-2565f85f1491efe1969055c94d09eb9db3432b2b6f021f78e76266ddfb865ac089a)run_corpus.shexited before stale-output verificationbash -n scripts/run_corpus.shandgit diff --check