AmiBroker Multi-Account Button Trading

Click BUY and SELL buttons on an AmiBroker chart to place orders into one or many accounts at once.

AmiBrokerMulti-accountButton trading
In short

You can click BUY and SELL buttons on an AmiBroker chart to send orders into one or many trading accounts at the same time. The accounts can be with the same broker or with different brokers. This works through AutoTrader Web, which carries the order from AmiBroker to your broker.

This guide shows how to trade from AmiBroker buttons so that one click can place an order into one or more trading accounts across the same or different brokers. It works with leading Indian stock brokers.

We use the AutoTrader Web tool to place the orders.

Demos

Demo (Hindi)

Demo (English)

What you need

You need three tools for this setup. Click the links to learn more about each one.

  • AmiBroker (registered or free trial version)
  • AutoTrader Web (register and add your trading accounts)
  • The AmiBroker library, downloaded from your account

Steps

We will go through each step in detail.

Step 1: Add accounts on AutoTrader Web

  1. Register on AutoTrader Web. See the user registration guide.
  2. Add all of your trading accounts, one by one, into AutoTrader Web. See adding trading accounts.

Step 2: Install the AmiBroker library

  1. Sign in to your account and go to Tools → Library.
  2. Download the AmiBroker library. Your API key is already inside the download, which is why it asks for your password.
  3. Extract the zip into your AmiBroker folder — the one that holds Broker.exe. This also puts the latest samples into your AmiBroker. You do this only once.

The full steps are in the AmiBroker library guide.

Step 3: Bring up your AmiBroker chart

  1. Start AmiBroker.
  2. Start your AmiBroker live price datafeed.
  3. Bring up a fresh chart.
  4. Add your AFLs or indicators.

Step 4: Overlay the button AFL

  1. Open the Charts section in AmiBroker.
  2. Look for the folders (AutoTrader Web -> Buttons).
  3. Right click on the at-buy-sell-buttons AFL and click Overlay (see the screenshot below).
  4. You will now see BUY and SELL buttons on the top left of your chart.

Buy/sell button AFL

Buy/Sell Button AFLs

Step 5: Set up chart parameters

Next, set up the chart parameters (see the screenshot below). The important parameters are:

GroupParameterWhat it means
AutoTraderExchangeThe exchange of the stock or derivative you want to trade. Search it on the instrument search tool.
AutoTraderSymbolThe exchange of the stock or derivative you want to trade. Search it on the instrument search tool.
AutoTraderAccountIgnore this parameter (it is not applicable).
AutoTraderProduct TypeThe product type of your order (INTRADAY, DELIVERY, NORMAL).
AutoTraderQuantityThe quantity to use for the order.
AutoTrader ButtonsAccountsA comma separated list of your account numbers (one or many).
AutoTrader ButtonsRemaining parametersThese control the position and size of the BUY/SELL buttons.

AmiBroker Button Parameters

AmiBroker Button Parameters

Step 6: Trade (place orders)

You are now ready to trade. Do your analysis and click the BUY or SELL buttons when you see an opportunity.

Step 7: Debug (investigate)

When something does not work as expected, you need to investigate. These steps help you find the root cause of most problems.

  1. Enable AmiBroker logs and view them. See AmiBroker logs debugging.
  2. Turn on AT_HTTP_DEBUG in the library’s config file, autotrader-http-config.afl, and watch the trace window. It prints every request and reply.
  3. Check the server logs. See AutoTrader Web activity logs.

Customization

You can customize these AFLs to fit your needs. Always make a copy before you change anything. The sample files are replaced every time you reinstall our library.

Summary

You have now seen how to place orders into one or more trading accounts across different brokers from AmiBroker buttons. You can take this further, such as firing more than one order across different accounts, or placing bracket or cover orders. These samples are inside our library, so feel free to explore them.

For any queries, you can contact us.

Next steps

Was this page helpful?

Last updated 6 September 2026