-
Notifications
You must be signed in to change notification settings - Fork 0
Instructions how to create Portfolio DataFrame
The most crucial part of working with Portfolio Information is DataFrame. This page is aimed to explain how to create specific type of DataFrame to work with all other script in this repository.
Before building Portfolio DataFrame, it is necessary to type info about current securities. Information should include ticker (name of the company on stock market), start date (buy date), end date (sell date) and number of securities. To do the following you need to create nested list with information. After that nested list should be transformed into DataFrame, which will be used to create time series data.
These steps can be seen in this script:
Having created DataFrame with portfolio information, you will be finally able to create time series data of portfolio. Everything you need is to put previous DataFrame into this script:
Now you have right peace which will allow to get all functionality of the repository.
Portfolio DataFrame contains values of securities prices, number and total values but not appropriate to calculate returns. Therefore, I have written script that calculates Portfolio Return: