10 resources to get you started in automated trading

Joanne Snel
lemon.markets
Published in
5 min readJul 30, 2021

Hey! I’m Joanne, and I’m part of the lemon.markets team. We are currently building a brokerage API that allows developers to customise their own trading experience at the stock market.

Automated trading, algotrading, blackbox trading — these terms have been popping up in headlines and forums over the past few years. But, what is automated trading, really? And how can you get started?

In this article, I have compiled a list of 10 resources that will guide you in setting up your own strategy: from the research phase, to the building phase, to the testing phase, and, finally, to the execution phase. In other words, everything you need to get your idea up and running. This includes strategy inspiration to portfolio analysis and visualisation.

Automated trading involves participating in financial markets through the means of computer software that automatically enters and exits trades based on a set of predefined rules. These rules can be based on traditional technical indicators, such as entering a long position on a particular trading instrument if the 50-day moving average passes the 200-day moving average (also known as the golden cross, a strong bullish market signal). Or, they can be based on external data, such as purchasing a certain cryptocurrency every time Elon Musk posts a tweet about it (several people have already built this, check it out). We’ll let you decide whether this is a good trading signal or not 😉

The Research Phase

Maybe you’re a developer looking to apply your skills to produce a stream of passive income or to start on a fun side-project. We recommend embarking on your journey by conducting research, particularly about popular trading strategies, and collecting market data. In the best-case scenario, you want to identify a persistent market inefficiency and exploit it.

Market Research

You can think of Investopedia as the Wikipedia for investors, and it can serve as your point of departure in learning about new topics. The platform has articles on topics ranging from basic trading strategies to complex statistical methods. It also includes plenty of inspiration for your own algorithms. Yahoo Finance is another great tool for stock market news and obtaining market data.

Community Platforms

Quantconnect is one of the largest platforms that crowdsources knowledge on automated trading and profitable strategies. Just like its competitor QuantInsti, Quantconnect attracts users with extensive data and the tools to facilitate strategy backtesting.

Current Open-Source Research

Hudson&Thames is building the M1FinLab library with the goal to make the most up-to-date quantitative research available to everyone. M1FinLab helps portfolio managers and traders alike to harness the power of machine learning in an easy-to-use, reproducible tool. They believe that scientific methods are the best way to approach asset management or wealth accumulation. And who are we to disagree?

More Data Sources

A lot of trading strategies depend on historical market data, and for that, you can obviously rely on the lemon.markets API. On the other hand, if you’re performing fundamental analysis you might need access to earnings reports, which can be found on SimFin, for example. Or, if you’re building a dividend-based strategy, perhaps you’d like to incorporate dividend payout dates, which can be found through DivvyDiary.

You can even use sources of alternative data (in finance, this is usually data provided by sources external to the company you are trading) to find investment opportunities. Nasdaq’s Quandl has a whole range of alternative data packages for private users. Think of, for example, the amount of iron ore imported by China yesterday or daily sentiment scores based on stock news. You can also directly feed financial news into your trading strategy using PLX AI. You just need to find the right correlation, and then you’re good to go.

Surprisingly, you don’t have to be a math whiz to set up your own automated trading strategy.

The Building Phase

The next step is to begin constructing your strategy. You need to decide with what software to build your rules (this could also be a programming language, such as C# or Python) and which external tools to use, if any.

Data analysis and manipulation

There are multiple libraries and packages for Python that can be used to read, manipulate and analyse (financial) datasets. The most popular is Pandas, which is used by some of the largest Quant-Funds. Specially created by AQR Capital Management to manipulate numerical tables and time-series data, it promises high performance and easy usability. Pandas is continuously being developed by a growing community.

TensorFlow

This is a free open-source platform from Google that can be used to build and train machine learning algorithms. TensorFlow offers individually programmable applications for many use cases. Inputs can be processed on different levels of abstraction to generate the desired output by means of machine learning algorithms or neural networks.

The Testing Phase

Before using real money, it’s a good idea to validate your trading strategy against historical and real price data. You want to make sure that your code is doing what you intended it to do, and that it does not break down in different market conditions or time frames.

Backtrader

A useful Python framework is backtrader, which helps you spend more time developing strategies than maintaining infrastructure. See their simple moving average crossover strategy example, which can be an interesting starting point to test and optimise strategies. In combination with lemon.markets’ functionalities, this is a powerful weapon for your success.

Portfolio Analysis

You can also deploy your strategy to a paper trading account, which is a simulated trade (read: not real money) that allows you to try out your strategy without risk. May we suggest the lemon.markets sandbox? There are then a number of tools that you can use to analyse your own portfolio. Quantopian Inc. developed some open source solutions like Pyfolio, which is a Python library that can be used to determine how your portfolio is performing and what kind of risk you are exposing yourself to.

Note: if your language of choice isn’t Python, try out this library written in JavaScript.

Visualisation

Visualising your portfolio performance can also be helpful, both for yourself and communicating the performance of your strategy with others. The popular Python libraries Matplotlib and Seaborn can be used for creating data graphics.

The Execution Phase

Now that you have the tools to conduct research and test your strategy, how to actually place your orders?

Order Execution

There are several options on the market that provide brokerage APIs, such as Alpaca or Interactive Brokers. Both of these tools are good options, but they lack support for European traders. The lemon.markets API is being worked on in the heart of Berlin, Germany. Our goal is to create a brokerage infrastructure that gives developers the freedom to build just about anything they can dream of. And, even better, we focus on European markets and traders! We highly value the input of our users and strive to incorporate them (and hopefully, you) in every step along the way.

Make sure to sign up to lemon.markets, so you can start implementing your automated trading strategy right away! And follow us on Medium to learn how to keep your program running even after you close your laptop ☁️ (blog post coming soon). If you have any additional comments or ideas, join our Slack community to have a chat.

Looking forward to seeing you on lemon.markets 🍋,

Joanne

--

--