Home

Awesome

ccxt-trading-cp

Console Cryptocoin Trading CP based on CCXT

This tool provides simple UI wrapper around some functionality from an amazing CCXT library

What can it do?

This tool provides console UI to:

Disclaimer

This tool is published with 0 liability. By using it, you accept the possibility that an order will be placed incorrectly, that you will sell what you didnt mean to sell and even that you may lose money by withdrawing into somebody else's or non-existing wallet.

That being said, I hope this will not happen. I made this tool for myself and I am glad to share it, but I reject any liability whatsoever for wrong API commands being sent. I recommend to set IP whitelist and disable API withdrawal until you read the whole code of ccxt, this package and all the 100+ packages these 2 reference and require. Never trust somebody else with your API keys/secret.

Getting Started

Installation is straight forward and requires getting copy of ccxt-trading-cp, installing modules it depends on and modifying config.json file

Prerequisites

You will need Nodejs 7.6+ and NPM.

Installing

The easiest way is from ccxt-trading-cp in NPM

npm install ccxt-trading-cp

After that edit config.default.json file and save it as config.json file in project root folder.

mv config.default.json config.json && nano config.json

This is a config JSON file where you have to provide API keys and secrets. Place all these into exchanges_unencrypted array, every item is an object which has:

{
  "exchanges_unencrypted": [
    {
      "exchange": "binance",
      "apiKey": "XXXXXXXXXXXXXXXXXXXXXXXXX",
      "apiSecret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    {
      "exchange": "bittrex",
      "inactive": 1,
      "apiKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "apiSecret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
  ],
  "exchange_for_fiat": "okcoinusd"
}

There is also exchange_for_fiat property which is used only for fetching BTC/USD OCHLV chart and USD price of BTC.

Every time you add new exchange, insert it inside exchanges_unencrypted array. ccxt-trading-cp has ability to encrypt API key/secret credentials, but this can be done only from inside the app. First time you must enter it in plaintext and then select the option to encrypt config file from within the main menu.

Never modify exchanges_encrypted property.

Command line args

I suggest making file executable and running it as:

./tradingcp.js [ARGUMENTS]

Note that exchange option is taken as default, so you can use

./tradingcp.js [ARGUMENTS] ETH

to show ETH/BTC exchange section.

Options

Tested exchanges

I myself am using the following exchanges without any issues

in theory it should work with many others, but I have not tested them. Some exchanges are limited in API possibilities, so they are just not suitable for this CP.

CCXT exchange module requirements

In order for exchange to work, CCXT exchange module must support:

Optionally fetchOCHLV() function is useful to show some simple charts.

Contributing

for now I have no special contribution rules, if you have any interesting changes, feel free to open issue or submit pull request.

Versioning

I pretty much make up version numbers as I want to for now.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments