Creating Your First Simple DCA Bot

Algorithmic Trading

Bot Functions with 3commas

Chapter 3

Creating Your First Simple DCA Bot

There are many variables to consider when configuring a bot to trade for you. You will be giving this bot complete control of your funds, so you want to make sure you understand how each input option affects the performance of your bot.

When you first log into your 3commas account, you should be at the dashboard/homepage. You can click on the arrow in the upper left hand corner to display all the overhead menu tabs.

You will then see all of the available tabs to choose from. Select “DCA Bot.”

After that, you will see a screen similar to the one below, except yours may not have any bots created yet. That is what we are about to do. Look in the upper right hand corner and press “Create Bot.”

Now we can get to the magic. The order of your setting input boxes may display in a different order than how we will be going over the steps. You can change the order in which your input boxes are arranged, but it is not necessary. What is necessary is that you follow these steps to create your bot in order and that you understand how each setting affects the bot.

In the next few photos, we will take note of the bot assistant on the right side of the screen before moving on to the inputs. The bot assistant tells you how much coin you have available, the max amount for bot usage, your max safe order deviation, what percentage of your total holdings will be allotted for the bot. These numbers will change as you make edits to the bot inputs. We will discuss how each input can affect these settings. You can also see the bot chart here which shows you a line graph of your base order and safety orders. This too will change as you alter your bot inputs. Still referring to the same box, you will find your bot table. This is especially helpful as it will tell you under what market circumstances your bot will create safety orders and take profit orders. It resolves all the difficult calculations instantly. The table will also change as you make changes to your bot inputs. You can refer to the bot assistant throughout your configuration process to see how the changes are affecting your bot.



Step One: Pair Input

Now we can go over the steps of creating your first DCA bot. Let’s start with the basics. The first thing you should consider when creating a simple DCA bot is the currency pair the bot will be trading. You can trade any currency pair you desire; however, you need to understand some pairs are much more volatile than others. The currency pair you choose will determine all other variables for the bot. If you choose a coin pair with high volume and smaller spreads, you can set higher profit targets and smaller deviation ranges. If you choose a coin with high volume and wider spreads, you will need smaller take profit goals and additional deviation ranges. If you choose a coin with low volume it will affect the amount of deals closed. With bot trading, ideally we would like to close as many deals as possible. We want them to make profits, take profits, and then start over. The more deals closed, the more profits secured. Once you get comfortable with simple DCA bots by interpreting your bot data, you will start to see and understand for yourself exactly what this means. 

IMPORTANT NOTE: Remember, every other setting will be dependent upon the currency pair you select. You should look at the pair you want to choose and check to see what it’s possible deviation range is.

If you look across from the bot assistant, you will see the Pairs input box. You can select any pair you wish.

https://www.youtube.com/watch?v=TNiDkcD8QPw&list=PLa_th_mkwVKvXOb0rCVCaJl5OU6WmHWz0&index=5

Step Two: Main Settings Input

You can name your simple DCA bot whatever you desire. It is recommended you include the currency pair in the name.

In this tier, we will be creating a simple DCA bot. In the Bot Type input, select Simple.Simple bot will only analyze and trade one pair. A Composite bot will analyze and trade multiple pairs.

In the Exchange input, you should choose the exchange account wallet you want the funds to be used from. Be sure to select the proper wallet to avoid any possible bot errors. 

https://www.youtube.com/watch?v=tWXZ6x8vIQM&list=PLa_th_mkwVKvXOb0rCVCaJl5OU6WmHWz0&index=5&t=1s

Step Three: Strategy Input

The Strategy you choose for the bot you are creating is dependent upon the market trend of the currency pair you have selected. Long buys and sells higher; Short sells and re-buys lower.

Next you can select your Profit Currency. Quote profits in the coin from the right part of the pair; Base profits in the coin from the left part of the pair. It is important to pay attention to the pair you have selected and verify that you have the coin for the market you have selected. The pair selected in this example we are using is BTC/USDT. You can select whatever you wish. For this demonstration we have selected Quote.

Your Base Order Size is the size of the first order that will be placed on the market. You can measure it by either coin in the chosen currency pair or by percentage of available balance. If no safety orders are filled before a bot closes its deal, the base order is the only order that profits will be made on. 

Your Safety Order Size is the average size of the orders that will be placed in order to Dollar Cost Average the asset. Making your safety orders larger than your base order will help minimize the percentage gain needed to close a deal. The higher the amount of the safety order, the easier it will be for the bot to close a deal. Each Safety Order that gets filled will increase the volume of the asset you are holding and as a result increase the amount of profits you will make when the deal closes. 

The Start Order Type input allows you to select either Market or Limit. If you select market order, the bot will start new deals instantly at actual rates. NOTE: Using a market order on coin pairs with low liquidity could result in higher buy prices. If you select Limit order, the bot will place the base order onto the exchange order book and wait for it to fill. If the order doesn’t fill after a certain amount of time, the bot will automatically move it higher. Using a limit order could drastically increase a deal’s start time during a period of rapid price movements.

https://www.youtube.com/watch?v=p0CdUj1LLsQ&list=PLa_th_mkwVKvXOb0rCVCaJl5OU6WmHWz0&index=6

Step Four: Take Profit Input

In this step we will alter our take profit settings. The Target Profit %  is the percentage you want the bot to sell your assets for profit. If you select a smaller goal, your bot will close deals faster. If you have a larger goal, it could take longer to close deals. For this bot we have chosen a 1% profit goal.

The Take Profit Type has two options, we recommend using Percentage From Total Volume as this option will make a profit on all the orders the bot has made. If you select Percentage From Base Order, the profit percentage will be measured from only the base order.

You can enable Trailing in this input box. Turning this on will allow the bot to follow the price action if it is rising quickly until the price stops rising and then falls a certain percent determined by you.

https://www.youtube.com/watch?v=wFD2QzUuEsw&list=PLa_th_mkwVKvXOb0rCVCaJl5OU6WmHWz0&index=8

Step Five: Safety Order Input

This is the part that can get a little confusing for people. The bots Safety Orders are its line of defense. The bot will use safety orders to effectively DCA down the price of the asset chosen for its usage. We will break this section down to make sure you understand key points regarding safety orders.

Max Safety Trades Count – This will determine the max amount of safety trades that the bot will place if price action starts to deviate. You can set this number to any amount you wish. This input setting is number one of three factors that will manipulate your Max Safe Order Price Deviation located in the bot assistant box that we talked about earlier. The more safety orders you have available for your bot, the greater deviation you will have and therefore the safer your bot will be. IMPORTANT NOTE: The max amount for bot usage will increase as you add safety orders. If you run out of funds for the bot to pull from when trying to execute safety orders, you will get an error and your bot will malfunction. Please pay attention and make sure that you have enough funds available to run your bot or you will experience an error. We will use 10 for this demonstration.

Max Active Safety Trades Count – This determines how many orders are placed on the order book at one time. The max setting for this input is 10. Having more safety trade orders on the market can help to maintain profit margins when the bots encounter “fat finger trades.” We will use 5 active safety trades for this demonstration, meaning this bot will have safety orders on the market ready to be filled.

Price Deviation To Open Safety Orders (% from initial order) – The number you input for this setting will be the percentage that the price of your asset must fall before opening its first safety order and every safety order afterwards. This input setting is number two of three factors that will manipulate your Max Safe Order Price Deviation. The larger you set this number, the greater your deviation will be and the safer you will be against major market movements. Having a greater price deviation means you will close deals at a slower rate than if you had it set smaller.

Safety Order Volume Scale – This is perhaps the most important factor when creating a bot. The safety order volume scale affects two things. First, it affects the Max amount for bot usage (Based on current rate). Second, it affects the bot’s ability to close deals. If you have input greater than 1 here, your safety orders will increase in size as they are placed and as a result the bot will close deals faster by bringing the average cost of each purchase down. If you have less than 1 here, your safety orders will decrease in size and will take longer to close deals as you are spending less on the asset as it depreciates per safety order. Using a negative volume scale can be effective when applying certain strategies. A good general rule is to have an input of at least 1 or greater unless you are advanced with bots and have a deep understanding of how a negative volume scale can affect your bots performance.

Safety Order Step Scale – This is the number that each safety order will be multiplied by. This is the final input setting that will affect the bots Max safe order price deviation. Having this factor set to 1 will provide a grid-like structure out of your safety order intervals. Having this input set to 1 is conservative. Having this input set to anything greater than 1 will imbalance the proportions of the safety order placement in relation to the currency pairs chart. An input higher than 1 will provide a greater deviation while a lower input will provide a smaller deviation.

https://www.youtube.com/watch?v=XTA7M62ha0I&list=PLa_th_mkwVKvXOb0rCVCaJl5OU6WmHWz0&index=9

Step Six: Deal Start Condition

There are a number of deal start conditions for your bot. The inputs you choose here will only affect the conditions in which a new deal is started.

The Trading View deal start conditions can be broken down by window time frame buy or sell signals. If you select Trading View as your deal start condition, you will then be prompted to select a time frame and signal. You will have the option to choose a buy or sell signal. Buy signals are good for programming long bots and sell signals are good for programming short bots.

If you select Manually/API (bot won’t open new trades automatically), then the bot will not start a new deal for any reason no matter what other deal start conditions you may have on except for the trigger alert assigned.

Using a TradingView custom signal is how you would plug in an external TradingView script like the Nitros Bull Indicator. This is great if you have your own trading view signals or scripts as well. You can use your bot with any private custom script you have on your TradingView account! To learn how to run this setting with your own custom script, click here.

If you select Open new trade ASAP the bot will continuously function to open and close deals. When using this deal start condition it is important to plan for any possible deviation for your selected currency pair. For the purpose of this demonstration, we will use this option.

The rest of the available options you see in the picture are available through 3commas.io signal market. Some are free and some can be purchased directly through 3commas as they are signals that have been sold to or partnered with 3commas.io.

Any deal start condition you might see on 3commas that is not listed in this module is not related to DeadlyCrypto in any way. Any product available for sale on 3commas.io platform or its marketplace is in no way licensed or endorsed by DeadlyCrypto. Any and all official products belonging to DeadlyCrypto can be found available at true-value retail cost within this website.

https://www.youtube.com/watch?v=2Tg8JhNN-9U&list=PLa_th_mkwVKvXOb0rCVCaJl5OU6WmHWz0&index=10

Step Seven: Stop Loss

Setting a stop loss is entirely up to you and the strategy you want to use. You do not have to enable a stop loss, in fact, you can turn the stop loss off. If you turn the stop loss off, once the price falls below your Max safe order price deviation your bot will stay on; however it will take no further action until the price once again crosses the average buy price of the selected asset.

If you enable a stop loss, the Stop loss (%) must be below that of your Max safe order price deviation or you will not be able to create the bot. You can choose to have the bot close its deal and it will start a new one, or you can set it to close its deal and stop the bot in the Stop Loss action drop down menu.

The Stop Loss timeout is a nice tool if you choose to use a stop loss. Sometimes in a heavily trending market price action can experience sudden extreme price movements. A lot of traders find common support and resistance zones to set their stop loss. When a stop loss is triggered a deal is closed. This causes a major shift in market price during an already highly volatile market condition. If you consider the fact that a lot of traders use leverage, they will either use stop losses to prevent liquidation or actually get liquidated at obvious support or resistance zones at a time of price trend conflict. Using a Stop Loss timeout can be beneficial in some circumstances because these support or resistance zones can be slight pull backs or tests and price could reverse again in the other direction quickly. Using a Stop Loss timeout in some circumstances can be more damaging to your account balance when price falls at a support or resistance zone and continues its plummet (or ascension for short positions).

Again it is entirely up to you if you want to use a stop loss in your trading strategy. We have no recommendation as to whether you should or shouldn’t use a stop loss. 

https://www.youtube.com/watch?v=FS5UJqOPjnM&list=PLa_th_mkwVKvXOb0rCVCaJl5OU6WmHWz0&index=11

Step Eight: Advanced Settings

These settings may seem very minuscule at a glance but can greatly affect your bot’s performance, just like each and every other input setting.

Don’t start deals if the daily volume is less than – this option will restrict your bot from opening a deal if the daily trading volume is less than the input number here.

Minimum price to open a deal – the bot will not open a deal after completing a deal if the current market price is less than the input number here. Leave it blank to let the bot run without restrictions. If you input 0, the bot will not start.

Maximum price to open deal – the bot will not open a deal after completing a deal if the current market price is greater than the input number here. Leave it blank to let the bot run without restrictions. If you input 0, the bot will not start.

Cooldown between deals – the bot will take a rest period of this many seconds before looking for new deal start conditions.  

Open deal & stop – the bot will function until it completes the number of deals specified by this input. Leave it blank to let the bot run continuously. If you input 0, the bot will not start. If you input 1, the bot will stop functioning after 1 deal is completed. If you input 11, the bot will stop functioning after 11 deals are completed.

https://www.youtube.com/watch?v=_dgl0iGx3bI&list=PLa_th_mkwVKvXOb0rCVCaJl5OU6WmHWz0&index=12

Step Nine: Close Deal After Timeout

This step is very simple to explain. Whatever value you specify here will give the bot a timeout. If you input 15 minutes, the bot will close the deal after 15 minutes of opening regardless of trade status (profit or loss). If you input 15 hours then the bot will close the deal after 15 hours.

https://www.youtube.com/watch?v=neo24kY7jGI&list=PLa_th_mkwVKvXOb0rCVCaJl5OU6WmHWz0&index=29

Step Ten: Create Your Bot

Now that we understand how all these inputs affect our bot’s performance and have chosen our desired inputs, we will consult our Bot Assistant once more to make sure we are okay with the Max amount for bot usage (Based on current rate), the Max safe order price deviation, and the % of available balance to be used by the bot. As you can see in the photo provided, we have a warning message that states, “Warning! Bot will use amounts greater than you have on exchange.” This is nice as the software will notify you if the bot intends to use more funds of any currency than you have available. IMPORTANT NOTE: You must hold or purchase and hold whatever amount is displayed by your bots configuration in order to operate safely.

Be sure to check the Chart and the Table to make sure you like everything that you see. If you do not like something, go back and alter the inputs to see how you can achieve your desired ranges. If everything looks good to go then you can press Create Bot. If you get an error message, check the message and your inputs to see why. If you do not get an error message, your bot will be generated.

Congrats! You have just created your first automated trading bot that is going to earn you passive income! Before you turn on your first bot, let’s review some simple maintenance guidelines so you know how to manage your bots once they are active.


1


2


3


4


5


6