Skip to content
Clément edited this page Jun 11, 2019 · 3 revisions

Welcome to the influx-crypto-trader wiki!

Getting started

Required

You should first install influx crypto watcher and follow the getting started (setting up grafana, influx docker + create your first watcher on binance BTC/USDT and write data into influx)

Install dependencies

npm install

Start api

npm start

Create your first trader (binance, BTC/USDT) using the strategy example.ts and 2 indicators (sma6h and it's variation on 1h)

curl --request POST \
  --url http://localhost:3004/traders \
  --header 'content-type: application/json' \
  --data '{
      "name": "backtest",
      "test": true,
      "strategie": "example",
      "stratOpts": {},
      "capital": 1000,
      "percentInvest": 0.25,
      "base": "BTC",
      "quote": "USDT",
      "exchange": {
        "name": "binance"
      },
      "env": {
        "watchList": [
            {"base": "BTC",
            "quote": "USDT",
            "exchange": "binance"
            }],
        "aggTimes": ["15m", "1h", "1d"],
        "warmup": 1500,
        "batchSize": 10000,
        "bufferSize": 5000,
        "backtest": {
            "start": "2018-04-15 00:00:00",
            "stop": "2018-05-15 00:00:00"
        },
    	"candleSetPlugins": [
        {
          "label": "sma6h",
          "opts": {
            "name": "sma",
            "period": 360,
            "key": "close"
          }
        },
        {
          "label": "var1hsma6h",
          "opts": {
            "name": "diff",
            "period": 60,
            "key": "indicators.sma6h"
          }
        }
      ]
  }
}'

Then go to grafana (http://localhost:3001/):

  • Configure data source

datasource

  • import the dashboard given in "grafana/dashboard/cypto-trader.json" and watch your portfolio history, buy/sell

You can easily customize the dashboard to fit your need

dashboard

Clone this wiki locally