diff --git a/OptContentManager.py b/OptContentManager.py index 820093b..55594e5 100644 --- a/OptContentManager.py +++ b/OptContentManager.py @@ -33,7 +33,7 @@ def importantDefinitions(): **Understanding the Process:** - We calculate returns and risks for various asset weightings, plotting them on a scatter plot. Through **optimization**, we identify the 'Efficient Frontier' — the best return for a given risk level. From this, we derive the **Maximum Sharpe Ratio** portfolio, which offers the highest return per unit of risk. Learn more about the Efficient Frontier [here](https://www.investopedia.com/terms/e/efficientfrontier.asp). - The library used for the optimization is [PyPortfolioOpt](https://pyportfolioopt.readthedocs.io/en/latest/) - + **📈 Maximum Sharpe Ratio Portfolio:** - This portfolio provides the best risk-adjusted return. For instance, a Sharpe ratio of 1.5 means 1.5 units of gain for each unit of risk. It's ideal for those seeking maximum growth with controlled risk. @@ -91,4 +91,4 @@ def exampleWalkthrough(): **Blended Strategy:** - While each portfolio targets specific risk preferences, a blended approach may appeal to investors looking for a balance between growth and safety. By combining elements of both the Maximum Sharpe Ratio and Minimum Volatility portfolios, investors can tailor their exposure to match their individual risk tolerance and investment goals. - """ + """ \ No newline at end of file diff --git a/app.py b/app.py index 52e1e6a..ebf1fe5 100644 --- a/app.py +++ b/app.py @@ -183,6 +183,8 @@ plt.grid(True) st.pyplot(fig) + st.write("Tool Created by Alan") + @@ -259,6 +261,7 @@ st.write("### Portfolio and Benchmark Ending Values") st.write(f"**Final Portfolio Balance:** ${portfolio_history.iloc[-1]:,.2f}") st.write(f"**Final Benchmark Balance:** ${benchmark_history.iloc[-1]:,.2f}") - + st.write("Tool Created by Alan ") except IndexError as e: st.error(f"An error occurred: {e}") + diff --git a/test.ipynb b/test.ipynb new file mode 100644 index 0000000..da8e9f4 --- /dev/null +++ b/test.ipynb @@ -0,0 +1,76 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Library Versions:\n", + "Streamlit: 1.36.0\n", + "Pandas: 2.0.3\n", + "Numpy: 1.23.5\n", + "yfinance: 0.2.27\n", + "Matplotlib: 3.7.2\n", + "PyPortfolioOpt: 1.5.5\n", + "datetime: Built-in module, version not applicable.\n" + ] + } + ], + "source": [ + "import streamlit as st\n", + "import pandas as pd\n", + "import numpy as np\n", + "import yfinance as yf\n", + "import matplotlib\n", + "import matplotlib.pyplot as plt\n", + "import pypfopt\n", + "\n", + "def print_library_versions():\n", + " print(\"Library Versions:\")\n", + " print(f\"Streamlit: {st.__version__}\")\n", + " print(f\"Pandas: {pd.__version__}\")\n", + " print(f\"Numpy: {np.__version__}\")\n", + " print(f\"yfinance: {yf.__version__}\")\n", + " print(f\"Matplotlib: {matplotlib.__version__}\")\n", + " print(f\"PyPortfolioOpt: {pypfopt.__version__}\")\n", + " print(f\"datetime: Built-in module, version not applicable.\")\n", + "\n", + "if __name__ == \"__main__\":\n", + " print_library_versions()\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "backtest_dev", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.17" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +}