Skip to main content

Bittrex currency exchange autotrading script in a nutshell.

Project description

Bittrex currency exchange autotrading script in a nutshell.

Installation

$ pip install bittrex_autotrader

Dependencies

To manually install the Python script dependencies, generate API documentation, and create a source distribution:

$ make

Configuration options

The following options can be passed as script arguments or defined in a file:

Option

Description

Example

Default value

apikey

Bittrex issued API key.

XxXxxXXxXxxXxxXxXxxXxXxxXXxXxxXx

secret

Bittrex issued API secret.

XxXxxXXxXxxXxxXxXxxXxXxxXXxXxxXx

market

String literal for the market.

BTC-XXX

BTC-LTC

units

BUY/SELL total units.

0

1

spread

BUY/SELL markup/markdown percentage.

0.0/0.0

0.1/0.1

method

Moving Average calculation method.

method

arithmetic

delay

Seconds to delay order status requests.

0

30

prompt

Require user interaction to begin trading.

False

True

Basic usage

To run the script:

$ ./bittrex_autotrader.py --conf bittrex_autotrader.conf

Assuming there are no open orders, the default configuration requires the user to decide the first type of trade;

1. BUY in at markdown (need units to trade)
2. SELL out at markup (need liquidity)

Enter your choice as a number or unique substring (Control-C aborts):

Make a choice then press Enter.

The script will then retrieve the latest market rates, calculate an asking price based on your configuration and submit an order to Bittrex.

Once an order has completed, the script will again retrieve the latest market rates and submit a new order of the opposite type.

If an order is cancelled (via the Bittrex Web UI), the script will recalculate based on the latest market rates and submit an order of the same type.

If the script is stopped and re-run while an order is outstanding, it will resume monitoring and continue as normal once the order is completed or cancelled.

Running as a service

If you wish to automate the running of the script (using Supervisor for example), set the ‘prompt’ configuration option to ‘False’.

On startup, the script will automatically check for an open order and wait for completion or cancellation before initiating an order of the opposite type.

If you do not have any open orders it will initiate a ‘SELL’ order by default. If you do not have enough funds to carry out this operation, the script will end.

Bittrex API

Outside of the basic trading functionality a full implementation of the Bittrex API has been provided for those would want to extend this script. Runnning make will generate the class HTML documentation.

Usage Example

#!/usr/bin/env python

from bittrex_autotrader import BittrexApiRequest

apiReq = BittrexApiRequest(apikey, secret)
ticker = apiReq.public_ticker(market)

print ticker['Ask']

Developer Notes

  • If you are new to cryptocurrencies please, and I stress, DO NOT USE THIS SCRIPT.

  • Certain markets are more volatile than others. It’s very easy to get priced out of a market, so choose wisely.

  • Based on the defined spread you can gain/lose units of value. I take no responsiblity for your losses.

  • New features will be added when I have free time available. You can motivate me by donating below.

Donations

If you find this script to be helpful in any way, buy me a beer using one of the cryptocurrencies below:

Bitcoin:  1Cvr9aHNmV2riULkfgEqofQtuhxCBe7A16
Litecoin: LcMKbewQftytYnmsGTk63BW7yPCnUKFNni
Digibyte: DPZNoKrH8wmY7QfR5aWrh84JheE4KwWsge

License and Warranty

This package is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.

Bittrex AutoTrader is provided under the terms of the MIT license

Bittrex is a registered trademark of Bittrex, INC

Author

Marc S. Brooks

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bittrex_autotrader-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

File details

Details for the file bittrex_autotrader-0.1.0.tar.gz.

File metadata

  • Download URL: bittrex_autotrader-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/20.7.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.12

File hashes

Hashes for bittrex_autotrader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 04c0080061c8b6cba00717073fef959a98e898166f47df3d69b877c93f055a04
MD5 0f22d3ff9b0f9e6f2a1540a8c2d9e880
BLAKE2b-256 0b2fb0666f4d18e0689e3f06f33262804192c2a7b8fe2ecc7319ecba9097aa27

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page