How to run (Google Colab)
- Open Google Colab and upload
market_ready_engine_clean_etf_hardstop.zip. - Run these cells:
!unzip -o market_ready_engine_clean_etf_hardstop.zip -d engine_clean
%cd /content/engine_clean
!pip -q install -r requirements.txt
!python run_portfolio.py --outdir out_etf
- Upload
Legend_Mode_Portfolio.ipynbto Colab and open it. - At the top of that notebook, run:
%cd /content/engine_clean
OUTDIR = "out_etf"
Tip: If you ran with a different outdir (e.g. --outdir out_etf_hardstop), set OUTDIR accordingly.
Run with hard stop (recommended)
!python run_portfolio.py \
--hard-stop \
--hard-stop-dd -0.15 \
--hard-stop-cash BIL \
--hard-stop-cooldown 20 \
--hard-stop-reentry recover \
--outdir out_etf_hardstop
Hard stop uses BIL as cash proxy; adjust the DD threshold to match your comfort.
What you get
out_etf/summary.json— headline statsout_etf/equity_curve.csv— equity, returns, costsout_etf/weights.csv— portfolio weightsout_etf/close_prices.csv— benchmark & ETF closes (for stress tests)