tvbit-bot

module
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: AGPL-3.0

README

tvbit-bot

lint

Japanese README

tvbit-bot is TradingView webhook handler for Bybit.

tvbit = T(rading)V(iew) (By)bit

Introduction

  1. Enable Webhook https://<domain>/tv
  2. Set an alert with webhook and a message as JSON like below:
{
  "is_test_net": true,
  "api_key": "",
  "api_secret_key": "",
  "order": {
    "symbol": "BTCUSDT",
    "type": "Market",
    "price": 0, // If type is "Limit" set it as an int greater than 0
    "side": "Buy",
    "qty": 0.014,
    "tp": "0", // see below
    "sl": "{{high}}" // see below
  }
}
TP and SL

You need to set tp and sl as a string.

{{high}} is an embedded value of TradingView, Also you can set any other TradingView's embedded values.
Other methods, you can set as a percent like "tp": "10%". The formula is (price * percent * 0.1 * qty) + price.
Note that this is calculated from the closing price one minute ago.

see tv.go or Bybit API Documentation.

Path

Path Method Description
/tv POST Create order
/setting PUT Update your setting
/setting GET Get your setting
PUT /setting

You can set the time of day creating order.

Default is all time.

Request body
{
  "api_key": "",
  "api_secret_key": "",
  "start_time": "09:00",
  "stop_time": "23:00"
}
GET /setting

Get your setting.

Request body
{
  "api_key": "",
  "api_secret_key": ""
}

Setup

You can change listen port with PORT environment variable.

Docker
$ docker run ghcr.io/rluisr/tvbit-bot:latest --name tvbit-bot -p 8080:8080 -d
Binary
  1. Download a binary from Release page.
  2. $ ./app
MySQL

tvbit-bot requires MySQL for storing user setting.

Set these environment variables:

  • MYSQL_HOST_RW
  • MYSQL_HOST_RO
  • MYSQL_USER
  • MYSQL_PASS
  • MYSQL_DB_NAME

tvbit-bot.hcloud.ltd

URL: https://tvbit-bot.hcloud.ltd/tv

I am offering this application for public use. But I am sure that I may betray you. You may use it for production operation, or you may try it only for testing.

Powered by HCloud Ltd

Terms of service

I accept no responsibility whatsoever.

Limitation

tvbit-bot does not support to close/cancel positions now.

Welcome your PR.

Twitter @rarirureluis

Jump to

Keyboard shortcuts

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