Giter Club home page Giter Club logo

tradingmate's Introduction

TradingMate

TradingMate CI Documentation Status

TradingMate is a portfolio manager for stocks traders. It lets you record all your trades with a simple and basic interface, showing the current status of your assets and the overall profit (or loss!)

Dependencies

View pyproject.toml for the full list of python dependencies.

Install

  • Install Python3
sudo apt-get update
sudo apt-get install python3
  • Install Python GTK+ 3 following the instructions provided here

  • Install TradingMate

make install-system

Setup

TradingMate supports different sources to fetch stocks prices. The desired interface can be configured through a configuration parameter as explained below and based on the chosen interface you can follow the related setup instructions.

AlphaVantage

AlphaVantage is great collection of API that provide several feature. It requires a key:

  • Visit AlphaVantage website: https://www.alphavantage.co

  • Request a free api key

  • Insert these info in a file called .credentials in ${HOME}/.TradingMate/config

    touch ${HOME}/.TradingMate/config/.credentials
    

    This must be in json format and contain:

    {
        "av_api_key": "key_from_alphavantage"
    }
    
  • Revoke permissions to read the file by others

    sudo chmod 600 ${HOME}/.TradingMate/config/.credentials
    

YFinance

YFinance uses Yahoo Finance REST API and it does not require authentication

Configuration file

The config.json file is in the ${HOME}/.TradingMate/config folder and it contains several parameters to personalise how TradingMate works. These are the descriptions of each parameter:

  • trading_logs: The absolute path of the trading logs to automatically load on startup
  • general
    • credentials_filepath: File path of the .credentials file
    • polling_period_sec: Period of time in seconds for stock prices polling
    • stocks_interface
      • active: The active API used to retrieve stock data
      • values: Supported values
  • alpha_vantage
    • api_base_uri: Base URI of AlphaVantage API
    • polling_period_sec: The period of time (in seconds) between each AlphaVantage query
  • yfinance
    • polling_period_sec: The period of time (in seconds) between each query

Start TradingMate

You can start TradingMate with

trading_mate

Uninstall

You can use pip to uninstall TradingMate:

pip3 uninstall TradingMate

Development

Install poetry on your system: https://python-poetry.org/

Create the virtual environment with poetry

cd /path/to/repository
make install

Test

You can run the tests with:

make test

Check

The check make target will run the formatter, the linters and the tests

make check

Documentation

The Sphinx documentation contains further details about each TradingMate module. Read the documentation at:

https://tradingmate.readthedocs.io

You can build it locally from the repo root folder:

make docs

The generated html files will be under docs/_build/html.

Contributing

Any contribution or suggestion is welcome, please follow the suggested workflow.

Pull Requests

To add a new feature or to resolve a bug, create a feature branch from the master branch.

Commit your changes and if possible add unit/integration test cases. Eventually push your branch and create a Pull Request against master.

If you instead find problems or you have ideas and suggestions for future improvements, please open an Issue. Thanks for the support!

Python GTK+ 3 reference: here

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.