-
-
Save quantra-go-algo/7f5bd5767425fbc605dbd2a4179eee3a to your computer and use it in GitHub Desktop.
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
| # PLOT CUMULATIVE RETURNS | |
| plt.figure(figsize=(14, 4)) | |
| plt.plot(df.index, df['cum_market'], label='Buy & Hold', linewidth=1) | |
| plt.plot(df.index, df['cum_strategy'], label='Strategy', linewidth=1) | |
| plt.title('Cumulative Returns: Strategy vs. Buy-and-Hold') | |
| plt.xlabel('Date'); plt.ylabel('Cumulative Return') | |
| plt.legend(); plt.grid(True); plt.tight_layout() | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment