fix(benchmark): compare agents against DJIA total return (DIA baseline) - #1435
Open
shuxue6662-a11y wants to merge 1 commit into
Open
Conversation
Author
|
Hi @spencerromo, this PR fixes the benchmark convention mismatch described in #1434 (agents trade total-return prices while the ^DJI baseline is price-return only). The baseline now uses DIA with adjusted prices in both the tutorial and plot.py. Happy to adjust if you prefer documenting the convention instead. |
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.
Fixes #1434
Summary
The tutorial compares agents that trade dividend-adjusted (total-return) prices against a
^DJIbaseline, which is a price-return index. The two sides therefore use different return definitions, and the reported gap includes the DJIA dividend stream (~+1.92%/yr over 2018-2025, per the issue's measurement) regardless of agent behavior.This PR makes the baseline total-return too:
examples/FinRL_StockTrading_2026_3_Backtest.py: downloadDIA(the DJIA-tracking ETF) withauto_adjust=Trueinstead of^DJI, with a comment explaining the convention.finrl/plot.py: change thebacktest_plotdefaultbaseline_tickerfrom^DJItoDIA.get_baselinealready routes throughYahooDownloader, which adjusts close prices for distributions, so the plotted baseline now matches the agent's total-return account value.README.md: clarify that the DJIA baseline is total return via the DIA ETF.Notes
DIAcarries a small expense ratio (~0.16%/yr), so it slightly understates a pure DJIA total-return index; it is used because it needs no new data source (as discussed in Benchmark comparison: agent trades dividend-adjusted prices while the DJIA baseline is price-return only聽#1434).Validation
black --checkon both modified Python files: passflake8on both modified Python files: no new issues (remaining warnings are pre-existing)