Getting Started

Configuration

config.yaml File

Trademade's configuration is loaded from the config.yaml file.

Windows

On Windows, you'll find the config.example.yaml file in the Trademade installation directory. Trademade will use the working directory to store its database as well as log files. You can copy config.example.yaml to the working directory and rename it to config.yaml.

Linux

On Linux, the Ubuntu package installs to /opt/trademade. The example configuration file is in /opt/trademade/conf. You should create a trademade directory somewhere on your system (e.g. /home/<user>/trademade) to use as the working directory. Copy (and rename) the config.example.yaml file to this working directory.

Editing config.yaml

Using your favorite text editor, open up config.yaml. There are a quite a few YAML tutorials if you're not familiar with the syntax. You'll need to set a few of the parameters.

Core configuration

In YAML, comment lines begin with the # character. Uncomment the account: parameter and set it to the default Interactive Brokers account you'd like for Trademade to use when placing orders. If it's your first time using Trademade, it's best to start with your paper trading account to get a feel for how it works.

Uncomment the token: parameter and set the value to the access token field on the trademade.io account dashboard.

Uncomment the telegramUser: field and set the value to your Telegram user name. The bot will not respond to any messages from any users other than the one you define here.

Uncomment the telegramBotToken: parameter and set the value to the token you received from BotFather when creating your new bot in the Prerequisites step.

Check the twsPort: field and ensure that it's using the same value defined in your TWS API settings.

If the pause: parameter is set to false, the engine will be paused at startup and bots will not enter any new positions.

Bot configuration

Scroll down in the config file and find the bots: parameter. This is where you'll define your bots. A basic example bot has been defined in the example config to get you started. In YAML-speak, bots are defined as an array of dictionaries, for example:

bots:
  - name: 7D Put
    symbol: SPX
    type: Put
    quantity: 2
    targetDelta: -0.07
    profitTargetPercent: 0.8
    minDTE: 1
    maxDTE: 4
  - name: 3D Call
    symbol: SPX
    type: Call
    quantity: 4
    targetDelta: 0.03
    profitTargetPercent: 1
    minDTE: 1
    maxDTE: 4

This configuration defines two bots:

  • The first is named "7D Put" and will sell 2 7-delta SPX puts with a minimum DTE of 1 and maximum DTE of 4. A profit target is set at 80%, e.g. if the position is opened for $1, it will be closed for $0.20.
  • The second is named "3D Call" and will sell 4 3-delta SPX calls with a minimum DTE of 1 and maximum DTE of 4. The profit target is set to 100%, meaning this position will be held to expiration.

See the config.yaml reference for a listing of all parameters.

Next step -- running Trademade!

Previous
Installation