How To Make An Automated Crypto Trading Bot

Weed Book

The Basics:

Choose a platform/exchange and get an API key for it. Every exchange has API documentation to help you understand the coding needed to connect and perform commands. Once you have API keys configured and are correctly connecting to it you can begin to code your bot. You will quickly realize you need a way to store information and call it later such as the use of a database like MySQL.

Coding The Bot:

Now that you have the API and a database ready to save some data you want to start saving the ticker data on a loop so that you create a record of the current prices and volume every minute. Another way of getting data is using candle data and creating a loop or cronjob capable of doing all the requests needed to save the data for each coin you want to save data on.

- Basic Functions: Once you have data saved you can do queries based on different time frames.

- Functions will need to be ready for buying, selling, checking balances, checking open orders, etc which are already included in the API.

- Create your first signal - It is up to you to decide on existing indicators or creating your own using the data you started saving.

Signal Creation:

Moving Average Example: MA 7 and MA 25

What is MA 7? MA 7 is the moving average of 7 points in time usually based on candle time length. So let's use daily candles for this example. If I want the MA 7 on daily candles I need to add up the price each day for the last 7 days and then add them together and divide by 7. This new number will give me a 7-day moving average.

The same goes for MA 25 and so forth. Then these averages of different lengths cross paths/numbers it is known as an MA cross. These crosses can signify price change and in what direction and are used as the main indication on when to buy or sell for some traders.

There are 100s of ways to create a signal or indicator(s) to determine when buying is appropriate once you are saving the data.

Open Position Management:

Once you have your bot buying in from a signal, the next part is managing the open position. Things like stop loss, trailing stop loss, order sheet gap size, and minimum profit is some of the things you need to be monitoring on a loop so the bot can react to the triggers you set.

Paper Testing:

Paper testing is used in many cases to test signals. This is where you save a record of your bots signals and sells to the database without actually using the API to buy and sell the coin. Doing this allows you to test the effectiveness of your bot without it costing you money.

Resource: Bitcoin Masterminds

Share this Post:
Author by Wilma Climate
A renowned author and governer has dedicated her life to writing of all genre's. Once nominated for the Noble Peace Prize and prestige rewards like the 2001 Book Author Grammy.

1 Comment

  1. This was a great read so I have shared with fellow authors.