Alpaca Blog | Developer API for commission-free stock trading

The Automation of Wealth Management

A Budding Developer’s Perspective

Software-Driven Automation is Everywhere

Software-driven automation is rapidly transforming the social and economic landscape, with some of the most prominent examples being autonomous vehicles and home assistants. All aspects of society and the economy are experiencing automation, though, and finance will not be left untouched.

The retail investor tasted automation from the home with the advent of online brokers that could accept trades through a web interface. For the most part, these online brokers, or the online segments of traditional brokers, also employed human brokers. The human brokers could always be consulted on trades, be engaged in conversation for the purposes of education, and be a soothing voice when the markets turned sour.

Unfortunately, those human brokers are expensive, they get tired or ill, and they make mistakes. Of course there are plenty of human brokers around today, but a new force has recently evolved along with the explosion of fully-online services like digital-only banks. That force is robo-advisory.

What is a Robo-Advisor?

The term robo-advisor encompasses those services that are largely automated and tend to lack a human element on the execution side. There are only machines on the backend, and this setup is particularly appealing, more trustworthy, and more familiar to many, particularly younger cohorts, who often prefer digital interfaces.

Robo-advisors are frequently designed for passive wealth management, wherein the customer answers a questionnaire regarding risk tolerance and an algorithm determines the optimal portfolio for that individual. The portfolio may be continually turned over, but the turnover is performed algorithmically and, from the customer’s perspective, the investment can remain untouched — or perhaps un-interacted-with, for lack of a better term.

Robo-advisors might also be more interactive, and sometimes they offer direct control over the portfolio via APIs, allowing the end user to completely automate their trading system while simultaneously cutting costs thanks to a reduction in the need to employ and pay salaries to humans.

Whether API-driven investment is suitable for any investor is up to each particular individual, but those who have a programming background may be particularly interested in the ability to set up a fully-automated trading system with a broker offering such API capabilities.

One reason robo-advisors are becoming more popular is the loss of trust in financial institutions, especially since the Financial Crisis of 2007–8. People no longer trust a human, particularly a banker, to accurately or reliably handle investments. Another cause of distrust is the lack of accountability, wherein very few Wall Streeters were punished for the financial collapse and even received taxpayer-funded bailouts while Main Streeters suffered a long, arduous recession.

There is also the economic pressure of fees, which can be substantial and numerous for traditional brokerage houses but often constitute a razor thin slice of assets for robo-advisors. After all, robo-advisors mostly consist of tireless servers doing all the legwork, with either development teams at the company creating software or individual investor-developers creating their own software.

Where the trend will develop from here ranges from the optimistic for small, nimble fintech firms to the opposite view that big, traditional brokerage houses will either co-opt the technology for themselves and crush the fintechs or simply buy the smaller guys.

Whoever the provider of the services is, it seems highly likely they will retain the ability of individual retail investors to automate their trading systems through APIs and home internet access.

What Can Be Automated?

Decades ago, trading pit participants would yell out trades on the floors of the world’s stock exchanges. Then came automated trading between the broker-dealers. Clients would still speak to a broker, who could enter a trade electronically. Then came online brokers, whereby clients could enter trades via a website and the order would be passed through an electronic, automated chain to the exchange, where it was electronically executed. The next natural step is for clients to automate their own trading based on their own systems, and the entire process will become completely automated.

So, what can be automated in trading? Nearly everything that can be put into a computer can be automated, and that is where APIs become interesting.

Those in the readership who code have likely heard of APIs, even if there has been no direct interaction. There are plenty of services, such as social media platforms that offer APIs that gather streams of data to a local (or cloud) drive. The street runs both ways, though, and information can be pushed over to the platform’s servers for publication there. It is the same for financial services.

Finance APIs comprise three main categories: market data, account data, and trade execution. All financial information and activity can be processed and acted upon through these three concepts. As for the flow of information, most APIs on the market offer limited REST (pull) capabilities, wherein the system must actively make each request to the API, but many services also offer equally capable streaming push services.

For those actively trading, push services are critical, as trading systems will need to gather timely information, process it, and make decisions quickly. Push allows these systems to simply listen for the incoming information as events unfold without making requests and waiting for responses for each iteration. Of course, those who are longer-term traders or investors can still use push, but may simply want to make one or two REST requests per day to reduce storage needs and network congestion.

REST is ideal for backtesting algorithms and trading strategies as well, so most investor-developers are going to make REST requests at some point, even if they are daytrading on the order of seconds. Thus, for those who only need historical data or a few pieces of information a day, REST is sufficient. However, those actively trading will likely want to use a broker who offers streaming data services through their API.

Why Automate?

There are plenty of reasons to automate, with lower fees, faster trading, and being able to step away from the market being predominant among them.

The fees charged by online brokers can cut deeply into returns, even if the fee itself seems rather inconsequential. However, years of compounding fees do add up. Moreover, for those who have little need for a human interface, trading via traditional brokers will still carry the overhead of paying salaries, regardless of whether the investor in question actually utilizes the human-driven service or not. Why pay for someone else’s need to have a human broker?

An additional benefit of removing humans from the equation is the ability to process information and execute trades more quickly. Human traders may make trades every few seconds, but automated systems will be able to process more information and make more accurate decisions based on that information than even seasoned day traders. Even if one trades on a weeklong timeframe, an algorithm can simply consume and output more data than a human could.

For those who want to passively invest yet maintain an edge, automation allows one to unglue oneself from the screen during trading hours. A buy-and-hold strategy might be desirable, but savvy investors can squeeze a few more basis points of return out of that strategy via a fitting algorithmic system. The system can either trade on their behalf or simply alert them with the relevant information at the relevant time.

A further reason to automate is impartiality, in which emotions are completely removed from trading. A common pitfall for unseasoned traders is trading emotionally, as it can be extremely difficult to distance oneself from emotions in live markets, but a well-thought-out system, developed purely on logical principles, will have no concept of emotional trading and therefore remove the emotional element altogether.

How to Automate

This fully-automated, miniscule-fee, pure-logic trading concept seems utopian. Are there really firms that offer straight-API services with no GUI, no humans, and the real savings that accompany those two characteristics? There sure are. One of them is Alpaca, which offers a bare-bones, API-driven investment service for those who want to do-the-markets-themselves.

You can dig into the documentation here, and if you’re new to investing, you can start off with a “paper account”, in which you will not risk any real capital.

Are Robo-Advisors Safe?

A major concern we’d like to address is the safety of robo-advisors. The cryptocurrency and ICO craze of 2017 may have spooked some technically-capable investors who began to distrust ICO scams and rampant problems with crypto exchanges. Robo-advisors, however, deal in traditional securities and must follow certain regulations.

For example, FINRA requires those who day trade to maintain account balances of at least $25,000, significantly reducing participation by novices in the white-knuckle world of day trading. Furthermore, equity brokers must be licensed and registered, and they are subject to fiduciary duties. Potential clients can even investigate their chosen advisor through FINRA’s BrokerCheck or the SEC’s Investment Adviser’s Public Disclosure system.

The equity market is very well regulated, and advisors who want access will need to prove themselves trustworthy before starting. The biggest risk to individuals who want to automate their trading is the risk to capital posed by their own trading systems, assumptions, and logic. The advisors themselves, as long as they’re registered with FINRA or the SEC, will be closely supervised and reliable.

Technology and services are offered by AlpacaDB, Inc. Brokerage services are provided by Alpaca Securities LLC (, member FINRA/SIPC. Alpaca Securities LLC is a wholly-owned subsidiary of AlpacaDB, Inc.

You can find us @AlpacaHQ, if you use twitter.

Author image
Co-founder & CEO of Alpaca
You've successfully subscribed to Alpaca Blog | Developer API for commission-free stock trading
Great! Next, complete checkout for full access to Alpaca Blog | Developer API for commission-free stock trading
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.