DCA Bot - Trigger Safety Orders with Signals

DATE PUBLISHED: AUG 13, 2024
7 MIN
DATE UPDATED: AUG 15, 2024

Average out trades using signal-based filters

Start Trading on 3Commas Today

Get full access to all 3Commas trading tools with free trial period

It's here! The long-awaited feature now allows traders to average out DCA bot trades not only by % deviations but also by using these deviations as filters, confirming them with built-in conditions such as RSI, Bollinger Bands, MACD, etc., or custom signals sent via Webhook.


Here’s how it works:

All safety order settings will be used as additional filters for conditions. Once the bot receives a signal for averaging, it will check the set parameters, and any averaging that meets these parameters will be executed at the market price. For more details, you can refer here.

This enhancement allows you to further secure your trades.

Example of practical use: 

Suppose you want to create a DCA (Dollar-Cost Averaging) bot that receives trading signals based on the RSI (Relative Strength Index) indicator when it is in the overbought zone, applies safety orders based on the same RSI signals if the price returns to the overbought zone, and closes the deal also based on the RSI signal when the trade becomes profitable and the price is in the oversold zone. 

Example of bot configuration:

Example on a chart using the RSI (Relative Strength Index) indicator:

Example of strategy execution:

Step 1: Receiving a Signal to Start the Deal

  • The bot receives a signal to buy ETH at a price of 3330 USDT when the RSI enters the overbought zone below the 25 mark, and the candle closes.
  • The bot buys ETH for 25 USDT.

Step 2: Setting Up Dollar-Cost Averaging (DCA)

  • In this example, we set up the DCA bot to make additional purchases if the price falls by 3% from the initial entry point.
  • We set a maximum of 5 averaging steps to control risks.
  • For each averaging step, we are prepared to invest 25 USDT.
  • Additionally, we include the same condition for averaging as for starting the deal: when the RSI re-enters the overbought zone below the 25 mark and the candle closes, the bot averages the deal.

Step 3: Applying DCA When the Price Falls

  • The price of ETH falls by 12.9% and reaches 2900 USDT.
  • The bot receives a signal to average and checks that we would have used 4 averaging steps at this point.
  • The bot averages the deal at the ideal place using 25 USDT (as specified in the averaging settings), multiplied by 4 averaging steps, totaling 100 USDT.

Step 4: Waiting for an Exit Signal

  • We now have a total ETH position of 125 USDT, averaged at a price lower than the initial entry point (3330 USDT).
  • The bot waits for an exit signal.
  • The price starts to rise, reaching 3350 USDT (a 12.5% increase from the average price).
  • According to the RSI indicator, the price enters the oversold zone above 70, and the candle closes.
  • The bot receives an exit signal and closes the deal with a profit.

Let’s now consider how much profit the bot would have made if it had not used averaging signals and had only used a standard method.

Comparison of the Standard Averaging Method and Averaging Based on Signals:

Calculation with Standard Safety Order Settings:

  1. Initial Purchase:
  2. The first purchase based on the RSI indicator signal for 25 USDT at a price of 3300 USDT.
  3. Safety Orders Setup:
  4. The bot sets 5 safety orders on the exchange with a 3% deviation from each previous order at the following prices:
  5. 3201 USDT
  6. 3011.82 USDT
  7. 2921.47 USDT
  8. 2833.83 USDT
  9. 2748.82 USDT
  10. Price Drop and Averaging:
  11. The price of ETH falls to 2813 USDT.
  12. The bot manages to average the deal at each step 4 times with 25 USDT each, totaling 100 USDT.
  13. The average price of the position becomes approximately 3044.15 USDT.
  14. Take Profit Scenario:
  15. Assuming a Take Profit of 4% was set in the bot, the deal would close at a price of 3165.92 USDT.
  16. The profit from the deal would be around 5 USDT.

Calculation Using Settings as Additional Filters for Conditions

  • First purchase based on the RSI indicator signal for 25 USDT at a price of 3300 USDT.
  • Averaging based on the RSI indicator signal with additional filters for 100 USDT at a price of 2900 USDT.
  • Average purchase price: 2972.73 USDT.
  • The price increased by 12.5% from the average price, and the deal was closed.
  • Profit from a 12.5% price increase amounted to 15.625 USDT.

Result:

  • Thanks to averaging, the average price of the deal decreased from the initial 3300 USDT to 2972.73 USDT. The distribution of the averaging volume was optimally placed, which allowed us to realize a profit more quickly and significantly when the price began to recover and increased by 12.5%.

Advantages of This Approach:

  • Risk Reduction: Averaging helps reduce the risk of purchasing at high levels.
  • Increased Profit: When the price recovers, your averaged price will be lower and with a larger volume, enhancing profitability.
  • Flexibility: The ability to adjust deviation filters by percentage allows for more precise management of trading operations based on market conditions.

This case demonstrates how the functionality of a trading bot with signals and averaging can be used for effective trading of the ETH/USDT cryptocurrency pair, minimizing risks and increasing profit potential.