that-guy

0.0.3 • Public • Published

👈🏻 That Guy (AKA Steve Castle)

npm npm JavaScript Style Guide

Genetic cryptocurrency trading bot

Supports 45 crypto exchanges (see exchanges command), 20 technical indicators and genetic config generation.

Awesome. Awesome to the max.

💰 Donations

  • BTC: 1K7Uc9MDzokCGEsUxrQQXn59VQ1Q9AWGvZ
  • BCH: 1BHM8oACVN6F4xksXAAP3nR9EoAkfd8sGF
  • ETH: 0x8CcA7589d8061ad4D3D913412d1EAD71cbEae081
  • LTC: LRJ4Evzmyynp8Uswiy7e2uWhPKBNiSHroq

⚠️ Disclaimer

You take full responsibility for actions of this bot. Any loss of money, getting banned from an exchange or blocked by ISP are on you.

Please start with running against existing market data first before you use it with a live exchange.

🏃 Running

Quickest way is to use Docker (first you need to install it for your operating system):

$ docker run --rm suda/that-guy COMMAND

backfill

Gets history data from the exchange for the specified pair and stores in data/EXCHANGE/CURRENCY,CURRENCY/TIMESTAMP_FROM-TIMESTAMP_TO.csv file.

$ docker run --rm -v ${PWD}:/data suda/that-guy \
  backfill <exchange> --days 7 <fsym> <tsym>

Options

--days

Number of days to back fill. Default: 6.

backtest

Runs trading settings against backfilled market data.

$ docker run --rm -v ${PWD}:/data suda/that-guy \
  backtest <exchange> <fsym> <tsym>

Takes the same arguments as Live Trading except for exchange credentials.

Report will be printed on the stdout in a key: value format for easier parseability.

live

Runs the current settings against live market. This actually creates buy/sell orders.

$ docker run --rm suda/that-guy \
  live <exchange> --api-key API_KEY --api-secret API_SECRET <fsym> <tsym>

Options

<exchange> required

Specify the id of exchange you want That Guy to trade on. You can see the full list using the exchanges command.

  • -k, --api-key

Exchange API key.

  • -s, --api-secret

Exchange API secret.

  • -u, --uid

Exchange UID.

  • -l, --login

Exchange login.

  • -p, --password

Exchange password.

<fsym> required

From currency symbol.

<tsym> required

To currency symbol.

-f, --from-start-balance

Start balance of the first currency/cryptocurrency pair. Defaults to whole balance for this symbol.

-t, --to-start-balance

Start balance of the second currency/cryptocurrency pair. Defaults to whole balance for this symbol.

-i, --interval

Specify how often to make decisions. Default: 15m.

-o, --stop-loss

Loss percentage at which to sell. Default: 50.

-r, --take-profit

Profit percentage at which to sell. Default: 50.

-e, --exchange-fees

Percentage of exchange fees. Default: 0.25.

Specifying indicators

  • CLI: --adl --adx-period=14 --bb-period=20 --bb-stddev=2 (passing indicator arguments enables it by default)
  • Environment variables:
THAT_GUY_INDICATORS_ADL
THAT_GUY_INDICATORS_ADX_PERIOD=14
THAT_GUY_INDICATORS_BB_PERIOD=20
THAT_GUY_INDICATORS_BB_STDDEV=2
  • YAML:
indicators:
  - adl:
  - adx:
    period=14
  - bb:
    period=20
    stddev=2

List of available indicators.

exchanges

Lists all supported exchanges.

pairs <exchange>

List pairs supported by exchange.

Passing options

All options can be specified in one of the three ways:

  • CLI arguments as described above
  • Environment variables. Name of the variable will be uppercased, separated with underscores and prefixed with THAT_GUY, i.e. --exchange-fees will be THAT_GUY_EXCHANGE_FEES
  • YAML file passed with -c/--config CLI argument

When specifying the YAML file, it must be accessible inside the Docker container. Either by building a custom image based on this one or by mounting it with -v Docker flag.

🤔 Available indicators

List of all available indicators (name, shorthand and default values of arguments):

👨‍👩‍👧‍👦 Evolving the genetic algorithm

The process of genetic algorithm works as follows:

  1. Create a handful of random set of indicators to use
  2. Run That Guy against an archived market data (from the same exchange and currency pair it's intended to be use later)
  3. Comparing results of the sets and picking the winner
  • if That Guy exits with non-zero code ignore this set (it's probably invalid/out of bounds)
  • the highest return the bigger change of survival
  1. Introduce mutation
  • from the winners, create another set by randomly changing few arguments
  • add some cross breeding by copying parts of winners with other winners?
  1. If the number of generations is high enough stop and save the config.
  2. GOTO 2

📊 Generation statistics

For every generation/set pair, config file is created at reports/:generation/:set_id.yml as well a summary file in reports/:generation/summary.csv. Those summaries can be used to visualize how different indicators and their arguments were being used. Useful statistics to pull out of them:

  • Return per generation
  • Used indicators per generation
  • Original strain/family?

📜 License

This bot is licensed on GNU GPLv3.

🙇 Thanks

  • ccxt team for creating this amazing library
  • anandanand84 and contributors for comprehensive technical indicators library
  • autonio for building the first usable GUI allowing to create crypto algos and some sensible defaults

Package Sidebar

Install

npm i that-guy

Weekly Downloads

1

Version

0.0.3

License

GPL-3.0

Unpacked Size

46.8 kB

Total Files

16

Last publish

Collaborators

  • suda