controller

command
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Command controller runs xtrader: the agents of its database, launched and stopped as they are enabled, served on the web dashboard and on Telegram, with the settings of the controller on the dashboard. Its configuration is config.yml (see package config), everything else is in the database:

go run ./cmd/migrator -config configs/config.yml up   # once, and after each update
go run ./cmd/controller -config configs/config.yml

The agents get their settings from the internal API of the controller, on the loopback (agents.api of config.yml), each start with a token of its own, and keep their orders, decisions and journal through it: the controller alone reaches the database, and an agent only reaches its own settings. The lines of the agents are shown prefixed with their name.

The dashboard needs a user of the database: bootstrap in config.yml creates the first one on an empty database. Telegram, its token and the users it answers, the agents, their prompts and the users are set on the dashboard, applied at once: an agent enabled is launched, one disabled stopped, a prompt switched from the next analysis of the agent.

services of config.yml are the processes of the host the agents need, eg: the bridge of MT5 out of a container, launched before the agents and stopped after them.

The whole stop, on SIGINT or SIGTERM, takes shutdown_timeout of config.yml at most: past it, whatever still runs is killed. On Linux the agents and the services stop with the controller, even killed, and their pidfiles in data/pids of agents.dir make the next start stop what a controller killed left running elsewhere, before it launches anything.

Jump to

Keyboard shortcuts

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