Git Product home page Git Product logo

gdax-data's Introduction

gdax-data

Trading Starting Dates

  • Bitcoin (BTC)
  • Bitcoin Cash (BCH): 2017-12-19. See details.
  • Ethereum (ETH)
  • Litecoin (LTC): 2016-08-23. See details

Installation

This installation guide works only for Ubuntu Linux 17.04 / 17.10:

  1. Check out the source code from this repository via Git and SSH. If you don't have git or ssh installed, type the following command in Terminal:

    sudo apt install git ssh
    
  2. Install MySQL database and related services/utilities:

    • Type the following command in Terminal to install Apache2 server:

      sudo apt install apache2
      
    • Type the following command to install MySQL (This works for MySQL version before 5.7):

      sudo apt install mysql-server mysql-client libmysqlclient-dev
      

      You will be asked to set a password for accessing MySQL.

    • For MySQL 5.7 or later, you cannot set password for root user. Refer to Step 3 for the user configuration.

    • Type the following command to install PHPMyAdmin, a GUI tool to manipulate MySQL:

      sudo apt install phpmyadmin
      

      You will be asked to type in the password accessing MySQL, which is the one you already set in the step above.

    • Type

      sudo gedit /etc/apache2/apache2.conf
      

      to open the config file of Apache2; add the following line in it:

    Include /etc/phpmyadmin/apache.conf
    

    Save and close the file; then type sudo service apache2 restart to restart Apache2.

    • Open any web browser, type http://localhost/phpmyadmin to open PHPMyAdmin.
  3. (For MySQL 5.7 or later ONLY) Create a super user account in MySQL:

    • In Terminal, type the following command to login MySQL as root:
    sudo mysql
    
    • In MySQL shell, type the following command to create a user:
    CREATE USER 'yihming'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password' PASSWORD EXPIRE NEVER;
    

    In the command, you have create a user with name yihming at host localhost. You can change the user name, and change localhost to % to allow remote access. Moreover, change password to your own password.

    • Type the following command to assign all privileges to this user:
    GRANT ALL on *.* TO 'yihming'@'localhost';
    

    Note that you should change yihming and localhost to your own setting above.

    • When finished, type \q to exit MySQL shell.
  4. Create Database and Table for the Project:

    • Access to MySQL via PHPMyAdmin; in the main window, click "Databases" button; create a database (say "gdax"), with recommended collation "utf8_bin"; then click "Create" button.
    • Click the created database "gdax" in the left panel; Click "Import" button in the main window; Choose "gdax.sql" file in the repository by clicking "Browse..." button; click "Go" button at the bottom.
    • Now you should see a table "history" created inside the database "gdax", with no entry but several fields set.
  5. Set up the database connection config file in the repository:

    • In the repository, type
      cp dbconn.json.example dbconn.json
      
      to create a Database config file from the example.
    • Open "dbconn.json" file, replace root by your user name in MySQL, and your-password by its password to MySQL; save and close.
  6. Install necessary python packages:

    • Install python develop tools:
    sudo apt install python-setuptools python-dev build-essential python-pip ipython
    

    And type sudo pip install --upgrade pip to upgrade pip to the latest version.

    • Install the following packages via pip:
    sudo pip install gdax mysqlclient python-dateutil
    
  7. Start to collect historic rates:

python collect_history.py

To change the product, start and end datetime for the collection:

  • Open "collect_history.py" file; look for function "main()".
  • In the line product = 'BTC-USD', change the value of product to the product you are interested.
  • Change the value of von (start datetime) and bis (end datetime) using ISO 8601 datetime format, and using UTC time zone.

gdax-data's People

Contributors

yihming avatar

Stargazers

 avatar

Watchers

 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.