diff --git a/examples/portfolioOptimizationUsingModernPortfolioTheory.ipynb b/examples/portfolioOptimizationUsingModernPortfolioTheory.ipynb
new file mode 100644
index 000000000000..ae2e21fd1502
--- /dev/null
+++ b/examples/portfolioOptimizationUsingModernPortfolioTheory.ipynb
@@ -0,0 +1,2777 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "HRMC-0N0sSjJ"
+ },
+ "source": [
+ "## Portfolio Optimization Using Modern Portfolio Theory\n",
+ "\n",
+ "#### Description\n",
+ "This notebook utilizes OpenBB’s data for portfolio optimization based on MPT principles. We would be optimizing a portfolio of top 10 crypto assets, using the daily close data from 1st october 2023 to 1st october 2024.\n",
+ "\n",
+ "The portfolio optimization would be done using the mean-variance approach. The mean-variance approach helps determine the optimal allocation of assets in a portfolio to minimize overall risk while maximizing expected returns.\n",
+ "\n",
+ "#### Author\n",
+ "[Ambrose Ikpele](https://github.com/ambroseikpele)\n",
+ "\n",
+ "[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/OpenBB-Finance/OpenBB/blob/develop/examples/[Notebook_Name].ipynb)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Introduction"
+ ],
+ "metadata": {
+ "id": "-Ih2c6xRxklu"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "Modern Portfolio Theory (MPT) is a mathematical framework for constructing a portfolio of assets to maximize expected return based on a given level of risk. In this notebook, we will implement MPT to construct an optimal portfolio with minimum volatility using a selection of the top cryptocurrencies as our assets. The notebook will fetch historical price data for these assets, calculate the portfolio's expected return and risk, and visualize the optimal portfolio based on risk-return trade-offs."
+ ],
+ "metadata": {
+ "id": "mWd0TC0DxZm-"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "Install external packages"
+ ],
+ "metadata": {
+ "id": "_rMPfEH2KJjA"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!pip install openbb\n",
+ "!pip install PyPortfolioOpt"
+ ],
+ "metadata": {
+ "id": "iexQsZ1XvYa8"
+ },
+ "execution_count": 17,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "Import necessary packages"
+ ],
+ "metadata": {
+ "id": "CH4i_WQGRmG-"
+ }
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "id": "B8m_9BassSjK"
+ },
+ "outputs": [],
+ "source": [
+ "from openbb import obb\n",
+ "\n",
+ "import numpy as np\n",
+ "import pandas as pd\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "from pypfopt import EfficientFrontier\n",
+ "from pypfopt import CovarianceShrinkage, CLA, expected_returns"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Define the assets and fetch the data"
+ ],
+ "metadata": {
+ "id": "w3XB7egmzlmI"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "Fetch the daily data of the top crypto currencies for a period of one year using openbb"
+ ],
+ "metadata": {
+ "id": "SyF2ROKDyKdJ"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "top_crypto= ['ADA-USD', 'BNB-USD', 'BTC-USD', 'DOT-USD', 'ETH-USD', 'LTC-USD','MATIC-USD', 'SOL-USD', 'TRX-USD', 'XRP-USD']\n",
+ "\n",
+ "ohlc_data= obb.crypto.price.historical(top_crypto, provider=\"yfinance\", interval='1d', start_date='2023-10-01', end_date='2024-10-01').to_df()\n",
+ "ohlc_data"
+ ],
+ "metadata": {
+ "id": "C3UwCtY8vDaQ",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 455
+ },
+ "outputId": "fd4a3544-32f9-49c1-d7ad-bca9efa88baa"
+ },
+ "execution_count": 2,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ " open high low close \\\n",
+ "date \n",
+ "2023-10-01 0.254043 0.267471 0.254019 0.265895 \n",
+ "2023-10-01 214.800323 219.133835 213.506516 218.047134 \n",
+ "2023-10-01 26967.396484 28047.238281 26965.093750 27983.750000 \n",
+ "2023-10-01 4.105477 4.279937 4.103880 4.261009 \n",
+ "2023-10-01 1671.161499 1750.595703 1670.082153 1733.810425 \n",
+ "... ... ... ... ... \n",
+ "2024-09-30 69.314308 69.321297 66.454277 66.820450 \n",
+ "2024-09-30 0.421419 0.421627 0.394318 0.395917 \n",
+ "2024-09-30 158.632416 159.508926 152.019836 152.618469 \n",
+ "2024-09-30 0.156474 0.156746 0.154867 0.155915 \n",
+ "2024-09-30 0.641945 0.652411 0.610951 0.611492 \n",
+ "\n",
+ " volume symbol \n",
+ "date \n",
+ "2023-10-01 1.650882e+08 ADA-USD \n",
+ "2023-10-01 3.874081e+08 BNB-USD \n",
+ "2023-10-01 9.503917e+09 BTC-USD \n",
+ "2023-10-01 8.294334e+07 DOT-USD \n",
+ "2023-10-01 5.054880e+09 ETH-USD \n",
+ "... ... ... \n",
+ "2024-09-30 3.003743e+08 LTC-USD \n",
+ "2024-09-30 3.730373e+07 MATIC-USD \n",
+ "2024-09-30 2.376781e+09 SOL-USD \n",
+ "2024-09-30 3.565544e+08 TRX-USD \n",
+ "2024-09-30 2.051369e+09 XRP-USD \n",
+ "\n",
+ "[3660 rows x 6 columns]"
+ ],
+ "text/html": [
+ "\n",
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " open | \n",
+ " high | \n",
+ " low | \n",
+ " close | \n",
+ " volume | \n",
+ " symbol | \n",
+ "
\n",
+ " \n",
+ " date | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2023-10-01 | \n",
+ " 0.254043 | \n",
+ " 0.267471 | \n",
+ " 0.254019 | \n",
+ " 0.265895 | \n",
+ " 1.650882e+08 | \n",
+ " ADA-USD | \n",
+ "
\n",
+ " \n",
+ " 2023-10-01 | \n",
+ " 214.800323 | \n",
+ " 219.133835 | \n",
+ " 213.506516 | \n",
+ " 218.047134 | \n",
+ " 3.874081e+08 | \n",
+ " BNB-USD | \n",
+ "
\n",
+ " \n",
+ " 2023-10-01 | \n",
+ " 26967.396484 | \n",
+ " 28047.238281 | \n",
+ " 26965.093750 | \n",
+ " 27983.750000 | \n",
+ " 9.503917e+09 | \n",
+ " BTC-USD | \n",
+ "
\n",
+ " \n",
+ " 2023-10-01 | \n",
+ " 4.105477 | \n",
+ " 4.279937 | \n",
+ " 4.103880 | \n",
+ " 4.261009 | \n",
+ " 8.294334e+07 | \n",
+ " DOT-USD | \n",
+ "
\n",
+ " \n",
+ " 2023-10-01 | \n",
+ " 1671.161499 | \n",
+ " 1750.595703 | \n",
+ " 1670.082153 | \n",
+ " 1733.810425 | \n",
+ " 5.054880e+09 | \n",
+ " ETH-USD | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 2024-09-30 | \n",
+ " 69.314308 | \n",
+ " 69.321297 | \n",
+ " 66.454277 | \n",
+ " 66.820450 | \n",
+ " 3.003743e+08 | \n",
+ " LTC-USD | \n",
+ "
\n",
+ " \n",
+ " 2024-09-30 | \n",
+ " 0.421419 | \n",
+ " 0.421627 | \n",
+ " 0.394318 | \n",
+ " 0.395917 | \n",
+ " 3.730373e+07 | \n",
+ " MATIC-USD | \n",
+ "
\n",
+ " \n",
+ " 2024-09-30 | \n",
+ " 158.632416 | \n",
+ " 159.508926 | \n",
+ " 152.019836 | \n",
+ " 152.618469 | \n",
+ " 2.376781e+09 | \n",
+ " SOL-USD | \n",
+ "
\n",
+ " \n",
+ " 2024-09-30 | \n",
+ " 0.156474 | \n",
+ " 0.156746 | \n",
+ " 0.154867 | \n",
+ " 0.155915 | \n",
+ " 3.565544e+08 | \n",
+ " TRX-USD | \n",
+ "
\n",
+ " \n",
+ " 2024-09-30 | \n",
+ " 0.641945 | \n",
+ " 0.652411 | \n",
+ " 0.610951 | \n",
+ " 0.611492 | \n",
+ " 2.051369e+09 | \n",
+ " XRP-USD | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
3660 rows × 6 columns
\n",
+ "
\n",
+ "
\n",
+ "
\n"
+ ],
+ "application/vnd.google.colaboratory.intrinsic+json": {
+ "type": "dataframe",
+ "variable_name": "ohlc_data",
+ "summary": "{\n \"name\": \"ohlc_data\",\n \"rows\": 3660,\n \"fields\": [\n {\n \"column\": \"date\",\n \"properties\": {\n \"dtype\": \"date\",\n \"min\": \"2023-10-01\",\n \"max\": \"2024-09-30\",\n \"num_unique_values\": 366,\n \"samples\": [\n \"2024-04-11\",\n \"2023-11-03\",\n \"2023-10-16\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"open\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16639.836555374353,\n \"min\": 0.08486499637365341,\n \"max\": 73079.375,\n \"num_unique_values\": 3659,\n \"samples\": [\n 227.13491821289062,\n 0.28950101137161255,\n 0.4867730140686035\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"high\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16973.343411209262,\n \"min\": 0.08571500331163406,\n \"max\": 73750.0703125,\n \"num_unique_values\": 3660,\n \"samples\": [\n 229.19149780273438,\n 0.29728201031684875,\n 0.4899919927120209\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"low\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16300.377275687548,\n \"min\": 0.0847959965467453,\n \"max\": 71334.09375,\n \"num_unique_values\": 3655,\n \"samples\": [\n 2419.36279296875,\n 177.46127319335938,\n 0.5218260288238525\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"close\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16663.48894012965,\n \"min\": 0.08486700057983398,\n \"max\": 73083.5,\n \"num_unique_values\": 3655,\n \"samples\": [\n 2487.515625,\n 1.0434010028839111,\n 0.5468699932098389\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"volume\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 10083764369.937248,\n \"min\": 33682820.0,\n \"max\": 108991085584.0,\n \"num_unique_values\": 3660,\n \"samples\": [\n 282899321.0,\n 146280893.0,\n 385469444.0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"symbol\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"TRX-USD\",\n \"BNB-USD\",\n \"LTC-USD\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
+ }
+ },
+ "metadata": {},
+ "execution_count": 2
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "Select the close data from ohlc_data for each crypto currency"
+ ],
+ "metadata": {
+ "id": "diAUqkPi5BYe"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "close_symbol= ohlc_data[['close', 'symbol']]\n",
+ "\n",
+ "# Setting the symbol as the second index level\n",
+ "close_symbol = close_symbol.set_index('symbol', append= True)\n",
+ "\n",
+ "# Unstack 'symbol' to make each unique symbol a separate column\n",
+ "close_symbol_unstacked= close_symbol.unstack(level='symbol')\n",
+ "\n",
+ "# Flatten the column headers\n",
+ "close_symbol_unstacked.columns = close_symbol_unstacked.columns.get_level_values(1)\n",
+ "\n",
+ "prices= close_symbol_unstacked\n",
+ "\n",
+ "prices"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 455
+ },
+ "id": "PXNs59lSzMqv",
+ "outputId": "1bced258-fac0-4be7-c433-e6c08e40afd6"
+ },
+ "execution_count": 3,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "symbol ADA-USD BNB-USD BTC-USD DOT-USD ETH-USD \\\n",
+ "date \n",
+ "2023-10-01 0.265895 218.047134 27983.750000 4.261009 1733.810425 \n",
+ "2023-10-02 0.259513 214.757935 27530.785156 4.123762 1663.627563 \n",
+ "2023-10-03 0.261028 213.435944 27429.978516 4.074247 1656.685669 \n",
+ "2023-10-04 0.259315 213.413086 27799.394531 4.047316 1647.838135 \n",
+ "2023-10-05 0.260149 210.679672 27415.912109 4.022738 1611.476440 \n",
+ "... ... ... ... ... ... \n",
+ "2024-09-26 0.401882 596.776917 65181.019531 4.816284 2632.199951 \n",
+ "2024-09-27 0.402328 607.867004 65790.664062 4.892055 2695.900635 \n",
+ "2024-09-28 0.401052 601.567200 65887.648438 4.805896 2677.539062 \n",
+ "2024-09-29 0.397597 596.411194 65635.304688 4.768428 2659.346924 \n",
+ "2024-09-30 0.373214 567.260071 63329.500000 4.437086 2603.062744 \n",
+ "\n",
+ "symbol LTC-USD MATIC-USD SOL-USD TRX-USD XRP-USD \n",
+ "date \n",
+ "2023-10-01 68.233315 0.568532 23.836487 0.090118 0.524204 \n",
+ "2023-10-02 66.011124 0.547513 23.371700 0.087566 0.512832 \n",
+ "2023-10-03 65.493515 0.566308 23.552694 0.090858 0.538387 \n",
+ "2023-10-04 64.452065 0.563369 23.144787 0.088999 0.532931 \n",
+ "2023-10-05 64.858765 0.546018 22.694141 0.088276 0.523366 \n",
+ "... ... ... ... ... ... \n",
+ "2024-09-26 68.518311 0.424973 155.576096 0.153201 0.590421 \n",
+ "2024-09-27 71.188202 0.433774 157.749939 0.155170 0.588927 \n",
+ "2024-09-28 70.003967 0.423559 156.912430 0.155068 0.614801 \n",
+ "2024-09-29 69.314423 0.421419 158.629166 0.156474 0.641947 \n",
+ "2024-09-30 66.820450 0.395917 152.618469 0.155915 0.611492 \n",
+ "\n",
+ "[366 rows x 10 columns]"
+ ],
+ "text/html": [
+ "\n",
+ " \n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " symbol | \n",
+ " ADA-USD | \n",
+ " BNB-USD | \n",
+ " BTC-USD | \n",
+ " DOT-USD | \n",
+ " ETH-USD | \n",
+ " LTC-USD | \n",
+ " MATIC-USD | \n",
+ " SOL-USD | \n",
+ " TRX-USD | \n",
+ " XRP-USD | \n",
+ "
\n",
+ " \n",
+ " date | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2023-10-01 | \n",
+ " 0.265895 | \n",
+ " 218.047134 | \n",
+ " 27983.750000 | \n",
+ " 4.261009 | \n",
+ " 1733.810425 | \n",
+ " 68.233315 | \n",
+ " 0.568532 | \n",
+ " 23.836487 | \n",
+ " 0.090118 | \n",
+ " 0.524204 | \n",
+ "
\n",
+ " \n",
+ " 2023-10-02 | \n",
+ " 0.259513 | \n",
+ " 214.757935 | \n",
+ " 27530.785156 | \n",
+ " 4.123762 | \n",
+ " 1663.627563 | \n",
+ " 66.011124 | \n",
+ " 0.547513 | \n",
+ " 23.371700 | \n",
+ " 0.087566 | \n",
+ " 0.512832 | \n",
+ "
\n",
+ " \n",
+ " 2023-10-03 | \n",
+ " 0.261028 | \n",
+ " 213.435944 | \n",
+ " 27429.978516 | \n",
+ " 4.074247 | \n",
+ " 1656.685669 | \n",
+ " 65.493515 | \n",
+ " 0.566308 | \n",
+ " 23.552694 | \n",
+ " 0.090858 | \n",
+ " 0.538387 | \n",
+ "
\n",
+ " \n",
+ " 2023-10-04 | \n",
+ " 0.259315 | \n",
+ " 213.413086 | \n",
+ " 27799.394531 | \n",
+ " 4.047316 | \n",
+ " 1647.838135 | \n",
+ " 64.452065 | \n",
+ " 0.563369 | \n",
+ " 23.144787 | \n",
+ " 0.088999 | \n",
+ " 0.532931 | \n",
+ "
\n",
+ " \n",
+ " 2023-10-05 | \n",
+ " 0.260149 | \n",
+ " 210.679672 | \n",
+ " 27415.912109 | \n",
+ " 4.022738 | \n",
+ " 1611.476440 | \n",
+ " 64.858765 | \n",
+ " 0.546018 | \n",
+ " 22.694141 | \n",
+ " 0.088276 | \n",
+ " 0.523366 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 2024-09-26 | \n",
+ " 0.401882 | \n",
+ " 596.776917 | \n",
+ " 65181.019531 | \n",
+ " 4.816284 | \n",
+ " 2632.199951 | \n",
+ " 68.518311 | \n",
+ " 0.424973 | \n",
+ " 155.576096 | \n",
+ " 0.153201 | \n",
+ " 0.590421 | \n",
+ "
\n",
+ " \n",
+ " 2024-09-27 | \n",
+ " 0.402328 | \n",
+ " 607.867004 | \n",
+ " 65790.664062 | \n",
+ " 4.892055 | \n",
+ " 2695.900635 | \n",
+ " 71.188202 | \n",
+ " 0.433774 | \n",
+ " 157.749939 | \n",
+ " 0.155170 | \n",
+ " 0.588927 | \n",
+ "
\n",
+ " \n",
+ " 2024-09-28 | \n",
+ " 0.401052 | \n",
+ " 601.567200 | \n",
+ " 65887.648438 | \n",
+ " 4.805896 | \n",
+ " 2677.539062 | \n",
+ " 70.003967 | \n",
+ " 0.423559 | \n",
+ " 156.912430 | \n",
+ " 0.155068 | \n",
+ " 0.614801 | \n",
+ "
\n",
+ " \n",
+ " 2024-09-29 | \n",
+ " 0.397597 | \n",
+ " 596.411194 | \n",
+ " 65635.304688 | \n",
+ " 4.768428 | \n",
+ " 2659.346924 | \n",
+ " 69.314423 | \n",
+ " 0.421419 | \n",
+ " 158.629166 | \n",
+ " 0.156474 | \n",
+ " 0.641947 | \n",
+ "
\n",
+ " \n",
+ " 2024-09-30 | \n",
+ " 0.373214 | \n",
+ " 567.260071 | \n",
+ " 63329.500000 | \n",
+ " 4.437086 | \n",
+ " 2603.062744 | \n",
+ " 66.820450 | \n",
+ " 0.395917 | \n",
+ " 152.618469 | \n",
+ " 0.155915 | \n",
+ " 0.611492 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
366 rows × 10 columns
\n",
+ "
\n",
+ "
\n",
+ "
\n"
+ ],
+ "application/vnd.google.colaboratory.intrinsic+json": {
+ "type": "dataframe",
+ "variable_name": "close_symbol_unstacked",
+ "summary": "{\n \"name\": \"close_symbol_unstacked\",\n \"rows\": 366,\n \"fields\": [\n {\n \"column\": \"date\",\n \"properties\": {\n \"dtype\": \"date\",\n \"min\": \"2023-10-01\",\n \"max\": \"2024-09-30\",\n \"num_unique_values\": 366,\n \"samples\": [\n \"2024-04-11\",\n \"2023-11-03\",\n \"2023-10-16\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"ADA-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.12241864696655712,\n \"min\": 0.2434529960155487,\n \"max\": 0.7741900086402893,\n \"num_unique_values\": 365,\n \"samples\": [\n 0.5035750269889832,\n 0.32902100682258606,\n 0.25156301259994507\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"BNB-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 152.5214407182818,\n \"min\": 205.2294158935547,\n \"max\": 710.4640502929688,\n \"num_unique_values\": 366,\n \"samples\": [\n 604.893798828125,\n 230.60597229003906,\n 214.82395935058594\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"BTC-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 13053.33386869586,\n \"min\": 26756.798828125,\n \"max\": 73083.5,\n \"num_unique_values\": 366,\n \"samples\": [\n 70060.609375,\n 34732.32421875,\n 28519.466796875\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"DOT-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1.71868220447839,\n \"min\": 3.6488780975341797,\n \"max\": 11.542901992797852,\n \"num_unique_values\": 366,\n \"samples\": [\n 8.379441261291504,\n 4.6154937744140625,\n 3.7862110137939453\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"ETH-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 645.7801836761455,\n \"min\": 1539.6124267578125,\n \"max\": 4066.445068359375,\n \"num_unique_values\": 366,\n \"samples\": [\n 3505.247802734375,\n 1832.795166015625,\n 1600.5343017578125\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"LTC-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 9.82303289832029,\n \"min\": 55.983909606933594,\n \"max\": 109.25897216796875,\n \"num_unique_values\": 366,\n \"samples\": [\n 98.68910217285156,\n 69.49114227294922,\n 63.337162017822266\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"MATIC-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.20641913692628033,\n \"min\": 0.3659299910068512,\n \"max\": 1.2714049816131592,\n \"num_unique_values\": 366,\n \"samples\": [\n 0.8783450126647949,\n 0.6719430088996887,\n 0.5341209769248962\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"SOL-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 46.98292860601651,\n \"min\": 21.300268173217773,\n \"max\": 202.87413024902344,\n \"num_unique_values\": 366,\n \"samples\": [\n 172.5763702392578,\n 39.51976013183594,\n 23.98295783996582\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"TRX-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.018051530692952913,\n \"min\": 0.08486700057983398,\n \"max\": 0.16655699908733368,\n \"num_unique_values\": 362,\n \"samples\": [\n 0.13199299573898315,\n 0.09731300175189972,\n 0.08891399949789047\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"XRP-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.05616593942864053,\n \"min\": 0.4198229908943176,\n \"max\": 0.7180359959602356,\n \"num_unique_values\": 366,\n \"samples\": [\n 0.6088799834251404,\n 0.6130020022392273,\n 0.49797698855400085\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
+ }
+ },
+ "metadata": {},
+ "execution_count": 3
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Calculate Portfolio's Expected Returns"
+ ],
+ "metadata": {
+ "id": "PbL5KdtRyn9C"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "The expected returns serve as the basis for evaluating different asset combinations and determining the optimal portfolio allocation. In the next steps, these returns will be used along with the covariance matrix to analyze risk-return profiles."
+ ],
+ "metadata": {
+ "id": "i-IM_cAUywwL"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "$$return=\\frac{Σ\\space r_{i}}{N}⋅365$$\n",
+ "\n",
+ "where $r_i$ is the daily return of a particular asset and $N$ is the number of days in the data, we multiply by 365 so as to annualize the result"
+ ],
+ "metadata": {
+ "id": "Ktrk_3fHbmS2"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# Expected returns of crypto assets using the mean historical return.\n",
+ "assets_expected_returns = expected_returns.mean_historical_return(prices, frequency=365, compounding=False)\n",
+ "assets_expected_returns"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 429
+ },
+ "id": "Mx_MLbe4mxfa",
+ "outputId": "310d6922-1a13-458e-b5a3-a066f4ddc7f6"
+ },
+ "execution_count": 4,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "symbol\n",
+ "ADA-USD 0.604022\n",
+ "BNB-USD 1.121563\n",
+ "BTC-USD 0.952337\n",
+ "DOT-USD 0.319752\n",
+ "ETH-USD 0.591286\n",
+ "LTC-USD 0.173647\n",
+ "MATIC-USD -0.058596\n",
+ "SOL-USD 2.288214\n",
+ "TRX-USD 0.616572\n",
+ "XRP-USD 0.344980\n",
+ "dtype: float64"
+ ],
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " symbol | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " ADA-USD | \n",
+ " 0.604022 | \n",
+ "
\n",
+ " \n",
+ " BNB-USD | \n",
+ " 1.121563 | \n",
+ "
\n",
+ " \n",
+ " BTC-USD | \n",
+ " 0.952337 | \n",
+ "
\n",
+ " \n",
+ " DOT-USD | \n",
+ " 0.319752 | \n",
+ "
\n",
+ " \n",
+ " ETH-USD | \n",
+ " 0.591286 | \n",
+ "
\n",
+ " \n",
+ " LTC-USD | \n",
+ " 0.173647 | \n",
+ "
\n",
+ " \n",
+ " MATIC-USD | \n",
+ " -0.058596 | \n",
+ "
\n",
+ " \n",
+ " SOL-USD | \n",
+ " 2.288214 | \n",
+ "
\n",
+ " \n",
+ " TRX-USD | \n",
+ " 0.616572 | \n",
+ "
\n",
+ " \n",
+ " XRP-USD | \n",
+ " 0.344980 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 4
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "The frequency parameter indicates the number of trading periods in a year. For crypto daily data, it is set to 365, since crypto can be traded everyday.\n",
+ "\n",
+ "The compounding parameter calculate returns using simple or compounded growth. Setting compounding=False results in simple annualized returns. If compounding=True, the function would compute geometric (compounded) returns, which consider reinvested returns over time."
+ ],
+ "metadata": {
+ "id": "eBDVKkQZ2Wx3"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Calculate the Covariance Matrix Using the Ledoit-Wolf Shrinkage Estimator"
+ ],
+ "metadata": {
+ "id": "1gvka-on5JDC"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "The covariance matrix represents the relationship between the returns of the assets. It measures how returns of one asset(e.g btc) vary in relation to another(e.g eth), which is essential for understanding the overall risk of a portfolio. Assets with high positive covariance tend to move in the same direction, while those with negative covariance move in opposite directions."
+ ],
+ "metadata": {
+ "id": "fT9f1AWN5l1L"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "The formula below uses an example of btc and eth to express how covariance is calculated:\n",
+ "\n",
+ "$$Cov({r_{btc}, r_{eth} })= \\frac{Σ(r_{btc}-\\bar r_{btc})(r_{eth}-\\bar r_{eth})}{N}$$\n",
+ "\n",
+ "Where $r$ is the daily returns of the assets and $\\bar r$ is the average daily returns of the assets."
+ ],
+ "metadata": {
+ "id": "69Uyh-rPUWD3"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# Covariance matrix of crypto assets using the Ledoit-Wolf shrinkage method.\n",
+ "covariance = CovarianceShrinkage(prices).ledoit_wolf()\n",
+ "covariance"
+ ],
+ "metadata": {
+ "id": "S_sH-1sq6bnI",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 394
+ },
+ "outputId": "c1e9855e-c6c7-4dbd-8f66-50ec26743425"
+ },
+ "execution_count": 5,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "symbol ADA-USD BNB-USD BTC-USD DOT-USD ETH-USD LTC-USD \\\n",
+ "symbol \n",
+ "ADA-USD 0.366706 0.150286 0.180182 0.304589 0.203891 0.205121 \n",
+ "BNB-USD 0.150286 0.231405 0.122723 0.150846 0.139246 0.109135 \n",
+ "BTC-USD 0.180182 0.122723 0.190093 0.176476 0.172781 0.127462 \n",
+ "DOT-USD 0.304589 0.150846 0.176476 0.386458 0.207296 0.193352 \n",
+ "ETH-USD 0.203891 0.139246 0.172781 0.207296 0.259972 0.160428 \n",
+ "LTC-USD 0.205121 0.109135 0.127462 0.193352 0.160428 0.270809 \n",
+ "MATIC-USD 0.278896 0.173927 0.170640 0.288592 0.225087 0.191384 \n",
+ "SOL-USD 0.297128 0.172109 0.222148 0.333958 0.232898 0.191960 \n",
+ "TRX-USD 0.083817 0.047007 0.055094 0.086146 0.063453 0.055784 \n",
+ "XRP-USD 0.194349 0.093584 0.120736 0.192491 0.133452 0.158367 \n",
+ "\n",
+ "symbol MATIC-USD SOL-USD TRX-USD XRP-USD \n",
+ "symbol \n",
+ "ADA-USD 0.278896 0.297128 0.083817 0.194349 \n",
+ "BNB-USD 0.173927 0.172109 0.047007 0.093584 \n",
+ "BTC-USD 0.170640 0.222148 0.055094 0.120736 \n",
+ "DOT-USD 0.288592 0.333958 0.086146 0.192491 \n",
+ "ETH-USD 0.225087 0.232898 0.063453 0.133452 \n",
+ "LTC-USD 0.191384 0.191960 0.055784 0.158367 \n",
+ "MATIC-USD 0.415755 0.290945 0.075620 0.181063 \n",
+ "SOL-USD 0.290945 0.595302 0.095612 0.185187 \n",
+ "TRX-USD 0.075620 0.095612 0.098694 0.057615 \n",
+ "XRP-USD 0.181063 0.185187 0.057615 0.267912 "
+ ],
+ "text/html": [
+ "\n",
+ " \n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " symbol | \n",
+ " ADA-USD | \n",
+ " BNB-USD | \n",
+ " BTC-USD | \n",
+ " DOT-USD | \n",
+ " ETH-USD | \n",
+ " LTC-USD | \n",
+ " MATIC-USD | \n",
+ " SOL-USD | \n",
+ " TRX-USD | \n",
+ " XRP-USD | \n",
+ "
\n",
+ " \n",
+ " symbol | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " ADA-USD | \n",
+ " 0.366706 | \n",
+ " 0.150286 | \n",
+ " 0.180182 | \n",
+ " 0.304589 | \n",
+ " 0.203891 | \n",
+ " 0.205121 | \n",
+ " 0.278896 | \n",
+ " 0.297128 | \n",
+ " 0.083817 | \n",
+ " 0.194349 | \n",
+ "
\n",
+ " \n",
+ " BNB-USD | \n",
+ " 0.150286 | \n",
+ " 0.231405 | \n",
+ " 0.122723 | \n",
+ " 0.150846 | \n",
+ " 0.139246 | \n",
+ " 0.109135 | \n",
+ " 0.173927 | \n",
+ " 0.172109 | \n",
+ " 0.047007 | \n",
+ " 0.093584 | \n",
+ "
\n",
+ " \n",
+ " BTC-USD | \n",
+ " 0.180182 | \n",
+ " 0.122723 | \n",
+ " 0.190093 | \n",
+ " 0.176476 | \n",
+ " 0.172781 | \n",
+ " 0.127462 | \n",
+ " 0.170640 | \n",
+ " 0.222148 | \n",
+ " 0.055094 | \n",
+ " 0.120736 | \n",
+ "
\n",
+ " \n",
+ " DOT-USD | \n",
+ " 0.304589 | \n",
+ " 0.150846 | \n",
+ " 0.176476 | \n",
+ " 0.386458 | \n",
+ " 0.207296 | \n",
+ " 0.193352 | \n",
+ " 0.288592 | \n",
+ " 0.333958 | \n",
+ " 0.086146 | \n",
+ " 0.192491 | \n",
+ "
\n",
+ " \n",
+ " ETH-USD | \n",
+ " 0.203891 | \n",
+ " 0.139246 | \n",
+ " 0.172781 | \n",
+ " 0.207296 | \n",
+ " 0.259972 | \n",
+ " 0.160428 | \n",
+ " 0.225087 | \n",
+ " 0.232898 | \n",
+ " 0.063453 | \n",
+ " 0.133452 | \n",
+ "
\n",
+ " \n",
+ " LTC-USD | \n",
+ " 0.205121 | \n",
+ " 0.109135 | \n",
+ " 0.127462 | \n",
+ " 0.193352 | \n",
+ " 0.160428 | \n",
+ " 0.270809 | \n",
+ " 0.191384 | \n",
+ " 0.191960 | \n",
+ " 0.055784 | \n",
+ " 0.158367 | \n",
+ "
\n",
+ " \n",
+ " MATIC-USD | \n",
+ " 0.278896 | \n",
+ " 0.173927 | \n",
+ " 0.170640 | \n",
+ " 0.288592 | \n",
+ " 0.225087 | \n",
+ " 0.191384 | \n",
+ " 0.415755 | \n",
+ " 0.290945 | \n",
+ " 0.075620 | \n",
+ " 0.181063 | \n",
+ "
\n",
+ " \n",
+ " SOL-USD | \n",
+ " 0.297128 | \n",
+ " 0.172109 | \n",
+ " 0.222148 | \n",
+ " 0.333958 | \n",
+ " 0.232898 | \n",
+ " 0.191960 | \n",
+ " 0.290945 | \n",
+ " 0.595302 | \n",
+ " 0.095612 | \n",
+ " 0.185187 | \n",
+ "
\n",
+ " \n",
+ " TRX-USD | \n",
+ " 0.083817 | \n",
+ " 0.047007 | \n",
+ " 0.055094 | \n",
+ " 0.086146 | \n",
+ " 0.063453 | \n",
+ " 0.055784 | \n",
+ " 0.075620 | \n",
+ " 0.095612 | \n",
+ " 0.098694 | \n",
+ " 0.057615 | \n",
+ "
\n",
+ " \n",
+ " XRP-USD | \n",
+ " 0.194349 | \n",
+ " 0.093584 | \n",
+ " 0.120736 | \n",
+ " 0.192491 | \n",
+ " 0.133452 | \n",
+ " 0.158367 | \n",
+ " 0.181063 | \n",
+ " 0.185187 | \n",
+ " 0.057615 | \n",
+ " 0.267912 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
\n"
+ ],
+ "application/vnd.google.colaboratory.intrinsic+json": {
+ "type": "dataframe",
+ "variable_name": "covariance",
+ "summary": "{\n \"name\": \"covariance\",\n \"rows\": 10,\n \"fields\": [\n {\n \"column\": \"symbol\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"TRX-USD\",\n \"BNB-USD\",\n \"LTC-USD\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"ADA-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.08419792941723192,\n \"min\": 0.0838165711742476,\n \"max\": 0.36670604147106206,\n \"num_unique_values\": 10,\n \"samples\": [\n 0.0838165711742476,\n 0.15028626508263157,\n 0.20512138740953018\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"BNB-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.05033753143602621,\n \"min\": 0.047006792196747846,\n \"max\": 0.2314051405350048,\n \"num_unique_values\": 10,\n \"samples\": [\n 0.047006792196747846,\n 0.2314051405350048,\n 0.1091350550550174\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"BTC-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.04753744415710665,\n \"min\": 0.05509418774013776,\n \"max\": 0.22214831696745932,\n \"num_unique_values\": 10,\n \"samples\": [\n 0.05509418774013776,\n 0.12272305327668202,\n 0.1274618190134865\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"DOT-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.09269535390671813,\n \"min\": 0.08614584593812935,\n \"max\": 0.3864581165922623,\n \"num_unique_values\": 10,\n \"samples\": [\n 0.08614584593812935,\n 0.15084590749143012,\n 0.19335241933484426\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"ETH-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.05810745048757783,\n \"min\": 0.06345275246548801,\n \"max\": 0.25997209569152796,\n \"num_unique_values\": 10,\n \"samples\": [\n 0.06345275246548801,\n 0.139245809134133,\n 0.16042795625973533\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"LTC-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.05919478941890474,\n \"min\": 0.05578366873261023,\n \"max\": 0.27080940309104257,\n \"num_unique_values\": 10,\n \"samples\": [\n 0.05578366873261023,\n 0.1091350550550174,\n 0.27080940309104257\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"MATIC-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.09336165890150132,\n \"min\": 0.07561993114423143,\n \"max\": 0.4157545421078801,\n \"num_unique_values\": 10,\n \"samples\": [\n 0.07561993114423143,\n 0.17392703381920863,\n 0.1913835647642417\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"SOL-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.1363595110476115,\n \"min\": 0.09561239112443014,\n \"max\": 0.5953019208397278,\n \"num_unique_values\": 10,\n \"samples\": [\n 0.09561239112443014,\n 0.17210936103624314,\n 0.1919600059080584\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"TRX-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.01848799121692438,\n \"min\": 0.047006792196747846,\n \"max\": 0.09869415860549288,\n \"num_unique_values\": 10,\n \"samples\": [\n 0.09869415860549288,\n 0.047006792196747846,\n 0.05578366873261023\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"XRP-USD\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0.05970145542480502,\n \"min\": 0.057614883985101284,\n \"max\": 0.2679123979532293,\n \"num_unique_values\": 10,\n \"samples\": [\n 0.057614883985101284,\n 0.09358410593039336,\n 0.15836736522902278\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
+ }
+ },
+ "metadata": {},
+ "execution_count": 5
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "**Ledoit-Wolf Shrinkage**:is a technique used to improve the estimation of covariance matrices, especially when dealing with high-dimensional data (like multiple crypto assets) relative to the number of observations."
+ ],
+ "metadata": {
+ "id": "91CYiL0a6XaY"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Portfolio Optimization using Critical Line Algorithm (CLA)"
+ ],
+ "metadata": {
+ "id": "apy1KgWNPBew"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "Portfolio risk, also known as portfolio volatility, is determined by calculating the variance of the returns of the assets. The variance is calculated using the below equation:\n",
+ "\n",
+ "$$ \\sigma^2= W⋅Cov⋅W^T $$\n",
+ "\n",
+ "Where $W$ is the weights of the asstes and $Cov$ is the covariance of the returns of the assets in the portfolio."
+ ],
+ "metadata": {
+ "id": "rBxNCT2b6oCH"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "**The Critical Line Algorithm (CLA)** optimizes asset weights in a portfolio by calculating the risk and expected return for various combinations of these weights. It systematically varies the weights assigned to each asset, assessing how each combination affects overall portfolio performance. This process helps identify efficient portfolios that maximize expected returns for a given level of risk or minimize risk for a desired return."
+ ],
+ "metadata": {
+ "id": "xgfgtZldOGE6"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# Create a Critical Line Algorithm (CLA) object using the calculated expected returns and covariance matrix.\n",
+ "cla = CLA(assets_expected_returns, covariance)"
+ ],
+ "metadata": {
+ "id": "NarHAjA25b61"
+ },
+ "execution_count": 6,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "**The Efficient Frontier** is a curve showing optimal portfolios with the best risk-return tradeoffs. It's important because it helps us identify portfolios that maximize return for a given risk level or minimize risk for a desired return."
+ ],
+ "metadata": {
+ "id": "Cgz_DmDcPXpN"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# Calculate the efficient frontier, obtaining the returns, volatility, and weights for various portfolios.\n",
+ "(returns, volatility, weights) = cla.efficient_frontier()\n",
+ "\n",
+ "efficient_frontier_portfolios= pd.DataFrame([returns, volatility, weights]).T\n",
+ "efficient_frontier_portfolios.columns=['returns', 'volatility', 'weights']\n",
+ "\n",
+ "efficient_frontier_portfolios"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 424
+ },
+ "id": "VMD3zD-p9AfE",
+ "outputId": "c43b28ee-757d-447a-f128-6cda567b1b1b"
+ },
+ "execution_count": 7,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ " returns volatility weights\n",
+ "0 2.288214 0.771558 [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0....\n",
+ "1 2.288214 0.771558 [[0.0], [8.540177112501205e-18], [0.0], [0.0],...\n",
+ "2 2.288214 0.771558 [[0.0], [1.708035422500241e-17], [0.0], [0.0],...\n",
+ "3 2.288214 0.771558 [[0.0], [2.5620531337503614e-17], [0.0], [0.0]...\n",
+ "4 2.288214 0.771558 [[0.0], [3.416070845000482e-17], [0.0], [0.0],...\n",
+ ".. ... ... ...\n",
+ "74 0.699686 0.289411 [[0.0], [0.14064237710852637], [0.110488877515...\n",
+ "75 0.695988 0.289372 [[0.0], [0.1384244599412712], [0.1077026598376...\n",
+ "76 0.692291 0.289344 [[0.0], [0.136206542774016], [0.10491644215937...\n",
+ "77 0.688593 0.289328 [[0.0], [0.1339886256067608], [0.1021302244811...\n",
+ "78 0.684895 0.289322 [[0.0], [0.1317707084395056], [0.0993440068028...\n",
+ "\n",
+ "[79 rows x 3 columns]"
+ ],
+ "text/html": [
+ "\n",
+ " \n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " returns | \n",
+ " volatility | \n",
+ " weights | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " 2.288214 | \n",
+ " 0.771558 | \n",
+ " [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.... | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " 2.288214 | \n",
+ " 0.771558 | \n",
+ " [[0.0], [8.540177112501205e-18], [0.0], [0.0],... | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " 2.288214 | \n",
+ " 0.771558 | \n",
+ " [[0.0], [1.708035422500241e-17], [0.0], [0.0],... | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " 2.288214 | \n",
+ " 0.771558 | \n",
+ " [[0.0], [2.5620531337503614e-17], [0.0], [0.0]... | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " 2.288214 | \n",
+ " 0.771558 | \n",
+ " [[0.0], [3.416070845000482e-17], [0.0], [0.0],... | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 74 | \n",
+ " 0.699686 | \n",
+ " 0.289411 | \n",
+ " [[0.0], [0.14064237710852637], [0.110488877515... | \n",
+ "
\n",
+ " \n",
+ " 75 | \n",
+ " 0.695988 | \n",
+ " 0.289372 | \n",
+ " [[0.0], [0.1384244599412712], [0.1077026598376... | \n",
+ "
\n",
+ " \n",
+ " 76 | \n",
+ " 0.692291 | \n",
+ " 0.289344 | \n",
+ " [[0.0], [0.136206542774016], [0.10491644215937... | \n",
+ "
\n",
+ " \n",
+ " 77 | \n",
+ " 0.688593 | \n",
+ " 0.289328 | \n",
+ " [[0.0], [0.1339886256067608], [0.1021302244811... | \n",
+ "
\n",
+ " \n",
+ " 78 | \n",
+ " 0.684895 | \n",
+ " 0.289322 | \n",
+ " [[0.0], [0.1317707084395056], [0.0993440068028... | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
79 rows × 3 columns
\n",
+ "
\n",
+ "
\n",
+ "
\n"
+ ],
+ "application/vnd.google.colaboratory.intrinsic+json": {
+ "type": "dataframe",
+ "variable_name": "efficient_frontier_portfolios",
+ "summary": "{\n \"name\": \"efficient_frontier_portfolios\",\n \"rows\": 79,\n \"fields\": [\n {\n \"column\": \"returns\",\n \"properties\": {\n \"dtype\": \"date\",\n \"min\": 0.6848950166508636,\n \"max\": 2.2882141236911924,\n \"num_unique_values\": 66,\n \"samples\": [\n 0.72557090559056,\n 0.6959884409071444,\n 2.2882141236911924\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"volatility\",\n \"properties\": {\n \"dtype\": \"date\",\n \"min\": 0.2893221746578987,\n \"max\": 0.7715581124191021,\n \"num_unique_values\": 66,\n \"samples\": [\n 0.28999332370675096,\n 0.2893721484198184,\n 0.7715581124191021\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"weights\",\n \"properties\": {\n \"dtype\": \"object\",\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
+ }
+ },
+ "metadata": {},
+ "execution_count": 7
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "### Visualize the efficient frontier"
+ ],
+ "metadata": {
+ "id": "AaQTTEhZ70e7"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "plt.figure(figsize=(10,5))\n",
+ "plt.scatter(volatility, returns, label='Portfolios on efficient frontier')\n",
+ "plt.legend()\n",
+ "plt.ylabel('Expected Reward')\n",
+ "plt.xlabel('Volatiity')\n",
+ "plt.show()"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 465
+ },
+ "id": "Kt1n-3HQ1gj7",
+ "outputId": "686d5698-8806-4c7e-ba07-46b26d76add0"
+ },
+ "execution_count": 8,
+ "outputs": [
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ ""
+ ],
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAA04AAAHACAYAAACVhTgAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABUGklEQVR4nO3de1yUdf7//+cAclBhFBNBxSTtIOEBdTE1SytTa1n71K52UPNQraaV2dFtk+gg2Wmtb2VrmVZmlq1ZlouZ5Yks8oCJlClimg2eqAF0QZ2Z3x/8mETAmYE5wuN+u83t5ly8r5nX4BXx8v2+nm+DzWazCQAAAABQqyBfFwAAAAAA/o7GCQAAAAAcoHECAAAAAAdonAAAAADAARonAAAAAHCAxgkAAAAAHK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n7+EydOsF8TAAA+kPdLsdPj/HnZHkv1PCAz16RLZ32pm17/RvcsztFNr3+jS2d9qcxck0ffNywsTLGxsTr33HM1adIkXXXVVfrkk08kSb/99pvGjBmjli1bqmnTpho2bJh27dplP3fBggVq0aKFPvnkEyUmJiosLEzjx4/XW2+9pY8//lgGg0EGg8G+ZGzz5s16/PHHZTAY9Nhjj0mStm/friuuuEIRERFq1aqV7rjjDpWWltZa75lL1RzV+PPPPys1NVUtW7ZUs2bNdPHFF2vFihW1vr6zn3nlypXq0qWLmjdvrqFDh8pkOvvfU25uroYNG6bmzZurTZs2Gj16tI4cOSKpYoburrvu0r59+2QwGNSxY8caj9X0+cvLy/XQQw8pPj5eYWFh6ty5s+bNmyep5qV6GzZs0IABAxQREaH4+HjdfffdOnbsmP3rHTt21MyZMzV+/HhFRkaqQ4cOmjt3rv3rCQkJkqTk5GQZDAYNHDiw2mfdu3evDAaDjh49qvHjx8tgMNhnzgwGg/773/+qV69eCgsL04YNG1ReXq67775bMTExCg8P16WXXqrvvvvO/nqV561evVq9e/dW06ZN1a9fP+3cudP+d5Kenq5t27bZr7kFCxZIqr5Ub//+/RoxYoRatGih6OhoDR8+XHv37rV/vXJp6FNPPaW2bdvqwgsvPOvfKwAA8Iw/v7zereN8hcbJzTJzTZq0cItM5rIqxwvNZZq0cIvHm6fTRURE6MSJE5IqfonctGmTPvnkE23cuFE2m03XXHONTp48aR9//PhxzZo1S2+88YZ27Nihl156SSNGjLA3EyaTyb5k7OKLL9Z9990nk8mk+++/X8eOHdOQIUPUsmVLfffdd1qyZIm++OILTZkyxel6HdU4efJklZeXa926ddq+fbtmzZp11mVjzn7m5557Tu+8847WrVunffv26f7776/1NX///XddccUVSk5O1qZNm5SZmamDBw9qxIgRkqQXX3xRjz/+uNq3by+TyaTvvvuuxmM1GTNmjN577z299NJL+uGHH/Tvf/+71s+Xn5+voUOH6oYbbtD333+v999/Xxs2bKj2/X7++efVu3dvbd26VXfeeacmTZpkb1Kys7MlSV988Y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309ddfKzEx0VcfAX7A1esoPj5eK1eu1L333qtu3bqpXbt2uueee/TQQw/56iPAT9Tl/207d+7Uhg0b9Pnnn/uiZDQABpvNZvN1EQAAAADgz/hnZgAAAABwgMYJAAAAABygcQIAAAAAB2icAAAAAMABGicAAAAAcIDGCQAAAAAcoHECAAAAAAdonAAADUrHjh01e/Zst7+OwWDQsmXL6v26AIDAROMEAPAbqampGjp0aI1fW79+vQwGg77//nu3vueCBQvUokWLase/++473XHHHfbnJpNJw4YNkyTt3btXBoNBOTk5bq0FAOC/aJwAAH5jwoQJWrVqlX755ZdqX5s/f7569+6tbt26eaWW1q1bq2nTpvbnsbGxCgsL88p7AwD8D40TAMBv/PnPf1br1q21YMGCKsdLS0u1ZMkSTZgwQf/5z3908cUXKywsTB07dtTzzz9/1td84YUX1LVrVzVr1kzx8fG68847VVpaKklas2aNxo0bJ7PZLIPBIIPBoMcee0zS2ZfqJSQkSJKSk5NlMBg0cOBArVu3Tk2aNFFhYWGV9586daoGDBhQ928KAMAv0DgBAPxGSEiIxowZowULFshms9mPL1myRBaLRV26dNGIESN04403avv27Xrsscf06KOPVmu0ThcUFKSXXnpJO3bs0FtvvaUvv/xSDz74oCSpX79+mj17tqKiomQymWQymXT//fc7rDM7O1uS9MUXX8hkMmnp0qW67LLLdN555+mdd96xjzt58qTeffddjR8/vo7fEQCAv6BxAgD4lfHjxys/P19r1661H5s/f75uuOEGzZ07V1deeaUeffRRXXDBBRo7dqymTJmiZ599ttbXmzp1qgYNGqSOHTvqiiuu0JNPPqkPPvhAkhQaGiqj0SiDwaDY2FjFxsaqefPmDmts3bq1JKlVq1aKjY1VdHS0pIqlhvPnz7ePW758ucrKyjRixIg6fS8AAP6DxgkA4Fcuuugi9evXT2+++aYkaffu3Vq/fr0mTJigH374Qf37968yvn///tq1a5csFkuNr/fFF1/oyiuvVLt27RQZGanRo0fr6NGjOn78uNtrHzt2rHbv3q1vvvlGUkXwxIgRI9SsWTO3vxcAwLtonAAAfqfyXqaSkhLNnz9fnTp10uWXX+7y6+zdu1d//vOf1a1bN/3nP//R5s2b9corr0iSTpw44e6yFRMTo9TUVM2fP18HDx7Uf//7X5bpAUADQeMEAPA7I0aMUFBQkBYtWqS3335b48ePl8FgUJcuXZSVlVVlbFZWli644AIFBwdXe53NmzfLarXq+eef1yWXXKILLrhAv/76a5UxoaGhtc5W1SY0NFSSajzvtttu0/vvv6+5c+eqU6dO1WbIAACBicYJAOB3mjdvrpEjR2r69OkymUwaO3asJOm+++7T6tWr9cQTT+inn37SW2+9pZdffrnWQIfOnTvr5MmT+n//7/9pz549euedd/Taa69VGdOxY0eVlpZq9erVOnLkiFNL+GJiYhQREaHMzEwdPHhQZrPZ/rUhQ4YoKipKTz75pMaNG1f3bwIAwK/QOAEA/NKECRP022+/aciQIWrbtq0kqWfPnvrggw+0ePFiJSUlacaMGXr88cftjdWZunfvrhdeeEGzZs1SUlKS3n33XWVkZFQZ069fP02cOFEjR45U69at9cwzzzisLSQkRC+99JL+/e9/q23btho+fLj9a0FBQRo7dqwsFovGjBlT928AAMCvGGyn570CAIB6mzBhgg4fPqxPPvnE16UAANwkxNcFAADQUJjNZm3fvl2LFi2iaQKABobGCQAANxk+fLiys7M1ceJEDR482NflAADciKV6AAAAAOAA4RAAAAAA4ACNEwAAAAA4QOMEAAAAAA7QOAEAAACAAzROAAAAAOAAjRMAAAAAOEDjBAAAAAAO0DgBAAAAgAM0TgAAAADgwP8HilfyNTSmaHQAAAAASUVORK5CYII=\n"
+ },
+ "metadata": {}
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "Get the weights (in perentage) of the portfolio with the lowest volatility"
+ ],
+ "metadata": {
+ "id": "v4jE07br-DEJ"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "optimized_weight=np.array(list(cla.max_sharpe().values()))\n",
+ "optimized_weight= np.round(optimized_weight, 4)\n",
+ "\n",
+ "pie_df=pd.DataFrame(optimized_weight*100, index=prices.columns, columns=['weights'])\n",
+ "pie_df= pie_df.sort_values(by=['weights'], ascending=False)\n",
+ "pie_df"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 394
+ },
+ "id": "FzvioR9k11Tx",
+ "outputId": "9eae848f-52ba-47bc-c17f-4cf753c82504"
+ },
+ "execution_count": 9,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ " weights\n",
+ "symbol \n",
+ "SOL-USD 37.11\n",
+ "TRX-USD 32.71\n",
+ "BNB-USD 30.17\n",
+ "ADA-USD 0.00\n",
+ "BTC-USD -0.00\n",
+ "DOT-USD 0.00\n",
+ "ETH-USD 0.00\n",
+ "LTC-USD 0.00\n",
+ "MATIC-USD 0.00\n",
+ "XRP-USD 0.00"
+ ],
+ "text/html": [
+ "\n",
+ " \n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " weights | \n",
+ "
\n",
+ " \n",
+ " symbol | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " SOL-USD | \n",
+ " 37.11 | \n",
+ "
\n",
+ " \n",
+ " TRX-USD | \n",
+ " 32.71 | \n",
+ "
\n",
+ " \n",
+ " BNB-USD | \n",
+ " 30.17 | \n",
+ "
\n",
+ " \n",
+ " ADA-USD | \n",
+ " 0.00 | \n",
+ "
\n",
+ " \n",
+ " BTC-USD | \n",
+ " -0.00 | \n",
+ "
\n",
+ " \n",
+ " DOT-USD | \n",
+ " 0.00 | \n",
+ "
\n",
+ " \n",
+ " ETH-USD | \n",
+ " 0.00 | \n",
+ "
\n",
+ " \n",
+ " LTC-USD | \n",
+ " 0.00 | \n",
+ "
\n",
+ " \n",
+ " MATIC-USD | \n",
+ " 0.00 | \n",
+ "
\n",
+ " \n",
+ " XRP-USD | \n",
+ " 0.00 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
\n"
+ ],
+ "application/vnd.google.colaboratory.intrinsic+json": {
+ "type": "dataframe",
+ "variable_name": "pie_df",
+ "summary": "{\n \"name\": \"pie_df\",\n \"rows\": 10,\n \"fields\": [\n {\n \"column\": \"symbol\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 10,\n \"samples\": [\n \"MATIC-USD\",\n \"TRX-USD\",\n \"DOT-USD\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"weights\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 16.184783972059133,\n \"min\": 0.0,\n \"max\": 37.11,\n \"num_unique_values\": 4,\n \"samples\": [\n 32.71,\n 0.0,\n 37.11\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
+ }
+ },
+ "metadata": {},
+ "execution_count": 9
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "Display Pie Chart of the weights"
+ ],
+ "metadata": {
+ "id": "WSHUOb_O_12C"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "pie_df= pie_df.query('weights != 0.000000')\n",
+ "\n",
+ "fig, ax = plt.subplots()\n",
+ "ax.pie(pie_df.weights, labels=pie_df.index.values.tolist(), autopct='%1.1f%%', radius=2)\n",
+ "plt.show()"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 638
+ },
+ "id": "Ad1Ncn3N2iRj",
+ "outputId": "a6919539-1140-48d5-c244-0ea49c1e5c8c"
+ },
+ "execution_count": 10,
+ "outputs": [
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "