Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (2024)

The step-by-step guide on how to do automated investing in 2023

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (2)

Algorithmic trading used to be hard. At the very least, if you wanted to create a trading strategy, you needed proficiency in Python and familiarity with libraries such as NumPy, Scikit, and Matplotlib. For more complex tasks such as multiobjective optimization or Monte Carlo tree search, strategies needed to be ported into C++, which is notorious for its difficult learning curve. Most importantly, the majority of your time is consumed by coding, rather than ideating, evaluating, and testing trading strategies.

I noticed this as an issue in around 2020. I tried other trading platforms, but most of them felt archaic, rigid, or lacking in functionality. So, I decided to fix this problem on my own. My first attempt at this resulted in the open-source platform NextTrade. While it has several extremely powerful features, such as multi-objective optimization and the ability to configure simple trading strategies, it was slow and lacked configurability.

My experience developing NextTrade has given me the ability to create a next-generation trading platform. NexusTrade was built to express any conceivable idea without a coding interface. The platform simplifies the process of creating, evaluating, and optimizing a strategy without sacrificing expressivity or performance, and it does so on a modern, easy-to-use UI. Today, I’m going to walk you through the process of configuring a trading strategy in NexusTrade.

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (3)

Head over to https://nexustrade.io/chat. After you created an account, you should be redirected to the chat page. If this does not occur, you can manually select the AI Chat from the page header.

The AI Chat provides the most straightforward path to strategy creation. Here, you can describe your trading ideas to the AI, which subsequently translates your strategy from natural language into a format the application can interpret. For example:

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (4)

You can tell the chat to configure pretty much any conceivable idea. This includes compound conditions (A and B) and compound indicators (a + b). Presently, strategies are limited to technical indicators, such as Simple Moving Average, Relative Strength Index, Rate of Change, and an Asset’s Price.

Aside: What new features are coming soon?

  • Support for options and crypto is planned for the near-term.
  • More technical indicators like MACD, Pivot Point Standard, and Number of consecutive up/down days are on the roadmap
  • Fundamental indicators like revenue, income, and historical dividend yield are coming soon
  • Creating portfolios with 10+ strategies at once, or creating multiple portfolios simultaneously is not yet implemented in the AI Chat

It’s important to note that while these features aren’t implemented, the system’s architecture 100% supports them. If you want other features, you can add it to the Roadmap or reach out to me on Instagram.

You can assess the strategy’s performance directly in the chat. Instructing the AI to backtest the portfolio will prompt it to generate a backtest. For example:

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (5)

Clicking View Backtest will provide a detailed overview of the results.

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (6)

Let’s say you are happy with the strategy you created, but wanted to improve your performance. How could we do this?

Returning to the chat, select View Portfolio and Save on the portfolio we previously created.

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (7)

Go to the Portfolio you just saved by clicking Portfolios (in the header) and then navigating to the name of the portfolio you just created.

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (8)

From here, you should see a screen that looks like this:

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (9)

Click on the Optimizer, and check out how we can configure our multi-objective optimization.

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (10)

Despite the myriad of configurability options available, for simplicity, let’s alter only the population size and the number of generations.

After around 2 minutes, you’ll notice that the average performance of the population tends to increase over time.

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (11)

We can run an optimization for as long as we want. This optimization process generates a population of portfolios that outperform the original one in various aspects. Some portfolios will exhibit a lower max drawdown, while others might display a better percent change. Many portfolios will demonstrate improvements in both. Each portfolio (and its associated backtest performance) are what we call an “optimization vector”.

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (12)

Let’s click on the strategies of an optimization vector.

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (13)

From here, we can see the exact details in the change of the portfolio. If we wanted to update our portfolio from an optimization vector, we can just scroll all the way down, and click Edit.

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (14)

Now that we have an optimized portfolio, it’s time to assess its performance. Click the backtest button and do from June 2018 to present day. Here are the results:

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (15)

This is a considerable improvement over the original portfolio! To further improve this, we can incorporate more strategies, more complex conditions, better indicators, more diversified assets, and continue to optimize the strategy’s performance. Moreover, by being rigorous with our optimization approach and subdividing it into train/validation/test sets, we can refine our strategy until it meets our satisfaction.

The last move is to deploy our strategy to the market in a few easy clicks. This can be accomplished through a few simple clicks: select Settings, Deployment, and then Start Trading to launch your strategy live. It’s really that easy!

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (16)

Algorithmic trading used to be hard. The idea that you have to know how to code to be an algorithmic trader is archaic and outdated — people trade in the market everyday and have no coding experience. At the same time, it’s unfair that only well-funded hedge funds and prop shops have access to these optimization tools and AI algorithms.

NexusTrade was born out of a need for a superior trading platform. You can choose to ignore it and continue coding your strategies in Python and waste hours debugging your segmentation fault in C++. Or, you can think of a good idea, configure it in seconds, test its performance, and continuously improve it a sleek, simple UI. The choice is up to you.

Let’s Create, Backtest, Optimize, and Deploy a Fully Automated Algorithmic Trading Strategy (2024)
Top Articles
Latest Posts
Article information

Author: Catherine Tremblay

Last Updated:

Views: 6268

Rating: 4.7 / 5 (47 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.