Cornix-tv-channel
Tradingview forwarder optimized for cornix.
π‘ About
This project is a highly customizable webhook server which is optimized to use with cornix. It has an API where you can set up different channels and set a strategy for the entry, take-profit, and stoploss price.
π Getting started
β‘οΈ Requirements
In order to use ctvc (cornix-tv-channel) you need
- a server (preferably linux)
- public IP
- either port 80 or 443 available
π± Prerequisites
- create a telegram bot, see here
π§βπ» Deployment
π³ Docker
Docker can be used for quick and easy deployment.
To install docker
and docker-compose
, take a look at this and this.
Create the docker-compose.yml file
---
version: '3.7'
services:
ctvc:
image: jon4hz/cornix-tv-channel
restart: unless-stopped
hostname: ctvc
container_name: ctvc
ports:
- '80:3000'
volumes:
- ./data:/data
environment:
TELEGRAM_TOKEN: 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw # you telegram bot token
REGISTRATION: true # enables user registration
LOG_LEVEL: info # set the log level, (debug,info,warn)
DATABASE_DEBUG: false # enable debug mode for the database
Excute the service
docker-compose up -d
Stop the service
docker-compose down
π¦ Binary
Every github release has binaries attached for the following operating systems:
To run ctvc as a binary follow those steps:
- Download the release for your system and unzip the executable
- Place it in a folder where you can run it. A subfolder is created for the database
- Set either the required environment variables or write a config file
- Run the executable
π©βπ» Build locally
Since the code is fully open source, you can also build the binary yourself.
As a prerequisite, please configure your go development environment and enable go modules.
- Clone the repository
git clone https://github.com/gibigo/cornix-tv-channel
- Change direcory
cd cornix-tv-channel
- Download all go modules
go mod download
- Build the binary
go build .
- Set either the required environment variables or write a config file
- Run the binary
./cornix-tv-channel
π± Environment variables
Variable |
Required? |
Description |
TELEGRAM_TOKEN |
yes |
The token from your telegram |
REGISTRATION |
yes |
Whether user registration is enabled or not. If you don't want other users on your server, set this to false after creating your own user |
LOG_LEVEL |
no |
Default: "info", the log level of the service. Other options: "debug", "warn" |
DATABASE_DEBUG |
no |
Default: "false", enables the debug mode for the database |
π Config file
If you prefer to use a config file instead of environment variables, you can create one at config/config.yml
Example
---
registration: true
database:
debug: false
logging:
logLevel: info
telegram:
token: 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw
π Secure connection
In order to have a secure connection to the server a reverse proxy with a letsencrypt certificate (e.g. traefik,caddy or swag) is recommended.
π¨βπΌ Usage
Once ctvc is up and running, you can take a look at the swagger documention which is located at http://yoururl/swagger/index.html.
You will need these API endpoints to configure your channel.
- Create your user
- Create a channel
- Create a strategy for the new channel
- Ensure that the previously create telegram bot is in your channel
- Point the webhook url on trading view to http://yoururl/webhook/v1 or https://yoururl/webhook/v1 if you use a reverse proxy.
- Set the message to
{
"user": "<your_username>",
"uuid": "<your_users_uuid>",
"ticker": "{{ticker}}",
"price": {{close}},
"exchange": "{{exchange}}",
"direction": "<long/short>",
"tgChannel": <yourTelegramsChannelID>
}
and replace all values in "<>"
π Licensing
This project is released under the GPLv3-License found in the LICENSE file.
π€© Contribute
This is an open source project which welcomes any kind of contributions.
Contributors
π€ Donate
Feel free to support my development if you like it.
Crypto
XMR: 82jT8bSjxpdQAJoDBv2ChA97FzwgvH9e7PrmukiroxrDduxkCJpoWNSJqAjZ7S4jJ1aFzHxnud4xYb3peNq6qLwo4irT7mv