/trafalgar

Python library to make development of portfolio analysis faster and easier

Primary LanguagePythonMIT LicenseMIT

By Investors, for Investors.













Binder


Featured on









Installation 🔥

To install Empyrial, you should do:

pip install empyrial

Usage

from empyrial import empyrial, Engine

portfolio = Engine(    
                  start_date= "2020-06-09", 
                  portfolio= ["BABA", "RELIANCE.NS", "KO", "^DJI","^IXIC"], 
                  weights = [0.2, 0.2, 0.2, 0.2, 0.2], 
                  benchmark = ["SPY"] 
)

empyrial(portfolio)

Output:

report


return


creturn


heatmap


drawdonw


top


rolling

Download the tearsheet (to PDF)

On Google Colab

Create another cell in your program and run that:

!wget -nc https://raw.githubusercontent.com/brpy/colab-pdf/master/colab_pdf.py
from colab_pdf import colab_pdf
colab_pdf('name_of_the_actual_file.ipynb')

On a Jupyter Notebook

Create another cell in your program and run:

pip install nbconvert

Go to Files > Download as > HTML or PDF via LaTeX

(For Visual Studio Code: Click on the "export as" icon in the upper right corner)

If you get an error downloading it as a PDF, download it as a HTML file.

Now open that your_notebook_name.html file (click on it). It will be opened in a new tab of your browser.

Now go to print option (right-click on the page). From here you can save this file in pdf file format.