A free and open-source hedge fund position aggregator and investment simulator
- Aggregate current hedge fund positions
- Backtest the funds' original performance
- Simulate returns that would have been achieved by copying the hedge funds' positions
- With manager-weighted allocation
- With manager-weighted allocation and investment value scaled to 100% of the portfolio
- And shows all of this within a simple, neat and minimal UI :)
- Clone the repo.
- Install the dependencies using
pip install -r requirements.txt. - To update live allocations, run
python runner_update_allocations.py - To run the backtests, run
python runner_do_backtests.py - To run the UI live, run
cd src_site && npm run dev - To build the UI in the
docsdirectory, runcd src_site && npm run build
- Data for hedge fund live allocations is refreshed daily using a Github Action powered by
runner_update_allocations.py, which fetches the hedge funds from thetop_funds.jsonfile and runs the refresh function fromfetch_hedge_fund_allocations.py. The live allocations are saved to./sec/allocations, whilst CUSIP conversion cache is saved to./sec/cusip_conversion_table.json. - The backtesting entrypoint is
runner_do_backtests.py, whilst the backtesting and downloading functionality is implemented inbacktester.pyanddownload_data.py, respectively. The backtests are saved to./sec/backtests, historical allocations are saved to./sec/past_allocations, whereas price history is saved to./data/historical. - The HedgeSage UI is built using Svelte, with shadcn-svelte used as the component library. It acts merely as a front-end to the information stored in this repository. The builds are targeting the
docsdirectory for simplicity in use with GitHub Pages.
- Implement fund searching functionality by name/cik
- Filtering based on annualized returns
- Allow to retrieve 13F data from .txt files, letting backtests through years earlier than 2013.
- Allow for inclusion and downloading of non-stock tickers for the backtests
- Unified performance rating
- Allocations last update date
- Saving portfolios with automatic update checking
- Latest allocations update section
- Stock ownership information
- Adjust extreme volatility data sanity checks
- Comparison versus benchmarks
- Incremental backtest updates
- Allocations table sorting/searching
- Search in portfolio creation
- Load/unload cards in the list as the user scrolls (?)
- Politician tracking
- Biggest daily returns of the funds
- Special page for each fund (SEO)
- Portfolio builder
- Fix the live allocations retriever (basically copy functionality from the past allocations retriever)
- Prevent rate limits from sec.gov
- There is an inefficiency in
runner_do_backtests.py, as the allocations fetching is done twice - Make backtests runnable on GitHub Actions
- Allow to export allocations as a CSV
- Add link to repo
- Show when allocations were last changed
- Improve the portfolio builder UX - instead of a drawer allowing you to select portfolios, instead there should be a + button on every one of the hedge fund cards, which will add the portfolio to the portfolio builder, which in of itself could be a drawer containing just the selected portfolios instead. This is better, because that would make better use of the feature-rich cards that the user would look at anyways and avoid the use of the clumsy checkboxes
