Skip to content

Commit

Permalink
updated portfolio_example.py for presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-wojniak committed Feb 13, 2021
1 parent f96ecd7 commit bfa1fd1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qttk/examples/portfolio_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def _plot(ticker: str, dataframe: pd.DataFrame) -> None:
# an equally weighted portfolio is assumed
# weights must add up to 1.0 (100%)
weights = np.full((1,len(stocks)), 1/len(stocks))
#weights = np.array([[0.125, 0.125, 0.0, 0.125, 0.125, 0.125, 0.0, 0.125,\
#0.125, 0.125, 0.0]])
#weights = np.array([[0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0]])
#weights = np.array([[0.0, 0.0, 0.33, 0.0, 0.0, 0.0, 0.33, 0.0, 0.0, 0.0, 0.34]])
portfolio = pd.DataFrame(weights, columns=stocks)
dataframe = load_portfolio(portfolio.columns.values)
series = portfolio_price_series(weights, dataframe.iloc[-252:])
Expand All @@ -80,5 +84,5 @@ def _plot(ticker: str, dataframe: pd.DataFrame) -> None:
x = -window # define the date range for plot to plot
to_plot = to_plot.iloc[x:]
to_plot['rsi'] = rsi[x:]
_plot(ticker, to_plot)
#_plot(ticker, to_plot)
exit

0 comments on commit bfa1fd1

Please sign in to comment.