Coder Social home page Coder Social logo

sudarsan-sridharan / empyrial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ssantoshp/empyrial

0.0 0.0 0.0 4.5 MB

An Open Source Portfolio Management Framework for Everyone 投资组合管理

Home Page: https://ssantoshp.github.io/Empyrial/

License: MIT License

Python 100.00%

empyrial's Introduction

By Investors, For Investors.











Open In Colab



Want to read this in Chinese? Click here

Empyrial is a Python-based open-source quantitative investment library dedicated to financial institutions and retail investors, officially released in Mars 2021. Already used by thousands of people working in the finance industry, Empyrial aims to become an all-in-one platform for portfolio management, analysis, and optimization.

Empyrial empowers portfolio management by bringing the best of performance and risk analysis in an easy to understand, flexible and powerful framework.

With Empyrial, you can easily analyze security or a portfolio in order to get the best insights from it.



Installation

You can install Empyrial using pip:

pip install empyrial

For a better experience, we advise you to use Empyrial on a notebook (Jupyter, Google Colab...)

Features

Feature 📰 Status
Empyrial (backtesting + performance analysis) Released on May 30, 2021
Optimizer Released on Jun 7, 2021
Rebalancing Released on Jun 27, 2021
Risk manager Released on Jun 27, 2021

Here are the functions available with Empyrial:

Usage

Empyrial

from empyrial import empyrial, Engine

portfolio = Engine(    
                  start_date= "2018-06-09", 
                  portfolio= ["BABA", "RELIANCE.NS", "KO", "^DJI","^IXIC"], 
                  weights = [0.2, 0.2, 0.2, 0.2, 0.2], #equal weighting by default
                  benchmark = ["SPY"] #SPY by default
)

empyrial(portfolio)

>> See the output

If you want to add rebalancing (calendar-based) to your strategy you can do that:

from empyrial import empyrial, Engine

portfolio = Engine(    
                  start_date= "2018-06-09", 
                  portfolio= ["BABA", "RELIANCE.NS", "KO", "^DJI","^IXIC"], 
                  benchmark = ["SPY"], #SPY by default
		  optimizer = "EF",
		  rebalance = "1y"
)

empyrial(portfolio)

Time periods available for rebalancing are 2y,1y,6mo,quarterly,monthly


Optimizer

There are 5 optimizers available:

  • "EF": Global Efficient Frontier

  • "MEANVAR": Mean-Variance (in this case, you'll have to define a max volatility that you don't want to exceed)

  • "HRP": Hierarchical Risk Parity

  • "MINVAR": Minimum-Variance

  • "BL": Black Litterman (in this case, you'll have to define you're views and confidences on the assets you invest in)

Note: the default optimizer is equal weighting

There is two ways to use the Empyrial's optimizer :

  1. Optimize allocation directly with Engine
from empyrial import*

portfolio = Engine(
      start_date = "2018-01-01",
      portfolio = ["BLK", "BAC", "AAPL", "TM", "JPM","JD", "INTU", "NVDA", "DIS", "TSLA"],
      optimizer = "EF" 
)

portfolio.weights

Output:

[0.31409, 0.0, 0.03472, 0.00046, 0.0, 0.0, 0.069, 0.08831, 0.00854, 0.48489]
  1. See the performance of an optimizer
from empyrial import*

portfolio = Engine(
      start_date = "2018-01-01",
      portfolio = ["BLK", "BAC", "AAPL", "TM", "JPM","JD", "INTU", "NVDA", "DIS", "TSLA"]
)

#for efficient frontier
optimizer(portfolio, "EF")

#for hierarchical risk parity
optimizer(portfolio, "HRP")

#for mean variance
optimizer(portfolio, "MV", vol_max=0.15)

>> See the output

Download the Tearsheet

Want to download a tear sheet of the analysis as a PDF or HTML file? You can check out documentation to find out how to do this.

Stargazers over time

追星族的时间

Contribution and Issues

  • Create Issue - For the larger changes (such as new features, large refactoring, etc.) it is best to first open an issue to discuss, and smaller improvements (such as document improvements, bugfixes, etc.) can be sent directly to PR

  • Fork Empyrial - Click the Fork button in the upper right corner

  • Clone your own fork: git clone https://github.com/ssantoshp/Empyrial.git

  • Empyrial uses GitHub to host its source code, if you wish to contribute code please use the PR (Pull Request) process of GitHub: pull requests. It'll waiting for review, checked/modified and be merged!

Contributors

Thanks goes to these wonderful people (emoji key):

All Contributors


Renan Lopes

💻 🐛

Diego Alvarez

💻🐛

Rakesh Bhat

💻

Anh Le

🐛

Tony Zhang

💻

Ikko Ashimine

✒️

QuantNomad

📹

Adam Nelsson

📓

This project follows the all-contributors specification. Contributions of any kind are welcome!

Contact

You are welcome to contact us by email at [email protected] or in Empyrial's discussion space

License

MIT

empyrial's People

Contributors

ssantoshp avatar rslopes avatar rakeshbhat9 avatar diegodalvarez avatar haizzz avatar eltociear avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.