BITA

module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2022 License: Apache-2.0

README

BITA

CI-CD

Trading Bot based on Invest Tinkoff API

TradeBot logo

Documentation

Our documentation is available on GitHub Pages.

Installation

Clone this repository first, and we are ready to go.

$ git clone https://github.com/elkopass/BITA

This bot is fully configurable with environment variables using envconfig library.

You can find full list of them in our .env-example file.

Right before we started, obtain your Tinkoff Invest API token in settings and set it as follows: TRADEBOT_TOKEN=<your_api_token>.

Using Docker

Running trade-bot in a Docker-container is a preferable way.

$ cp cmd/trade-bot/.env-example cmd/trade-bot/.env
$ vim cmd/trade-bot/.env # make sure to reconfigure it with your own data!
$ docker-compose up --build
Manual

Let's set and export env variables first:

$ cp cmd/trade-bot/.env-example cmd/trade-bot/.env
$ vim cmd/trade-bot/.env # make sure to reconfigure it with your own data!
$ export $(grep -v '^#' cmd/trade-bot/.env | xargs)

After that, you can build binary and run it using go v1.16+ as follows:

$ go build -v -o trade-bot ./cmd/trade-bot
$ ./trade-bot

Visualization

It is very important to create alert rules on key trade actions to prevent possible money losses

This is why our service exports a lot of useful metrics for you to configure your own monitoring.

Check out our cool Grafana dashboard >> here <<

You can always download and import the latest version from JSON file for your own installation.

Contributing

If you want to support this project, check our contributing guideline.

Disclaimer

The developers are NOT RESPONSIBLE for any financial losses incurred during the use of the trading bot.

This project is released under the Apache License. See LICENSE for details.

Directories

Path Synopsis
cmd
internal
config
Package config stores global trade-bot configuration.
Package config stores global trade-bot configuration.
loggy
Package loggy is just a little zap-logger wrapper.
Package loggy is just a little zap-logger wrapper.
metrics
Package metrics stores all Prometheus metrics used by trade-bot.
Package metrics stores all Prometheus metrics used by trade-bot.
sdk
Package sdk represents internal proto-wrapper for Tinkoff Invest API.
Package sdk represents internal proto-wrapper for Tinkoff Invest API.
trade
Package trade is responsible for all trading logic.
Package trade is responsible for all trading logic.
trade/breaker
Package breaker stops trade worker if it violates its failure threshold.
Package breaker stops trade worker if it violates its failure threshold.
trade/common
Package common stores functions that can be used by all trading strategies.
Package common stores functions that can be used by all trading strategies.
trade/strategy
Package strategy enumerates available trading strategies to use.
Package strategy enumerates available trading strategies to use.
trade/strategy/crumble
Package crumble provides strategy based on moving average for a trade-bot.
Package crumble provides strategy based on moving average for a trade-bot.
trade/strategy/gamble
Package gamble provides naive strategy for a trade-bot.
Package gamble provides naive strategy for a trade-bot.
trade/strategy/tumble
Package tumble provides a trading strategy based on order book.
Package tumble provides a trading strategy based on order book.
trade/util
Package util stores some small and useful converters and formatters.
Package util stores some small and useful converters and formatters.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL