roboquant avatar

The 4 Stages

Introduction

There are 4 distinct stages that you should go through when you develop, test and run a new trading strategy. The below diagram shows these stages and the order in which they are ideally executed:

four stages

Each stage has its own specific purpose and benefits. But before going through each stage and its purpose, there are two important rules to adhere to:

  1. If possible at all, don’t skip a stage. Every stage has its purpose, in order to end up with a well performing and robust trading strategy.

  2. And perhaps more important, if you are not happy about the performance in a later stage, go back to the first stage. Often minor changes to the code can have major impact on the results and should be thoroughly tested at each and every stage.

Roboquant supports all 4 stages with minimal changes to your configuration when you move from one stage to the next. Your Strategy and Policy shouldn’t change at all between stages, and only the configured data Feed and Broker will differ between stages.

The following table shows the used Broker and Feed in the different stages:

Stage Broker Feed

Back Testing

SimBroker

Historic data feed

Forward Testing

SimBroker

Live data feed

Paper Trading

Real broker using a demo account

Live data feed

Live Trading

Real broker using a live account

Live data feed

Stage 1: Back Testing

In this stage you’ll use historic data and the SimBroker to back-test your Strategy and Policy.

You can, of course, run a single back test over the complete timeline of historic data. But roboquant makes it also easy to run walk forward- and Monte Carlo-simulations. These types of back-tests provide you with better insights into the performance under different regimes.

It is very important to get as many insights as possible about the overall performance and behavior, so you know what to expect and also what not expect when you finally go live.

This is also the only stage where you should develop and modify your strategy and policy. If you are not happy with the performance at a later stage, you should return this first stage and make the changes there. If, for example, you would like to use circuit-breakers during live trading to get some extra peace of mind, you should already include this logic during back testing and not introduce it at live trading.

Configure the SimBroker similar to the live trading account and broker you are planning to use. Configure realistic cost and initial deposit, so you don’t get a too optimistic outlook on the overall cost. In general, is it preferable to err on the side of caution and define a higher cost structure at this stage than the other way around.

Stage 2: Forward Testing

In this stage you use live data and the SimBroker to test your Strategy and Policy. The main purpose of this stage is to validate if your Strategy is still performing well on unseen data.

It is very easy to over fit your Strategy during back testing, and this stage provides some confirmation if that is the case. That being said, often you cannot run this stage for as long as required to have a perfect insight into over-fitting, so this is an indication at best.

Roboquant can use any combination of data feed and broker. So you don’t need to restrict yourself to a data feed from your broker. There might be better and/or cheaper alternatives available.

Stage 3: Paper Trading

In this stage you use live data with a paper trading or demo account to test your Strategy and Policy. The main purpose is to validate if your Policy is still performing as expected when using a different Broker implementation.

This stage is where you validate the robustness of your approach and get extra confirmation that it is ready to go live. If you don’t have a solid Policy in place that handles all possible conditions, you should not go to the live trading stage. Key aspects to check:

  • are the orders generated by the Policy fully supported and behave as expected when using the paper trading account.

  • do the assets of the Feed and Broker align.

This will only work if your broker offers decent paper trading simulation. But if you are serious about algo-trading, you should only settle on a broker that offers realistic paper trading simulation.

Stage 4: Live Trading

In this stage you’ll use live data and the live trading account to run your Strategy and Policy and now real money is at stake. And although we are not at a testing stage, you will still need to closely monitor the performance and take appropriate actions. One reason is that even paper trading is a just simulation and cannot fully prepare you for what will happen during live trading.

It is easier than you think to create a solution that goes haywire and for example, generates too many orders. If this happens, you can quickly lose all your money due to transaction- and other types of cost. So always monitor live trading strategies closely.