Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 2.7 KB

File metadata and controls

55 lines (40 loc) · 2.7 KB

Information for Developers

Pre-requisites

  • Python 3.5 or greater

Background

  • This project is aimed at creating an automated way of trading cryptocurrencies, along with various options/strategies to trade by
  • Uses the binance API to make trades and gather live trading data

Setup Process

These steps below must be executed once after a developer clones the repo. All commands should be run in the root folder (CryptoTrading-Algorithm unless it was renamed after cloning).

  1. Create a virtual environment - python3 -m venv .venv
  2. Activate the virtual environment - source .venv/bin/activiate
  3. Install dependencies - pip install -r requirements.txt
  4. You will need mysql installed on your machine make sure you have your credentials
  5. Create binance.us account and create a new API KEY
    • Go to Binance Sign Up and create an account
    • You will likely want to fund your account with some amount such as $100
    • Once you have created your account hover over your profile in the upper right corner and go to API Management
    • Once in API Management you will want to create an API Key and give it a label
    • IMPORTANT: When you create your API KEY make sure to keep track of the API SECRET KEY as well, you will need both for the project to work
  6. Create a .env file with the following information
    • USERNAME = <mysql username here>
    • PASSWORD = <mysql password here>
    • API_KEY = <binance API_KEY here>
    • API_SECRET_KEY = <binance API_SECRET_KEY here>
  7. Run one of the crypto strategy python scripts using the virtual enviornment.
    • .venv/bin/python3 <python file to run>

Workflow - IDE

PyCharm is the preferred IDE, and the .gitignore file is configured to ignore the files auto-generated by PyCharm (e.g. .idea/). Developers should clone the repo outside of Python and perform the setup process (above) before opening the project in PyCharm. If you open the project in PyCharm before doing these steps, PyCharm will use the default python installation instead of a virtual environment. Developers can correct this by:

  1. Close the project in PyCharm
  2. Remove the .idea/ folder
  3. Re-open the project in Python

Before beginning work, developers should verify that the virtual environment is being used by PyCharm. In the Project pane, open "External Libraries," and verify the entry for Python points to the correct virtual environment.

Workflow - Command Line

A virtual environment is active until the deactivate script is executed or the terminal window is closed. To activate the virtual environment in a new terminal window, run the command source .env/bin/activate from the root of the project.