Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/hummingbot/hummingbot/llms.txt

Use this file to discover all available pages before exploring further.

Introduction

Hummingbot provides powerful frameworks for developing custom trading strategies. Whether you’re building simple market-making bots or complex algorithmic trading systems, Hummingbot offers flexible approaches to suit your needs.

Development Approaches

There are three main ways to develop custom strategies in Hummingbot:

1. Custom Scripts

The simplest approach for beginners. Scripts extend StrategyV2Base and implement custom trading logic.

Quick Start

  • Minimal boilerplate code
  • Direct market access
  • Ideal for simple strategies

Use Cases

  • Simple PMM strategies
  • Price monitoring
  • Basic arbitrage

2. Strategy V2 Framework

A modular architecture combining Controllers and Executors for complex strategies.
The V2 framework separates strategy logic (Controllers) from order execution (Executors), enabling reusable components and easier testing.
Key Components:
  • Controllers: Implement strategy logic and generate trading signals
  • Executors: Handle order execution, position management, and risk controls
  • RunnableBase: Base class providing lifecycle management

3. Traditional Strategies

Legacy strategy format (V1) using Cython for performance-critical components.
V1 strategies are being phased out in favor of the more flexible V2 framework. New development should use V2 or Scripts.

Architecture Overview

Core Concepts

RunnableBase

All V2 components inherit from RunnableBase, which provides:
  • Lifecycle management: start(), stop(), status tracking
  • Control loop: Asynchronous task execution at configurable intervals
  • Event handling: on_start(), on_stop(), control_task()
See RunnableBase source

Configuration

All strategies and controllers use Pydantic models for type-safe configuration:
class MyStrategyConfig(StrategyV2ConfigBase):
    exchange: str = "binance_paper_trade"
    trading_pair: str = "ETH-USDT"
    order_amount: Decimal = Decimal("0.01")

Market Data

Access real-time market data through:
  • Connectors: Direct exchange integration
  • Candles Feed: OHLCV candlestick data
  • Market Data Provider: Unified data access layer

Development Workflow

1

Choose Your Approach

Start with Scripts for simple strategies, or use V2 framework for complex logic
2

Implement Configuration

Define Pydantic config models with your strategy parameters
3

Write Strategy Logic

Implement on_tick() for Scripts or determine_executor_actions() for Controllers
4

Test with Backtesting

Use the backtesting engine to validate your strategy with historical data
5

Paper Trade

Test on paper trading exchanges before going live
6

Deploy Live

Configure with real exchange credentials and start trading

Next Steps

Custom Scripts

Learn to build simple strategies with minimal code

Strategy V2 Framework

Explore the modular V2 architecture

Controllers

Implement strategy logic with Controllers

Executors

Manage order execution and positions

Resources