The Complete Guide to Building a Low-Code Automated Trading Bot with Make and Alpaca API

Is it possible to build an automated trading bot without complex coding? Yes, it is possible by leveraging Make (formerly Integromat) and the Alpaca API. This guide provides a complete walkthrough on how to build an automated trading bot using a low-code approach, saving you time and effort, and automating strategy execution. Now, even if you're not a coding expert, you can harness the powerful capabilities of automated trading.

1. The Challenge / Context

Building an automated trading bot is appealing, but traditional methods require programming knowledge and complex API integration. This creates a barrier to entry for many individual investors and small teams. While the Alpaca API offers powerful features for trading, utilizing it requires a deep understanding of the API and coding skills. Using a low-code platform like Make can significantly reduce this complexity, allowing you to visually design and automate trading strategies. This article will explain how in detail.

2. Deep Dive: Make (formerly Integromat)

Make is a low-code platform that allows you to build automated workflows by connecting various applications and services. Its drag-and-drop interface enables visual configuration of complex logic and offers various functionalities such as API calls, data transformation, and conditional execution. Make constructs workflows using 'modules' as building blocks. Each module performs a specific task, and multiple modules are connected to create a complete workflow. Specifically, its integration with the Alpaca API simplifies API calls and automates error handling and data parsing, making it much easier to build trading bots.

3. Step-by-Step Guide / Implementation

Now, let's take a detailed look at the steps to build an automated trading bot using Make and the Alpaca API. In this example, we will build a bot that places a buy order when a specific stock reaches a certain price.

Step 1: Create a Make Account and Prepare Alpaca API Keys

First, you need to create an account on Make and obtain API keys from Alpaca. It is recommended to create an Alpaca account and activate a Paper Trading account to set up a testing environment. A Paper Trading account allows you to test trading strategies without using real money.

Step 2: Create a Make Scenario

After logging into Make, create a new scenario. A scenario represents an automated workflow. Click the '+' button to add the first module.

Step 3: Add a Scheduler Module (Trigger)

The first module is a scheduler module, which determines how often the trading bot will run. Search for and add the "Schedule" module. For example, you can set it to check stock prices every 5 minutes.


        # 스케줄러 모듈 설정 예시
        {
            "type": "basic",
            "interval": 5,
            "unit": "minutes"
        }
    

Step 4: Add an Alpaca Module (Get Stock Price)

The second module is an Alpaca API module used to fetch the current price of a specific stock. Click the '+' button, search for "Alpaca" module, and add it. To use the Alpaca module, a connection to your Alpaca account is required. Proceed with the connection settings and select the "Get a Quote" action. Enter the ticker symbol of the stock you want to trade (e.g., AAPL).


        # Alpaca 모듈 설정 예시 (Get a Quote)
        {
            "connection": "My Alpaca Connection",  // Alpaca 연결 이름
            "action": "Get a Quote",
            "parameters": {
                "symbol": "AAPL"  // 거래할 주식 티커 심볼
            }
        }
    

Step 5: Add a Conditional Execution Module (Price Check)

The third module is a conditional execution module that checks if the stock price is above a certain level. Search for and add the "Filter" module. Use the filter module to check if the stock price fetched from the Alpaca module is greater than or equal to a pre-set target price. For example, you can set a condition to check if the AAPL stock price is $170 or higher.


        # 필터 모듈 설정 예시
        {
            "condition": "Greater than or equal to",
            "first_value": "{{Alpaca.last_trade_price}}", // Alpaca 모듈에서 가져온 주식 가격
            "second_value": "170" // 목표 가격
        }
    

Step 6: Add an Alpaca Module (Place Buy Order)

The fourth module is an Alpaca API module used to place a buy order. It will only execute if the condition in the conditional execution module is met. Click the '+' button and add the "Alpaca" module again. Select the "Create an Order" action. Enter the ticker symbol of the stock to trade, quantity, order type (e.g., market order), and other details.


        # Alpaca 모듈 설정 예시 (Create an Order)
        {
            "connection": "My Alpaca Connection",  // Alpaca 연결 이름
            "action": "Create an Order",
            "parameters": {
                "symbol": "AAPL",  // 거래할 주식 티커 심볼
                "qty": "1", // 매수 수량
                "side": "buy", // 매수/매도 방향
                "type": "market", // 주문 유형 (market, limit 등)
                "time_in_force": "day" // 주문 유효 기간
            }
        }
    

Step 7: Save and Run the Scenario

Once all modules are configured, save and run the scenario. You can use the testing features provided by Make to verify that each module works as expected. If the scenario operates correctly, activate it to run your automated trading bot.

4. Real-world Use Case / Example

Personally, I utilized this workflow to detect price fluctuations in tech stocks of interest and implemented a strategy to automatically buy small quantities when they reached a target price. Previously, I had to check stock prices every morning and place orders manually, but after building this bot, I've been able to save time and invest with less influence from psychological factors. It is particularly useful in volatile markets where quick responses are necessary.

5. Pros & Cons / Critical Analysis