How to Use a DotEnv File to Control TradingBoat

Introduction

In this section, you will learn how to control TradingBoat using environment variables in a DotEnv file.

TradingBoat consists of several software components, such as TBOT, Redis, TVWB (Flask), and NGROK. These components can either run as part of the Docker-based TradingBoat or on other cloud computing platforms, such as Amazon AWS and Google Cloud

You can also use TBOT, Redis, and TVWB with Nginx instead of NGROK, for instance, on Amazon Cloud or Raspberry Pi 4. As a result, each component must be configured individually and consistently. This guide will demonstrate how to use environment variables for this purpose.

The DotEnv file utilizes the Python DotEnv package.

Consequently, whenever the application restarts, it reads the environment variables and adopts the new values.

How to Use a DotEnv File to Control Tradingboat

The environment values in ib-gateway-docker are used by the Docker version of TradingBoat. The Docker image is based on the original project found at https://github.com/UnusualAlpha/ib-gateway-docker , but has been modified to work with TBOT on Tradingboat. The customized version can be found at https://github.com/PlusGenie/ib-gateway-docker .

Similarly, the TVWB is based on the framework found at https://github.com/robswc/tradingview-webhooks-bot , which is a framework for trading with TradingView webhooks, but has been modified to work with TBOT in Tradingboat. The customized version of this framework can be found at https://github.com/PlusGenie/tradingview-webhooks-bot .

You can find the TBOT on Tradingboat application at https://github.com/PlusGenie/tbot-tradingboat It will soon be made public.

The following table lists the environment variables used by TBOT on Tradingboat, organized by category and variable name.

These environment variables control most of the applications on Tradingboat, as shown in the accompanying pictures.


Environment Variables Table

The below environment Variable has 4 categories, such as ib-gateway-docker, TVWB, TBOT and ngrok-docker

Environment variables under the category of both ib-gateway-docker, and ngrok-docker are only needed when you use Docker technology.

Environment variables under the category of both TVWB and TBOT can be used independently of Docker and then two categories can be together

The Environment Category ib-gateway-docker

For more information about the environment variables used in ib-gateway-docker, please refer to https://github.com/UnusualAlpha/ib-gateway-docker

The Environment Category ib-gateway-docker Table

The Environment Category ngrok-docker

For more information about the environment variables used in the ngrok Docker image (ngrok-docker), please visit

GitHub - wernight/docker-ngrok: An Ngrok v2 container based on wizardapps/ngrok and fnichol/ngrok

The Environment Category ngrok-docker Table

The Environment Category TVWB and TBOT

Environment Variables belonging to the category TVWB and TBOT are developed for TBOT application.

please refer to the description for each variable.

Environment Category TVWB table
Environment Category TBOT table

Further details and procedures, I highly recommend referring to the comprehensive Udemy course available here: Link to Udemy Course.

Subscribe to TBOT on TradingBoat

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe