Giter Club home page Giter Club logo

ideal-portfolio's Introduction

ideal-portfolio

This project aims at testing a portfolio strategy in hope of finding the ideal one. Upon choosing its components and the importance they should have, the code returns the list of orders that should have been placed now for the portfolio to be created or to be rebalanced if inputed an existing portfolio composition.

⚠️ This code does not provide financial advice. The provided example is solely to demonstrate how the code functions and should not be regarded as financial advice. This project is intended only for creating hypothetical portfolios and not for executing trades based on the outputs of this code. Use it at your own risk. The creators are not liable for any financial losses resulting from actions taken based on this code. Always consult a qualified financial advisor before making investment decisions.:

How does it Work? - a Simple Example

Note

This repo uses Poetry to manage dependencies. Once you have Poetry installed, run the following command to install dependencies:

poetry install

And you are good to go!

We propose a simple example to test the code and see its capabilities. Simply run the following command line:

poetry run python portfolio.py

The structure of the portfolio is described in _categories.csv, where each line corresponds to a category and its relative importance in the portfolio structure. In our case, we can see two categories in _categories.csv, crypto and stock, with a respective importance of 30 and 70%. For each category, an associated file needs to be added: crypto.csv and stock.csv in our case. Each file contains its objects (stocks, ETFs, cryptocurrencies, ...) and their respective importance. As long as the importances sums to 1 and as long as a valid Yahoo Finance tag is provided for each object, the code will run as expected. For your own application, you can define different categories and input different objects, e.g. offense and defense, or etf, stock, and bond.

The file _history.csv is also needed for the repository to work as intended. It contains the purchase and sell history since the creation of the portfolio, and is needed to estimate the existing portfolio positions, and compare them with the theoretical ones defined in _categories.csv.

How to Run the Code for your Own Portfolio?

Simply create your own files in your_portfolio and run

poetry run python portfolio.py --no-example

ideal-portfolio's People

Contributors

yannfra avatar tonyds2022 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ideal-portfolio's Issues

🧪test: convert example project as unit test

Test-driven development is an important component of the software development lifecycle to ensure correctness. We can make use of the example portfolio to create a unit test and use GitHub actions to ensure that each commit passes all unit tests.

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.