Skip to main content
The DCA Executor builds a position in steps. You give it a list of price levels and an amount for each, and it places one order per level. The exit (take profit, stop loss, trailing stop or time limit) is measured against the average entry price of everything that filled.

Overview

Create one from Condor

Agents and the Condor chat use the create_dca_executor tool:
This buys $100 of BTC at 50,000, $100 at 48,000 and $150 at 46,000, closes everything at a 3% net profit on the average entry, and has a 5% stop loss. In an agent session, controller_id must be the session ID (see Session IDs).
Amounts here are in the quote asset, unlike the position executor, whose amount is in the base asset. amounts_quote and prices are parallel lists: entry i is an order of amounts_quote[i] at prices[i]. Condor rejects lists of different lengths.

Parameters

Modes

Levels are placed one after another, in the order of prices. The next level is placed only after the previous level’s order exists.

Exits

Every exit cancels the unfilled levels and closes the filled amount with a market order.
In MAKER mode the stop loss does nothing until every level has filled. If the price falls part way through a buy ladder and keeps falling without reaching the last level, the stop loss never triggers. Use a time_limit, or TAKER mode, if you need a bound in that case.

Via the API

Create the executor with POST /executors/. Unlike the position executor, the exits are top-level fields, not a triple_barrier_config.
The API also accepts activation_bounds, which the Condor tool doesn’t expose: a list of two fractions that controls when a level is placed. In TAKER mode it replaces the default 0.01% and 0.5%.

Close types

Besides the exits above, a DCA executor can end with:

Stopping early

Stop the executor with stop_executor or POST /executors/{executor_id}/stop:
  • keep_position=false (the default) cancels unfilled levels and closes the filled amount at market.
  • keep_position=true cancels unfilled levels and leaves the filled amount in the account.
A DCA executor stopped with keep_position=true ends as POSITION_HOLD, but the current Hummingbot API doesn’t add its fills to the Position Hold, so they don’t appear in list_positions_held or in an agent’s held positions. Track or close that amount yourself.

Learn more