Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save quantra-go-algo/ea1916ffc162844d849ec25c32f967bb to your computer and use it in GitHub Desktop.

Select an option

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)
# 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