Giter VIP home page Giter VIP logo

stock_market_simulator's Introduction

Portfolio Management System

This repository contains a simple portfolio management system written in Python. It allows users to calculate returns on investment for different stocks based on predicted returns and actual prices.

Files

  • portfolio.py: Contains the Portfolio class responsible for managing financial portfolios.
  • stock.py: Contains the Stock class responsible for managing stocks in portfolios.
  • main.py: Main script to execute portfolio calculations.
  • README.md: This documentation file.

Usage

  1. Ensure you have Python installed on your system.
  2. Clone this repository to your local machine.
  3. Install the required dependencies by running pip install pandas.
  4. Modify main.py to provide appropriate file paths for prediction data and test data.
  5. Define return_strategy in main.py.
  6. Run main.py to execute the portfolio calculations.

Portfolio Class

The Portfolio class contains the following trading strategies:

  • simple_return: Trade each stock individually based on the predicted return. Each stock has the same initial capital for investment. If predicted return > 0, buy or hold; if predicted return <= 0, sell.
  • portfolio_simple_return: At time t, sell all stocks with negative predicted return, and use the gained capital to invest all the stocks with positive capital.
  • long_short_return: Short the stocks with predicted negative return, STILL UNDER DEVELOPMENT.

Contributors

stock_market_simulator's People

Contributors

zimenglyu avatar rohaan2614 avatar

stock_market_simulator's Issues

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.