Skip to content

Commit

Permalink
Update Introduction to Online Portfolio Selection.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
akwon31 committed May 22, 2020
1 parent eb53d5b commit 9bc3891
Showing 1 changed file with 34 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"source": [
"- By: Alex Kwon\n",
"- Email: alex.kwon [at] hudsonthames [dot] org\n",
"- Reference: [Online Portfolio Selection](https://books.google.com/books/about/Online_Portfolio_Selection.html?id=R2fdCgAAQBAJ) by Dr. Bin Li and Dr. Steven Hoi\n",
"\n",
"# Online Portfolio Selection"
]
Expand All @@ -15,59 +14,30 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Abstract\n",
"## OLPS Strategies\n",
"\n",
"Online Portfolio Selection is an algorithmic trading strategy that sequentially allocates capital among a group of assets to maximize the final returns of the investment.\n",
"[**Benchmarks**](https://github.com/hudson-and-thames/research/blob/master/Online%20Portfolio%20Selection/Introduction%20to%20Online%20Portfolio%20Selection.ipynb)\n",
"\n",
"Traditional theories for portfolio selection, such as Markowitz’s Modern Portfolio Theory, optimize the balance between the portfolio's risks and returns. However, OLPS is founded on the capital growth theory, which solely focuses on maximizing the returns of the current portfolio.\n",
"[**Momentum**](https://github.com/hudson-and-thames/research/blob/master/Online%20Portfolio%20Selection/Online%20Portfolio%20Selection%20-%20Momentum.ipynb)\n",
"\n",
"Through these walkthroughs of different portfolio selection strategies, we hope to introduce a set of different selection tools available for everyone. Most of the works will be based on Dr. Bin Li and Dr. Steven Hoi’s book, *Online Portfolio Selection: Principles and Algorithms*, and further recent papers will be implemented to assist the development and understanding of these unique portfolio selection strategies.\n",
"[**Mean Reversion**](https://github.com/hudson-and-thames/research/blob/master/Online%20Portfolio%20Selection/Online%20Portfolio%20Selection%20-%20Mean%20Reversion.ipynb)\n",
"\n",
"The package and module behind this implementation of OLPS are currently in the works and will be published on MlFinLab soon."
"[**Pattern Matching**](https://github.com/hudson-and-thames/research/blob/master/Online%20Portfolio%20Selection/Online%20Portfolio%20Selection%20-%20Pattern%20Matching.ipynb)\n",
"\n",
"## Abstract"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Strategy\n",
"\n",
"Throughout the next couple of weeks, we will be releasing notebooks on the following strategies\n",
"\n",
"**Benchmarks**\n",
"- Buy and Hold\n",
"- Best Stock\n",
"- Constant Rebalanced Portfolio\n",
"- Best Constant Rebalanced Portfolio\n",
"\n",
"**Momentum**\n",
"- Exponential Gradient\n",
"- Follow the Leader\n",
"- Follow the Regularized Leader\n",
"\n",
"**Mean Reversion**\n",
"- Confidence Weighted Mean Reversion\n",
"- Passive Aggressive Mean Reversion\n",
"- Online Moving Average Reversion\n",
"Online Portfolio Selection is an algorithmic trading strategy that sequentially allocates capital among a group of assets to maximize the final returns of the investment.\n",
"\n",
"**Pattern Matching**\n",
"- Nonparametric Histogram/Kernel-Based/Nearest Neighbor Log-Optimal\n",
"- Correlation Driven Nonparametric Learning\n",
"- Nonparametric Kernel-Based Semi-Log-Optimal/Markowitz/GV\n",
"Traditional theories for portfolio selection, such as Markowitz’s Modern Portfolio Theory, optimize the balance between the portfolio's risks and returns. However, OLPS is founded on the capital growth theory, which solely focuses on maximizing the returns of the current portfolio.\n",
"\n",
"**Meta Algorithm**\n",
"- Aggregating Algorithm\n",
"- Fast Universalization Algorithm\n",
"- Online Gradient Updates\n",
"- Online Newton Updates\n",
"- Follow the Leading History\n",
"Through these walkthroughs of different portfolio selection strategies, we hope to introduce a set of different selection tools available for everyone. Most of the works will be based on Dr. Bin Li and Dr. Steven Hoi’s book, *Online Portfolio Selection: Principles and Algorithms*, and further recent papers will be implemented to assist the development and understanding of these unique portfolio selection strategies.\n",
"\n",
"**Universal Portfolio**\n",
"- Universal Portfolio\n",
"- CORN-U\n",
"- CORN-K\n",
"- SCORN-K\n",
"- FCORN-K"
"The package and module behind this implementation of OLPS are currently in the works and will be published on MlFinLab soon."
]
},
{
Expand All @@ -93,7 +63,7 @@
"import pandas as pd\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from mlfinlab.online_portfolio_selection import BuyAndHold, BestStock, ConstantRebalancedPortfolio, BestConstantRebalancedPortfolio"
"from mlfinlab.online_portfolio_selection.benchmarks import *"
]
},
{
Expand Down Expand Up @@ -416,7 +386,7 @@
"\n",
"$S_n(BAH(b_1)) = b_1 \\cdot \\left(\\overset{n}{\\underset{t=1}{\\bigodot}} x_t\\right)$\n",
"\n",
"Buy and Hold strategy can be called using **BuyAndHold()**.\n",
"Buy and Hold strategy can be called using **BAH()**.\n",
"\n",
"We can then easily run the algorithm and allocate weights by using the **.allocate()** method."
]
Expand All @@ -427,7 +397,7 @@
"metadata": {},
"outputs": [],
"source": [
"bah = BuyAndHold()\n",
"bah = BAH()\n",
"bah.allocate(stock_prices)"
]
},
Expand Down Expand Up @@ -2032,7 +2002,7 @@
"\n",
"$S_n(CRP(b)) = \\overset{n}{\\underset{t=1}{\\prod}} \\: b^{\\top}x_t$\n",
"\n",
"Constant Rebalanced Portfolio can be called with **ConstantRebalancedPortfolio()**, and the weights can be initiated with CRP(weight=weight). If no weights are specified, it will initialize to uniform weights across all time."
"Constant Rebalanced Portfolio can be called with **CRP()**, and the weights can be initiated with CRP(weight=weight). If no weights are specified, it will initialize to uniform weights across all time."
]
},
{
Expand Down Expand Up @@ -2444,7 +2414,7 @@
}
],
"source": [
"crp = ConstantRebalancedPortfolio()\n",
"crp = CRP()\n",
"crp.allocate(stock_prices)\n",
"crp.all_weights"
]
Expand Down Expand Up @@ -2514,7 +2484,7 @@
"metadata": {},
"outputs": [],
"source": [
"half_and_half_crp = ConstantRebalancedPortfolio(half_and_half)\n",
"half_and_half_crp = CRP(half_and_half)\n",
"half_and_half_crp.allocate(stock_prices)"
]
},
Expand Down Expand Up @@ -2923,7 +2893,7 @@
"\n",
"$S_n(BCRP) = \\underset{b \\in \\Delta_m}{\\max} \\: S_n(CRP(b)) = S_n(CRP(b^{\\bf \\star}))$\n",
"\n",
"Best Constant Rebalanced Portfolio strategy can be called with **BestConstantRebalancedPortfolio()**."
"Best Constant Rebalanced Portfolio strategy can be called with **BCRP()**."
]
},
{
Expand All @@ -2932,7 +2902,7 @@
"metadata": {},
"outputs": [],
"source": [
"bcrp = BestConstantRebalancedPortfolio()\n",
"bcrp = BCRP()\n",
"bcrp.allocate(stock_prices)"
]
},
Expand Down Expand Up @@ -3635,8 +3605,22 @@
"\n",
"The next notebook will focus on Exponential Gradient, a momentum strategy.\n",
"\n",
"If you enjoyed reading this please leave us a star on [GitHub](https://github.com/hudson-and-thames) and join our [Slack](https://join.slack.com/t/mlfinlab/shared_invite/zt-c62u9gpz-VFc13j6da~UVg3DkV7~RjQ) channel to ask us any questions!"
"If you enjoyed reading this please remember to leave us a star on [GitHub](https://github.com/hudson-and-thames) and become a sponsor on [Patreon](https://www.patreon.com/HudsonThames) to have exclusive access to our Slack channel!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- Reference: [Online Portfolio Selection](https://books.google.com/books/about/Online_Portfolio_Selection.html?id=R2fdCgAAQBAJ) by Dr. Bin Li and Dr. Steven Hoi"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 9bc3891

Please sign in to comment.