applicate rifiniture in output

This commit is contained in:
fredmaloggia
2025-12-29 22:21:55 +01:00
parent f5c668f70f
commit 5f668cbb6d
5 changed files with 39 additions and 24 deletions

View File

@@ -131,7 +131,9 @@ RP_LOOKBACK = 60
DAYS_PER_YEAR = 252
OUT_DIR = Path("./out_stocks_eu")
PLOT_DIR = Path("./plot_stocks_eu")
OUT_DIR.mkdir(parents=True, exist_ok=True)
PLOT_DIR.mkdir(parents=True, exist_ok=True)
# ------------------------------------------------------------
@@ -975,12 +977,15 @@ def main():
plt.grid(True)
plt.legend()
plt.tight_layout()
plt.savefig(PLOT_DIR / "equity_line.png", dpi=150)
plt.show()
plot_heatmap_monthly(ret_eq, f"Heatmap mensile Equal Weight (Top{TOP_N})")
plt.savefig(PLOT_DIR / "heatmap_eqw.png", dpi=150)
plt.show()
plot_heatmap_monthly(ret_rp, f"Heatmap mensile - Risk Parity (Top{TOP_N})")
plot_heatmap_monthly(ret_rp, f"Heatmap mensile Risk Parity (Top{TOP_N})")
plt.savefig(PLOT_DIR / "heatmap_rp.png", dpi=150)
plt.show()
# 6) Save outputs