that-guy
v0.0.3
Published
Genetic cryptocurrency trading bot
Downloads
3
Readme
👈🏻 That Guy (AKA Steve Castle)
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
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 beTHAT_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):
- Accumulation Distribution Line (ADL)
- Average Directional Index (ADX)
period=14
- Average True Range (ATR)
period=14
- Bollinger Bands (BB)
period=20
stddev=2
- Commodity Channel Index (CCI)
period=14
- Force Index (FI)
period=14
- Know Sure Thing (KST)
period=14
rocper1=10
rocper2=15
rocper3=20
rocper4=30
smrocper1=10
smrocper2=10
smrocper3=10
smrocper4=15
- Moving Average Convergence Divergence (MACD)
fast-period=12
slow-period=26
signal-period=9
- On Balance Volume (OBV)
- Parabolic Stop and Reverse (PSAR)
steps=0.02
max=0.2
- Rate of Change (ROC)
period=14
- Relative Strength Index (RSI)
period=14
- Simple Moving Average (SMA)
short-period=3
long-period=14
- Stochastic Oscillator (KD)
period=14
signal-period=14
- Triple Exponentially Smoothed Average (TRIX)
period=14
- Volume Weighted Average Price (VWAP)
- Exponential Moving Average (EMA)
short-period=3
long-period=14
- Weighted Moving Average (WMA)
period=14
- Wilder’s Smoothing (Smoothed Moving Average, WEMA)
period=14
- WilliamsR (WPR AKA W%R)
period=14
👨👩👧👦 Evolving the genetic algorithm
The process of genetic algorithm works as follows:
- Create a handful of random set of indicators to use
- Run That Guy against an archived market data (from the same exchange and currency pair it's intended to be use later)
- 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
- 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?
- If the number of generations is high enough stop and save the config.
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 libraryanandanand84
and contributors for comprehensive technical indicators libraryautonio
for building the first usable GUI allowing to create crypto algos and some sensible defaults