tvbit-bot

tvbit-bot is TradingView webhook handler for Bybit.
tvbit = T(rading)V(iew) (By)bit
Twitter @rarirureluis
Introduction
- First of all, register you account. See
PUT /setting
- Enable Webhook
https://<domain>/tv
- 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%"
calculate from mark price.
"tp": "+40", "sl": "-20"
means, TP: mark price + 40
and SL: mark price - 20
.
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 |
/wallet |
GET |
Get your wallet balance |
PUT /setting
Register your account.
Why you have to register an account?
tvbit-bot fetch your wallet balance and save it to DB. cron.go
Request body
{
"is_testnet": true,
"dex": "bybit",
"api_key": "",
"api_secret_key": "",
"start_time": "09:00",
"stop_time": "23:00"
}
dex
must be lowercase.
start_time
end_time
is optional.
[WIP] GET /setting
Get your setting.
Response
{
"api_key": "",
"api_secret_key": ""
}
Setup
You can change listen port with PORT
environment variable.
Docker
ghcr.io/rluisr/tvbit-bot:latest
Binary
Release page.
MySQL
tvbit-bot requires MySQL for storing user setting and wallet balance histories.
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
TODO
There are no plans to support bybit/options/spot trading and other DEX.
- [bybit/core] Futures
- [bybit/core] USDC
- [bybit/wallet] Deriv
- [bybit/wallet] USDC
- [core/binance]