How to create a Tradingbot with Node.js and Express/Nest.js?

Hi Friends!

I just started an exciting tradingbot project. The goal is to create a Node.js server which is able to receive JSON data from Tradingview and then forward it to a crypto exchange.

Tradingview gives us the possibility to send trigger signals (JSON) automatically to the server which then forwards the signal via JSON to the exchange.

These are the steps to create this simple tradingbot:

1. Host a Node.js server on Heroku which is able to receive trigger signals from Tradingview and then forward these signals to the exchange.

2. Create a simple authentication login area, where we can paste our API_SECRET key and API_PUBLIC key to be able to connect to the exchange.

3. Fetch data from the exchange which is shown in the login area as a dashboard (current balance, open trades, open orders, preview orders etc.)

This is my first Node.js project so I already stuck in the first step (creating the server) and I would really apprechiate your help and thoughts to make this project work.

For now I have written this code:

const HOSTNAME = process.env.HOSTNAME || 'localhost';
const PORT = process.env.PORT || 3000;

const http = require('http');
const express = require('express');
const app = express();

// Create GET request
app.get('/', (req, res) => {
  res.send({ message: 'Hello World' });

// Create POST request'', (req, res) => {
  res.send({ message: 'JSON FILE TO CREATE BUY ORDER' });

// Server listen on port 3000
app.listen(PORT, HOSTNAME, () => {
  console.log(`Server running at http://${HOSTNAME}:${PORT}/`);

My questions:

  • How to receive a post request from TV?
    Here is the documentation from TV about webhooks. To receive the POST request from TV we need to create a API Endpoint in our Node.js application. How can we create this API endpoint?

  • How to forward the incoming trigger signals from TV to the exchange?
    In this example I am useing FTX as the exchange (link to the API docs from FTX). This is the REST endpoint URL:

I hope some people in the community are interested in following this project, because I have a lot of questions and stuck a lot here and there. With your help this could be a tutorial for other people who like to create a tradingbot with Node.js

Always apprechiate your help!!

Thanks for answers :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.