/
Launch Hummingbot Miner

Overview

Learn how to use scripts


Offers dynamic bot controls by running a user defined script alongside a strategy.

Note: Currently, a custom script can only be used with pure market making strategy

Warning: Currently, Scripts can only be used when running Hummingbot from source or with Docker. Using this feature in the Mac or Windows installers will crash the bot.

Language

As with Hummingbot source code, the script is fully compatible with Python 3.7.

How it works

After configured, the script will start automatically once a strategy starts and it stops when the strategy stops. The script is run on a new dedicated process, in case where the script fails or has a bug, your main Hummingbot application can still function.

Create your own script

  1. Create a new script file, you can see examples in the Examples section below, and save it into scripts folder
  2. Configure your Hummingbot
    1. Inside Hummingbot run command config script_enabled and/or config script_file_path
    2. Editing conf_global.yml file using a text editor.
    script_enabled: true
    script_file_path: spreads_adjusted_on_volatility_script.py
  3. Start running a strategy

The following examples can be found in scripts\ folder.

  1. hello_world_script.py

    The most basic example only a few lines of code.

  2. ping_pong_script.py

    Replicates our current ping pong strategy using script.

  3. price_band_script.py

    Replicates our current price band strategy using script.

  4. dynamic_price_band_script.py

    Demonstrates how to set the band around mid price moving average, the band moves as the average moves.

  5. spreads_adjusted_on_volatility_script.py

    Demonstrates how to adjust bid and ask spreads dynamically based on price volatility.

  6. script_template.py

    Provides you a base template to start using the scripts functions

Edit on GitHub