Created
June 24, 2026 01:29
-
-
Save quantra-go-algo/ea1916ffc162844d849ec25c32f967bb to your computer and use it in GitHub Desktop.
guardrailed-llm-agent — Step 9: Results and Performance Metrics (snippet 2)
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 all three curves | |
| plt.figure(figsize=(12, 5)) | |
| plt.plot(eq_agent_oos.index, eq_agent_oos.values, | |
| label='Agent-only (LLM policy)') | |
| plt.plot(eq_guard_oos.index, eq_guard_oos.values, | |
| label='Agent + Guardrails') | |
| plt.plot(eq_bh_oos.index, eq_bh_oos.values, | |
| label='Buy & Hold AAPL', linestyle='--', color='gray') | |
| plt.title(f'{SYMBOL}: OOS equity curves (from {OOS_START})') | |
| plt.xlabel('Date'); plt.ylabel('Equity (rebased to 1.0)') | |
| plt.legend(); plt.tight_layout(); plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment