{"id":23305829,"url":"https://github.com/mmsaki/whale_portfolio","last_synced_at":"2026-05-06T06:36:14.550Z","repository":{"id":110308671,"uuid":"476950211","full_name":"mmsaki/whale_portfolio","owner":"mmsaki","description":"Determine which Whale portfolio is performing the best across multiple areas:  volatility, returns, risk  and Sharpe ratios.","archived":false,"fork":false,"pushed_at":"2022-05-18T19:35:21.000Z","size":30116,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-17T13:42:54.069Z","etag":null,"topics":["datetime","finance","jupyter-notebook","matplotlib","numpy","pandas","pathlib","python","quantitative-finance","seaborn","stock-market","trading-strategies"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmsaki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-02T04:49:49.000Z","updated_at":"2023-04-23T11:31:46.000Z","dependencies_parsed_at":"2023-04-28T15:00:19.324Z","dependency_job_id":null,"html_url":"https://github.com/mmsaki/whale_portfolio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mmsaki/whale_portfolio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmsaki%2Fwhale_portfolio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmsaki%2Fwhale_portfolio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmsaki%2Fwhale_portfolio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmsaki%2Fwhale_portfolio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmsaki","download_url":"https://codeload.github.com/mmsaki/whale_portfolio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmsaki%2Fwhale_portfolio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280890523,"owners_count":26408765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datetime","finance","jupyter-notebook","matplotlib","numpy","pandas","pathlib","python","quantitative-finance","seaborn","stock-market","trading-strategies"],"created_at":"2024-12-20T12:14:23.266Z","updated_at":"2025-10-25T01:13:26.659Z","avatar_url":"https://github.com/mmsaki.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Whale Portfolio Analysis\n\u003c!---\n\u003cimg src=\"https://c.tenor.com/jr1MtHkypYUAAAAC/nature-whaleshark.gif\" alt=\"drawing\" width=\"100%\"/\u003e\n--\u003e\n# Table of Contents\n1. [Background](#1-background)\n2. [My Analysis](#2-my-analysis)\n3. [Results](#3-results)\n\n## [1. Background](#1-background)\n\n* Using a portfolio data to determine which portfolio is performing the best across multiple areas:\n    * volatility\n    * returns\n    * risk \n    * Sharpe ratios\n* This python code compares [my custom portfolio](/custom_portfolio/) to [the whales](/Resources/whale_returns.csv) and [two alogorithmic trading strategies](/Resources/algo_returns.csv)\n* This code compares if my custom portfolio: \n    * Outperforms\n    * Underperforms \n    * Or Equally perfroms \n\n## [2. My Analysis](#2-my-analysis)\n* Analyze whale Returns of Soros, Paulson,Tiger and Berkshire \n    * Read the Whale Portfolio daily returns and clean the data \n    ![Whale Data Analysis](./images/whale_analysis.png)\n* Analyze Algorithm 1 and Algorithm 2 Daily Returns\n    * Read the algorithmic daily returns and clean the data\n    ![Algorithm Data Analysis](./images/algorithm_analysis.png)\n* S\u0026P 500 Returns\n    * Read the S\u0026P 500 historic closing prices and create a new daily returns DataFrame from the data.\n    ![S \u0026 P 500 Data Analysis](./images/sp500_analysis.png)\n* Combine Returns\n    ![Combined Returns](./images/combined_returns.png)\n* Performance Analysis\n    * Calculate and Plot the daily returns.\n    * Calculate and Plot cumulative returns.\n    ![Daily Returns](./images/daily_returns.png)\n* Risk analysis:\n    * Create a box plot for each portfolio.\n    * Calculate the standard deviation for all portfolios\n    * Determine which portfolios are riskier than the S\u0026P 500\n    * Calculate the Annualized Standard Deviation\n    ![Risk Analysis](./images/risk_analysis.png)\n* Rolling Statistics.\n    * Calculate and plot the rolling standard deviation for all portfolios using a 21-day window\n    * Calculate the correlation between each stock to determine which portfolios may mimick the S\u0026P 500\n    ![Rolling Stats](./images/rolling_stats.png)\n    * Choose one portfolio, then calculate and plot the 60-day rolling beta between it and the S\u0026P 500\n    * Calculate and Plot Beta for a chosen portfolio and the S\u0026P 500\n        *  Try calculating the `ewm` with a 21-day half life for each portfolio, using standard deviation (std) as the metric of interest. \n        ![Beta Plot 60 day Window](./images/plot_beta.png)\n* Sharpe ratio analysis\n    * Calculate the Sharpe ratios and generate a bar plot\n    ![Sharpe Ratios](./images/sharpe_ratios.png)\n* Determine whether the algorithmic strategies outperform both the market (S\u0026P 500) and the whales portfolios.\n![Algorism Performace](./images/algorithm_performance.png)\n* Create Custom Portfolio\n    * Choose 3-5 custom stocks with at last 1 year's worth of historic prices and create a DataFrame of the closing prices and dates for each stock.\n    ![Custom Stocks](./images/custom_stocks.png)\n    * Calculate the weighted returns for the portfolio assuming an equal number of shares for each stock\n        * Join your portfolio returns to the DataFrame that contains all of the portfolio returns\n        ![Joined Portfolios](./images/joined_portfolios.png)\n    * Calculate the Annualized Standard Deviation.\n    * Calculate and plot rolling `std` with a 21-day window.\n    * Calculate and plot the correlation.\n    * Calculate and plot beta for your portfolio compared to the S\u0026P 60 TSX.\n        ![Joined Correlations](./images/custom_beta.png)\n\n* Calculate the Sharpe ratios and generate a bar plot.\n    * How does my portfolio do?\n    ![My Portfolio Results](./images/my_results.png)\n\n## [3. Results](#3-results)\n* **File:** [Whale Analysis](./whale_analysis.ipynb)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmsaki%2Fwhale_portfolio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmsaki%2Fwhale_portfolio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmsaki%2Fwhale_portfolio/lists"}