diff --git a/website/content/portfolio/_index.md b/website/content/portfolio/_index.md index 093e02e215d..247f2929437 100644 --- a/website/content/portfolio/_index.md +++ b/website/content/portfolio/_index.md @@ -1,3 +1,25 @@ +```text +(✨) / $ portfolio + +What do you want to do? + +> bro brokers holdings, supports: robinhood, ally, degiro, coinbase +> po portfolio optimization, optimal portfolio weights from pyportfolioopt + +Portfolio: + load load data into the portfolio + save save your portfolio for future use + show show existing transactions + add add a security to your portfolio + rmv remove a security from your portfolio + +Reports: + ar annual report for performance of a given portfolio + +Graphs: + rmr graph your returns versus the market's returns +``` + --- geekdocCollapseSection: true --- diff --git a/website/content/portfolio/ar/_index.md b/website/content/portfolio/ar/_index.md index 1accc74d646..8632df1161e 100644 --- a/website/content/portfolio/ar/_index.md +++ b/website/content/portfolio/ar/_index.md @@ -2,11 +2,11 @@ usage: ar [-m MARKET] [-h] ``` -Generate an a PDF annual report for a portfolio +Create an annual report based on a saved portfolio with a selectable benchmark for performance vs. market. ``` optional arguments: - -m MARKET, --market MARKEt - the asset that represents the market - -h, --help show this help message + -m MARKET, --market MARKET + Choose a ticker to be the market asset (default: SPY) + -h, --help show this help message (default: False) ``` diff --git a/website/content/portfolio/portfolio_analysis/_index.md b/website/content/portfolio/portfolio_analysis/_index.md deleted file mode 100644 index 0a484f91096..00000000000 --- a/website/content/portfolio/portfolio_analysis/_index.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -geekdocCollapseSection: true ---- - -## TODO: Update after refactoring - -{{< toc-tree >}} diff --git a/website/content/portfolio/portfolio_optimization/_index.md b/website/content/portfolio/portfolio_optimization/_index.md index 093e02e215d..c434742ac48 100644 --- a/website/content/portfolio/portfolio_optimization/_index.md +++ b/website/content/portfolio/portfolio_optimization/_index.md @@ -1,3 +1,29 @@ +The terminal has incorporated PyPortfolioOpt. Refer to the documentation here: https://pyportfolioopt.readthedocs.io/en/latest/MeanVariance.html + +```text +Portfolio Optimization: + select select list of tickers to be optimized + add add tickers to the list of the tickers to be optimized + rmv remove tickers from the list of the tickers to be optimized + +Tickers: VT, QQQ, SPY + +Optimization: + equal equally weighted + mktcap weighted according to market cap (property marketCap) + dividend weighted according to dividend yield (property dividendYield) + property weight according to selected info property + +Mean Variance Optimization: + maxsharpe optimizes for maximal Sharpe ratio (a.k.a the tangency portfolio + minvol optimizes for minimum volatility + maxquadutil maximises the quadratic utility, given some risk aversion + effret maximises return for a given target risk + effrisk minimises risk for a given target return + + ef show the efficient frontier +``` + --- geekdocCollapseSection: true --- diff --git a/website/content/portfolio/portfolio_optimization/dividend/_index.md b/website/content/portfolio/portfolio_optimization/dividend/_index.md index 547a1203d77..be28fd1b31c 100644 --- a/website/content/portfolio/portfolio_optimization/dividend/_index.md +++ b/website/content/portfolio/portfolio_optimization/dividend/_index.md @@ -1,28 +1,14 @@ -``` -usage: property [-p PROPERTY] [-v VALUE] [--pie] [-h] +```text +usage: dividend [-v VALUE] [--pie] [-h] ``` -Returns a portfolio that is weighted based on a selected property info +Returns a portfolio that is weighted for optimaal dividend yield. ``` optional arguments: - -p PROPERTY, --property PROPERTY - Property info to weigh. Use one of: previousClose, regularMarketOpen, twoHundredDayAverage, trailingAnnualDividendYield, - payoutRatio, volume24Hr, regularMarketDayHigh, navPrice, averageDailyVolume10Day, totalAssets, regularMarketPreviousClose, - fiftyDayAverage, trailingAnnualDividendRate, open, toCurrency, averageVolume10days, expireDate, yield, algorithm, - dividendRate, exDividendDate, beta, circulatingSupply, regularMarketDayLow, priceHint, currency, trailingPE, - regularMarketVolume, lastMarket, maxSupply, openInterest, marketCap, volumeAllCurrencies, strikePrice, averageVolume, - priceToSalesTrailing12Months, dayLow, ask, ytdReturn, askSize, volume, fiftyTwoWeekHigh, forwardPE, fromCurrency, - fiveYearAvgDividendYield, fiftyTwoWeekLow, bid, dividendYield, bidSize, dayHigh, annualHoldingsTurnover, enterpriseToRevenue, - beta3Year, profitMargins, enterpriseToEbitda, 52WeekChange, morningStarRiskRating, forwardEps, revenueQuarterlyGrowth, - sharesOutstanding, fundInceptionDate, annualReportExpenseRatio, bookValue, sharesShort, sharesPercentSharesOut, fundFamily, - lastFiscalYearEnd, heldPercentInstitutions, netIncomeToCommon, trailingEps, lastDividendValue, SandP52WeekChange, - priceToBook, heldPercentInsiders, shortRatio, sharesShortPreviousMonthDate, floatShares, enterpriseValue, - threeYearAverageReturn, lastSplitFactor, legalType, lastDividendDate, morningStarOverallRating, earningsQuarterlyGrowth, - pegRatio, lastCapGain, shortPercentOfFloat, sharesShortPriorMonth, impliedSharesOutstanding, fiveYearAverageReturn, and - regularMarketPrice. (default: None) -v VALUE, --value VALUE Amount to allocate to portfolio (default: 1) --pie Display a pie chart for weights (default: False) -h, --help show this help message (default: False) ``` +Feature Screenshot - weighted portfolio for dividend yield diff --git a/website/content/portfolio/portfolio_optimization/ef/_index.md b/website/content/portfolio/portfolio_optimization/ef/_index.md index c2c2984c544..8ca2ee31e45 100644 --- a/website/content/portfolio/portfolio_optimization/ef/_index.md +++ b/website/content/portfolio/portfolio_optimization/ef/_index.md @@ -2,7 +2,9 @@ usage: ef [-p {1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max}] [-n N_PORT] [-h] [-r] ``` -This function plots random portfolios based on their risk and returns and shows the efficient frontier. +This function plots random portfolios based on their risk and returns and shows the efficient frontier. + +https://pyportfolioopt.readthedocs.io/en/latest/GeneralEfficientFrontier.html ``` optional arguments: @@ -13,3 +15,4 @@ optional arguments: -h, --help show this help message (default: False) -r, --risk-free shows the risk free optimal line ``` +Feature Screenshot - ef diff --git a/website/content/portfolio/portfolio_optimization/effret/_index.md b/website/content/portfolio/portfolio_optimization/effret/_index.md index f354311eb20..19fb8b616ab 100644 --- a/website/content/portfolio/portfolio_optimization/effret/_index.md +++ b/website/content/portfolio/portfolio_optimization/effret/_index.md @@ -2,7 +2,7 @@ usage: effret [-p {1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max}] [-v VALUE] [-n] [--pie] [-t TARGET_RETURN] [-h] ``` -Calculate the 'Markowitz portfolio', minimising volatility for a given target return +Calculate the 'Markowitz portfolio', minimising volatility for a given target return. By combining assets with different expected returns and volatilities, one can decide on a mathematically optimal allocation. ``` optional arguments: @@ -17,3 +17,4 @@ optional arguments: the desired return of the resulting portfolio (default: 0.1) -h, --help show this help message (default: False) ``` +Feature Screenshot - effret diff --git a/website/content/portfolio/portfolio_optimization/equal/_index.md b/website/content/portfolio/portfolio_optimization/equal/_index.md index c3670e14e9d..666e54e8c5e 100644 --- a/website/content/portfolio/portfolio_optimization/equal/_index.md +++ b/website/content/portfolio/portfolio_optimization/equal/_index.md @@ -11,3 +11,4 @@ optional arguments: --pie Display a pie chart for weights (default: False) -h, --help show this help message (default: False) ``` +Feature Screenshot - equal diff --git a/website/content/portfolio/portfolio_optimization/maxquadutil/_index.md b/website/content/portfolio/portfolio_optimization/maxquadutil/_index.md index f067b56b5a9..1607de07eac 100644 --- a/website/content/portfolio/portfolio_optimization/maxquadutil/_index.md +++ b/website/content/portfolio/portfolio_optimization/maxquadutil/_index.md @@ -1,8 +1,9 @@ ``` usage: maxquadutil [-p {1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max}] [-v VALUE] [-n] [--pie] [-r RISK_AVERSION] [-h] ``` +In financial economics, the utility function most frequently used to describe investor behaviour is the quadratic utility function. Its popularity stems from the fact that, under the assumption of quadratic utility, mean-variance analysis is optimal. -Maximises the quadratic utility, given some risk aversion +https://www.d42.com/portfolio/analysis/quadratic-utility ``` optional arguments: @@ -17,3 +18,4 @@ optional arguments: risk aversion parameter (default: 1) -h, --help show this help message (default: False) ``` +Feature Screenshot - maxquadutil diff --git a/website/content/portfolio/portfolio_optimization/maxsharpe/_index.md b/website/content/portfolio/portfolio_optimization/maxsharpe/_index.md index 9059e8bccb7..77aa28c7f4f 100644 --- a/website/content/portfolio/portfolio_optimization/maxsharpe/_index.md +++ b/website/content/portfolio/portfolio_optimization/maxsharpe/_index.md @@ -1,8 +1,15 @@ ``` usage: maxsharpe [-p {1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max}] [-v VALUE] [--pie] [-r RISK_FREE_RATE] [-h] ``` +The Sharpe ratio is one of the most widely used methods for calculating risk-adjusted return. Modern Portfolio Theory (MPT) states that adding assets to a diversified portfolio that has low correlations can decrease portfolio risk without sacrificing returns. Adding diversification should increase the Sharpe ratio compared to similar portfolios with a lower level of diversification. For this to be true, investors must also accept the assumption that risk is equal to volatility, which is not unreasonable but may be too narrow to be applied to all investments. -Maximise the Sharpe Ratio +The Sharpe Ratio is calculated as follows: + +1. Subtract the risk-free rate from the return of the portfolio. The risk-free rate could be a U.S. Treasury rate or yield, such as the one-year or two-year Treasury yield. + +2. Divide the result by the standard deviation of the portfolio’s excess return. The standard deviation helps to show how much the portfolio's return deviates from the expected return. The standard deviation also sheds light on the portfolio's volatility. + +The Sharpe ratio can also help explain whether a portfolio's excess returns are due to smart investment decisions or a result of too much risk. ``` optional arguments: @@ -16,3 +23,4 @@ optional arguments: (default: 0.02) -h, --help show this help message (default: False) ``` +Feature Screenshot - maxsharpe diff --git a/website/content/portfolio/portfolio_optimization/minvol/_index.md b/website/content/portfolio/portfolio_optimization/minvol/_index.md index 133d4305c3a..77fe4df4a00 100644 --- a/website/content/portfolio/portfolio_optimization/minvol/_index.md +++ b/website/content/portfolio/portfolio_optimization/minvol/_index.md @@ -13,3 +13,4 @@ optional arguments: --pie Display a pie chart for weights (default: False) -h, --help show this help message (default: False) ``` +Feature Screenshot - minvol diff --git a/website/content/portfolio/portfolio_optimization/mktcap/_index.md b/website/content/portfolio/portfolio_optimization/mktcap/_index.md index 547a1203d77..202c1002028 100644 --- a/website/content/portfolio/portfolio_optimization/mktcap/_index.md +++ b/website/content/portfolio/portfolio_optimization/mktcap/_index.md @@ -2,27 +2,13 @@ usage: property [-p PROPERTY] [-v VALUE] [--pie] [-h] ``` -Returns a portfolio that is weighted based on a selected property info +Returns a portfolio that is weighted based on market cap. ``` optional arguments: - -p PROPERTY, --property PROPERTY - Property info to weigh. Use one of: previousClose, regularMarketOpen, twoHundredDayAverage, trailingAnnualDividendYield, - payoutRatio, volume24Hr, regularMarketDayHigh, navPrice, averageDailyVolume10Day, totalAssets, regularMarketPreviousClose, - fiftyDayAverage, trailingAnnualDividendRate, open, toCurrency, averageVolume10days, expireDate, yield, algorithm, - dividendRate, exDividendDate, beta, circulatingSupply, regularMarketDayLow, priceHint, currency, trailingPE, - regularMarketVolume, lastMarket, maxSupply, openInterest, marketCap, volumeAllCurrencies, strikePrice, averageVolume, - priceToSalesTrailing12Months, dayLow, ask, ytdReturn, askSize, volume, fiftyTwoWeekHigh, forwardPE, fromCurrency, - fiveYearAvgDividendYield, fiftyTwoWeekLow, bid, dividendYield, bidSize, dayHigh, annualHoldingsTurnover, enterpriseToRevenue, - beta3Year, profitMargins, enterpriseToEbitda, 52WeekChange, morningStarRiskRating, forwardEps, revenueQuarterlyGrowth, - sharesOutstanding, fundInceptionDate, annualReportExpenseRatio, bookValue, sharesShort, sharesPercentSharesOut, fundFamily, - lastFiscalYearEnd, heldPercentInstitutions, netIncomeToCommon, trailingEps, lastDividendValue, SandP52WeekChange, - priceToBook, heldPercentInsiders, shortRatio, sharesShortPreviousMonthDate, floatShares, enterpriseValue, - threeYearAverageReturn, lastSplitFactor, legalType, lastDividendDate, morningStarOverallRating, earningsQuarterlyGrowth, - pegRatio, lastCapGain, shortPercentOfFloat, sharesShortPriorMonth, impliedSharesOutstanding, fiveYearAverageReturn, and - regularMarketPrice. (default: None) -v VALUE, --value VALUE Amount to allocate to portfolio (default: 1) --pie Display a pie chart for weights (default: False) -h, --help show this help message (default: False) ``` +Feature Screenshot - mktcap diff --git a/website/content/portfolio/portfolio_optimization/property/_index.md b/website/content/portfolio/portfolio_optimization/property/_index.md index 547a1203d77..681ebbdda99 100644 --- a/website/content/portfolio/portfolio_optimization/property/_index.md +++ b/website/content/portfolio/portfolio_optimization/property/_index.md @@ -2,7 +2,7 @@ usage: property [-p PROPERTY] [-v VALUE] [--pie] [-h] ``` -Returns a portfolio that is weighted based on a selected property info +Suggests a weighting based on a targeted statistic. ``` optional arguments: @@ -26,3 +26,4 @@ optional arguments: --pie Display a pie chart for weights (default: False) -h, --help show this help message (default: False) ``` +Feature Screenshot - property diff --git a/website/content/portfolio/rmr/_index.md b/website/content/portfolio/rmr/_index.md index 6ea9f613326..7028bf9cb76 100644 --- a/website/content/portfolio/rmr/_index.md +++ b/website/content/portfolio/rmr/_index.md @@ -2,11 +2,11 @@ usage: rmr [-m MARKET] [-h] ``` -Show portfolio returns versus market returns +A graph of portfolio returns versus a chosen benchmark or market. ``` optional arguments: - -m MARKET, --market MARKEt - the asset that represents the market - -h, --help show this help message + -m MARKET, --market MARKET + Choose a ticker to be the market asset (default: SPY) + -h, --help show this help message (default: False) ``` diff --git a/website/data/menu/main.yml b/website/data/menu/main.yml index 9f38566b14d..33a82fd189e 100755 --- a/website/data/menu/main.yml +++ b/website/data/menu/main.yml @@ -974,12 +974,12 @@ main: - name: robinhood ref: "/portfolio/brokers/robinhood" sub: + - name: login + ref: "/portfolio/portfolio/brokers/robinhood/login" - name: history ref: "/portfolio/brokers/robinhood/history" - name: holdings ref: "/portfolio/brokers/robinhood/holdings" - - name: portfolio analysis - ref: "/portfolio/portfolio_analysis" - name: portfolio optimization ref: "/portfolio/portfolio_optimization" sub: @@ -1009,6 +1009,20 @@ main: ref: "/portfolio/portfolio_optimization/effrisk" - name: ef ref: "/portfolio/portfolio_optimization/ef" + - name: load + ref: "/portfolio/load" + - name: save + ref: "/portfolio/save" + - name: show + ref: "/portfolio/show" + - name: add + ref: "/portfolio/add" + - name: rmv + ref: "/portfolio/rmv" + - name: ar + ref: "/portfolio/ar" + - name: rmr + ref: "/portfolio/rmr" - name: forex ref: "/forex" sub: