Giter Site home page Giter Site logo

matbogdan79 / scripts-to-trade-cryptocurrencies Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fedaykinofdune/scripts-trading-btc-ltc

0.0 2.0 0.0 56 KB

PHP scripts to trade cryptocurrencies in exchanes like Poloniex or Bittrex

License: GNU General Public License v2.0

PHP 98.70% Shell 1.30%

scripts-to-trade-cryptocurrencies's Introduction

Scripts to trade cryptocurrencies


This repo is a set of several PHP scripts to trade cryptocurrencies

Supported crypto exchanges:

Content

  • bittrex/APIBittrex.php: API Class to access all API from Bittrex, public and private account
  • poloniex/APIPoloniex.php: API Class to access all API from Poloniex, public and private account
  • poloniex/APICrytoWatch.php: API Class to access all data from datacharts
  • btcchina.php: Script to trade BTC/CNY on BTCchina web exchange

Configuration

  1. Set API environment variables

You need to create enviroment vars with the API key and API secret

~$ export [POL | BTT]_KEY="your API key"
~$ export [POL | BTT]_PASS="your API secret"
  1. Create poloniex database (Optional)

PSAR indicator and "import" scripts requires a MySQL database called poloniex.

  • Import poloniex.sql script to create database and the required tables:
~$ mysql -h your_host -u your_user -p < poloniex/poloniex.sql
  • Set database access environment vars
~$ export DATABASE_HOST="localhost"
~$ export DATABASE_USER="your_username"
~$ export DATABASE_PASS="your_password"

Poloniex public samples

# Get all currency pairs
~$ php poloniex_get_all_currencypairs.php

# Get information about a pair
~$ php poloniex_get_ticker.php BTC_ETH

# Find first 10 ask orders with more than 1000 ether in Poloniex
~$ php poloniex_find_big_orders_book.php BTC_ETH SELL 1000 10

Poloniex private account samples

# Get all your balances
~$ php poloniex_get_my_balances.php 

# Place an order to BUY ether with all your BTCs in your account at the price 0.03141592 in Poloniex
~$ php poloniex_post_order.php BTC_ETH BUY all 0.03141592 

# Cancel all orders, SELL or BUY
~$ php poloniex_cancel_order.php BTC_XMR all

Autotrader samples

  • Autotrade calculating trend price using PSAR indicator in ETH/BTC pair with all your available amounts checked each 300 seconds with PSAR values between 0.02 and 0.2 with the buy threshold at 0.001 and the sell threshold at 0.002
~$ poloniex_autotrader.php BTC_ETH all 300 0.02 0.2 0.001 0.002
  • Autotrade in ETH/BTC pair with 1 ether at 0.0005 different from last trade to buy and at 0.001 different from last trade to sell
~$ poloniex_autotrader_schedule.php BTC_ETH 1 0.0005 0.001

Requirements

  • PHP
  • MySQL for Poloniex

License

The source code for the web project is licensed under the GPL version 3 or later (see LICENSE).

scripts-to-trade-cryptocurrencies's People

Contributors

davizalpe avatar

Watchers

James Cloos avatar Shadow 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.