notebook 04

This commit is contained in:
2026-07-02 16:30:24 -04:00
parent 026503146e
commit 7bbeee47f4
2 changed files with 1691 additions and 10 deletions
@@ -33,7 +33,7 @@
"\n",
"## Outputs\n",
"\n",
"- `composite_signal.csv` — the **momentum-only** sector-neutralized signal (this is what will backtest trades)\n",
"- `momentum_signal.csv` — the **momentum-only** sector-neutralized signal (this is what will backtest trades)\n",
"- `composite_4factor.csv` — the 4-factor equal weight composite (kept for comparison)\n",
"- Per-factor neutralized exposures\n",
"\n",
@@ -87,7 +87,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "0090dab7",
"metadata": {},
"outputs": [
@@ -134,7 +134,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "83a54dbc",
"metadata": {},
"outputs": [
@@ -205,7 +205,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"id": "b7ce2018",
"metadata": {},
"outputs": [
@@ -291,7 +291,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"id": "792e547e",
"metadata": {},
"outputs": [
@@ -350,7 +350,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 6,
"id": "25e7a046",
"metadata": {},
"outputs": [
@@ -505,7 +505,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 7,
"id": "9c9cc628",
"metadata": {},
"outputs": [
@@ -514,7 +514,7 @@
"output_type": "stream",
"text": [
"Saved:\n",
" - composite_signal.csv (momentum-only, sector-neutralized — THE HEADLINE)\n",
" - momentum_signal.csv (momentum-only, sector-neutralized — THE HEADLINE)\n",
" - composite_4factor.csv (4-factor equal-weight — comparison only)\n",
" - factor_momentum_neutralized.csv\n",
" - factor_value_neutralized.csv\n",
@@ -530,7 +530,7 @@
"==================================\n",
"\"\"\"\n",
"# The headline signal: momentum-only, sector-neutralized\n",
"df_momentum_signal.to_csv('../data/processed/composite_signal.csv')\n",
"df_momentum_signal.to_csv('../data/processed/momentum_signal.csv')\n",
"\n",
"# The 4-factor composite: kept for comparison\n",
"df_composite_4f.to_csv('../data/processed/composite_4factor.csv')\n",
@@ -540,7 +540,7 @@
" factor_neut[name].to_csv(f'../data/processed/factor_{name}_neutralized.csv')\n",
"\n",
"print(\"Saved:\")\n",
"print(\" - composite_signal.csv (momentum-only, sector-neutralized — THE HEADLINE)\")\n",
"print(\" - momentum_signal.csv (momentum-only, sector-neutralized — THE HEADLINE)\")\n",
"print(\" - composite_4factor.csv (4-factor equal-weight — comparison only)\")\n",
"for name in factor_names:\n",
" print(f\" - factor_{name}_neutralized.csv\")"
File diff suppressed because one or more lines are too long