Not all products mentioned are available in all jurisdictions.

Futures DCA (Martingale)

Published on Apr 27, 2023Updated on Sep 23, 202411 min read

Introduction to OKX Futures DCA Bot

The Martingale strategy is commonly used in situations such as forex and futures trading. Futures DCA is a trading bot that uses the Martingale strategy for futures trading. It allows traders to automate their trades based on these principles.

What is the difference between Dollar-Cost Averaging (DCA) and Martingale strategy?

Dollar-Cost Averaging (DCA) is an asset management strategy. It involves splitting one-off positions at multiple price levels to get a better average entry price when the market moves against the initial trade, and exiting the trade when the Take Profit target has been met.

Martingale is one form of DCA. Martingale is a trading strategy based on the concept of doubling the trading size after every loss. With a doubled position size each time after losses, the size of the next profitable trade will exceed the combined losses of all previous trades with additional profit. In simple terms, if you lose a trade, you double your next trade to recover your losses and hope to make a profit.

The Martingale strategy may potentially earn long-term growth by taking the fluctuating profit from cycles of rebound (if trading in a long direction), or correction (with short direction), with the aim to minimize losses on the overall purchase.

How does OKX Futures DCA Bot work?

The Futures DCA trading bot is considered a fit for volatile (significant but short-lived movements) markets, but also works with sideways (trendless) markets as long as the short-term rebounds or corrections exist. With the concept of the trading cycle, Futures DCA can earn profit over multiple trading cycles.

The Futures DCA bot is best used in high-risk, high-reward situations, especially when your strategy is to attempt to earn profits from rebounds in a volatile market but want to save the time for tracking and eliminate the hassle of configuring a series of averaging orders manually. It can also be used if you have a high degree of confidence in the ultimate direction of a particular asset, and want the flexibility to gain better entry positions based on technical indicators, or customize the price step or volume multipliers on safety orders. By doubling your position size after each losing trade, you may recover your losses if the market eventually moves in your favor.

How to get started

Web: Navigate to Trade, select Trading bots - Marketplace, and click Futures DCA.

spot grid 1
futures dca 1

App: Navigate to Trade, select Trading bots, and press Futures DCA.

futures dca 2

Enter parameters manually, copy lead traders' bots, or use backtested AI parameters, and confirm the total investment amount to create a Futures DCA bot (After you create a bot, the initial funds will be isolated from your Trading account and used for bot trading only).

Setup Options

futures dca 4
  • Set myself: Set parameters based on your own analysis of the market.

  • Set myself - Auto fill: Automatically fill in parameters recommended by the trading bot, based on backtested strategy.

  • AI strategy: Use the parameters recommended by backtested strategy (These parameters are based on a weekly backtest of this pair).

  • Lead bots: Copy lead traders' winning bots on the Marketplace in one-click.

DCA Trading Parameters

futures dca 5
  1. Price steps: Percentage difference between two consecutive safety orders, denominated in quote currency

  2. TP target per cycle: When the TP price is triggered and the order is fully filled, the bot will end the current cycle index and start the next one as specified

  3. Initial order margin: First order initiated by the DCA bot at the start of each trading cycle

  4. Safety order margin: Safety orders will trade incrementally in each trading cycle, to lower the average cost of the trading pairs being traded, and help to achieve the take profit target faster.

  5. Max safety orders: The maximum number of safety orders that can be placed in a trading cycle. Actual number of placed safety orders may be determined by your margin situation.

  6. Auto-transfer margin: When the margin level reaches a high-risk threshold, the auto-transfer margin feature will automatically transfer funds from your trading account to your bots to prevent forced liquidation. Specify the maximum amount that can be additionally transferred from the trading account to the bot.

  7. Amount multiplier: Applied to the investment amount for placing the next safety order. It affects the aggressiveness in averaging the entry prices of your investments. For example, with a safety order amount = 100 USDT, multiplier = 2. Safety orders will be placed:

    1. 100 = (2^0 × 100)

    2. 200 = (2^1 × 100)

    3. 400 = (2^2 × 100), et cetera

  8. Price steps multiplier: Applied to the price step for placing the next safety order. It increases or decreases the price gap between safety orders.For example, with a price step = 1%, multiplier = 2. Safety orders will be placed when the price changes:

    1. 1% = (0 + 1 × 2^0)%

    2. 3% = (1 + 1 × 2^1)%

    3. 7% = (3 + 1 × 2^2)%, et cetera

  9. Stop condition:

    1. End of cycle: Stop bot once the first cycle ends

    2. Price: Stop bot once the last price reaches trigger price

Managing your Futures DCA bot

Web: Head to OKX Trading Bots homepage, and select 'My bots'. You will be brought to a Bot Dashboard where you can manage your running bots.

bot management 1
futures dca 6

App: Head to OKX Trading Bots homepage, and select 'My bots'. You will be brought to the "My bots" page where you can manage your running bots.

bot management 2

Futures DCA bot management features

futures dca 6
  1. Stop your bot: When you stop this bot, the system will cancel all pending orders and sell your crypto at market price. Funds from the sale will be returned to your trading account.

  2. Details: View more details about your running bot by accessing the Bot Details page.

  3. Replicate parameters: One-click set-up to recreate your running bot with the same parameters.

  4. Add manual orders: In the event when all safety orders were filled, we allow users to place additional manual orders to further lower down the average cost

  5. Adjust margin: Transfer additional margin from your trading account to your bot in advance, to avoid potential risk of liquidation in black swan events.

  6. Auto transfer margin: When the margin level reaches a high-risk threshold, the auto-transfer margin feature will automatically transfer funds from your trading account to your bots to prevent forced liquidation. Specify the maximum amount that can be additionally transferred from the trading account to the bot.

Case Example

futures dca 3
  • Trading Pair: BTCUSDT Perpetual (Assuming current price is $25,000)

  • Direction: Long

  • Leverage: 5x

  • Price steps: 2%

  • TP target per cycle: 5%

Running the Bot

Stage 1 - Initial order placement: The system creates a new DCA cycle and calculates the price of each safety order from the price of the initial order ($25,000), according to the predefined price step (2%) set by the user, for instance, $24,500, $23,750... The system will also calculate the Take Profit price from the initial order, for instance, $26,250, which will be the TP order of the DCA bot.

Contract price

Price step (%) / TP target %

Average price / Profit

$25,000

-- (Initial order)

$25,000

$24,500

-2% (Safety order #1)

$24,750

$23,750

-4% (Safety order #2)

$24,166.67

$26,250

+5% (Take Profit target)

$26,250 - $24,166.67 = $2,083.33

Stage 2 - Bot operation: The bot initially buys one BTC contract at $25,000. If the price of BTC drops 2% to $24,500, the bot will automatically buy another contract at this lower price point, bringing the average entry price of the two contracts to $24,750. If the price drops an additional 4% to $23,750, the bot will buy another contract, bringing the average entry price of the three contracts to $24,166.67.

Now, if the price of BTC bounces back to $25,375 and reaches your 5% take-profit order, the martingale will sell all three contracts for a profit and then start a new cycle.
The Futures DCA strategy can be an effective way to recoup losses and make a profit for users who want to engage in a high-risk, high-reward strategy. Futures DCA enables traders to automate this strategy in futures trading, making implementing it easier and more efficient. However, it is important to use this strategy cautiously and set up stop-loss orders to manage risk. By using Futures DCA, traders can take advantage of the Martingale strategy while minimizing potential losses.

Risk reminder and notes

  1. Risks related to market condition: Using this strategy, the amount spent on trading can increase rapidly and reach a high value after just a few transactions. This is exacerbated if the price of an asset continues to fall for a prolonged period of time. If a trader continues to double their trades, the probability of loss is infinite. If a trader runs out of funds and exits the trade while using the strategy, the losses faced can be quite high. In addition, the risk-to-reward ratio may not be reasonable for every trader. While using the strategy, higher amounts are spent with every loss until a win, and the final result may only be to break even. Further, if an asset continues to fall in value, there is a chance it could fall to zero, in which case the entire value of the trader's holdings would be lost. It is important to be aware of the risks involved and to have a solid risk management plan in place. For example, it is important to set up stop-loss orders to limit potential losses.

  2. Risks related to high leverage: While high leverage can be an advantage in the right market conditions, it can also amplify losses if the market moves against your position. It is important to use leverage responsibly and to understand the potential risks before trading with high leverage ratios. OKX is entitled, in our absolute discretion, to close one or more or all of your positions.

  3. Risks of liquidation: The use of high leverage can result in a substantial impact on a trader's account balance in the event of a significant price movement against their position. In futures trading, if a trader's margin balance drops below the necessary maintenance margin level, we may liquidate their position to avoid further losses. This may lead to the complete loss of the trader's initial funds. To minimize the risks associated with using Futures DCA, it is critical for traders to comprehend these risks and establish a reliable risk management plan. To avoid the risk of liquidation, traders should consider implementing appropriate stop-loss orders and closely monitoring their account balance.