Skip to main content

Gunbot Headless Mode Operation

Info

Headless mode in Gunbot means running the software without its graphical user interface (GUI). This is often preferred for resource efficiency or when running Gunbot on servers.

This guide focuses on running Gunbot without the GUI and highlights the key config file areas you need. It is intentionally concise; for a complete reference of all settings, see the other documentation sections. If you're new to Gunbot, it is easier to configure the bot in the GUI first, then move to a headless setup if desired.

Introduction to the Config File System

Gunbot uses a central configuration file, config.js, for your trading setup. In this file you add exchange API keys, define trading pairs, and configure strategies. For a starting point, review config-js-example.txt in your Gunbot package, which shows a working config structure.

Gunbot dynamically adapts to changes in config.js while running. Edit carefully: keep valid JSON formatting and avoid removing required parameters. If you're unsure, validate the file with a JSON validator like JSONLint. Note: updating registered API keys is the only task that requires the GUI.

Disabling the GUI

If you decide to go headless, adjust the GUI settings in config.js as follows:

"GUI": {
"enabled": false,
}

Exchange Integration

To link Gunbot to your exchange, add the exchange details under the exchange section in config.js. Example for Binance:

"binance": {
"masterkey": "your_registered_api_key",
"mastersecret": "your_api_secret",
// Additional settings
},

Use different keys for registration and trading if needed. The masterkey and mastersecret are for your registered API key, while key and secret are for trading.

Setting Up Strategies

Define a strategy by naming it and adding it to the strategies section of config.js. Assign this strategy to your trading pairs as needed. For example:

"strategies": {
"myStrategy": {
"BUY_METHOD": "gain",
"SELL_METHOD": "gain",
// Other strategy settings
}
},

Pair Settings and Overrides

Each trading pair, its assigned strategy, and optional overrides are defined under the pairs section for the relevant exchange. For example:

"binance": {
"pairs": {
"BTC-ETH": {
"strategy": "myStrategy",
"enabled": true,
"override": {
"TRADING_LIMIT": 1000
}
},
// Additional pairs
}
},

Overrides let you adjust strategy parameters on a per-pair basis.