npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

that-guy

v0.0.3

Published

Genetic cryptocurrency trading bot

Downloads

10

Readme

👈🏻 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