universal-portfolios icon indicating copy to clipboard operation
universal-portfolios copied to clipboard

2 questions

Open AwesomeCap opened this issue 2 years ago • 1 comments

Hi Marigold! I have 2 questions:

  1. How do you get a time-series, with the result of the olps every day, out of the "result"? I can only find summaries like the "result.summary()" from the result.

  2. How do you plot the result of many different olps in the same graph? Right now you only get one olps as PORTFOLIO and UCRP when doing "result.plot()".

Thank you for your time in advance.

AwesomeCap avatar Jun 27 '22 10:06 AwesomeCap

  1. Check out result.__dict__ for a dictionary of all available attributes. You're probably looking for result.r which is series of daily returns (to be precise, returns + 1)
  2. There are no methods in the library to do so, but you can easily do it yourself. Extract equity from every olps with result.equity and add them to a dataframe, then call df.plot() to plot all columns of that dataframe in a line chart

Marigold avatar Jul 11 '22 20:07 Marigold