Backtesting

Deployment

Introduction

Deploy a backtest to simulate your trading algorithm on our cloud servers. Since the same Lean engine is used to run backtests and live trading algorithms, it's easy to transition from backtesting to live trading once you are satisfied with the historical performance of your algorithm. If you find any issues with Lean, the historical data, or the website when running backtests, we'll resolve the issue.

Nodes

You need an idle backtesting node in your organization to deploy a backtest. You can view the status of all of your organization's nodes and select a specific node to use in the Resources panel of the IDE. Backtesting nodes that are more powerful can run faster backtests and backtest nodes with more RAM can handle more memory-intensive operations like training machine learning models, processing Options data, and managing large universes. The following table shows the specifications of the backtesting node models:

NameNumber of CoresProcessing Speed (GHz)RAM (GB)GPU
B-MICRO2380
B2-824.980
B4-1244.9120
B4-16-GPU43161/3
B8-1684.9160

Refer to the Pricing page to see the price of each backtesting node model. The first organization on each account is given one free B-MICRO backtesting node. B-MICRO nodes have a 20-second delay when you launch backtests, but the delay is removed and the node is replaced when you upgrade the tier of your organization and add a new backtesting node.

The CPU nodes are available on a fair usage basis. The GPU nodes can be shared with a maximum of three members. Depending on the server load, you may use all of the GPU's processing power.

Concurrent Backtesting

Concurrent backtesting is the process of running multiple backtests at the same time within a single organization. Concurrent backtesting speeds up your strategy development because you don't have to wait while a single backtest finishes executing. You need multiple backtesting nodes in your organization to run concurrent backtests. The more backtesting nodes that your organization has, the more concurrent backtests you can execute. If you are trying to fine-tune your parameters, consider running a parameter optimization. If you run a parameter optimization job, you can run multiple backtests concurrently without having multiple backtest nodes.

The number of backtesting nodes that you can have in your organization depends on the tier of your organization. The following table shows the backtesting node quotas:

TierNode Quota
Free1
Quant Researcher2
Team10
Trading FirmUnlimited
InstitutionUnlimited

Logs

The amount of logs you can generate per backtest and per day depends on the tier of your organization. The following table shows the amount of logs you can generate on each tier:

TierLogs Per Backtest
Logs Per Day
Free
10KB3MB
Quant Researcher
100KB3MB
Team
1MB10MB
Trading Firm
5MB50MB
Institution
Inf.Inf.

To check the log storage space you have remaining, log in to the Algorithm Lab and then, in the left navigation bar, click Organization > Resources.

Orders

The number of orders you can place in a single backtest depends on the tier of your organization. The following table shows the number of orders you can place on each tier:

TierOrders Quota
Free10K
Quant Researcher10M
TeamUnlimited
Trading FirmUnlimited
InstitutionUnlimited

Security

Your code is stored in a database, isolated from the internet. When the code leaves the database, it is compiled and obfuscated before being deployed to the cloud. If the cloud servers were compromised, this process makes it difficult to read your strategy.

As we've seen over recent years, there can never be any guarantee of security with online websites. However, we deploy all modern and common security procedures. We deploy nightly software updates to keep the server up to date with the latest security patches. We also use SSH key login to avoid reliance on passwords. Internally, we use processes to ensure only a handful of people have access to the database and we always restrict logins to never use root credentials.

See our Security and IP documentation for more information.

Build Projects

If the compiler finds errors during the build process, the IDE highlights the lines of code that caused the errors in red. Your projects will automatically build after each keystroke. To manually build a project, open the project and then click the Build icon. If the build process is unresponsive, try refreshing the page and building again. If the build process continues to be unresponsive, check our Status page or contact us.

Run Backtests

To run a backtest, open a project and then click the Backtest icon. If the project successfully builds, "Received backtest backtestName request" displays. If the backtest successfully launches, the IDE displays the backtest results page in a new tab. If the backtest fails to launch due to coding errors, the new tab displays the error. As the backtest executes, you can refresh or close the IDE without interfering with the backtest because it runs on our cloud servers. The backtest runs up to the start of the out-of-sample hold out period.

Stop Backtests

To stop a running backtest, open the Resources panel, and then click the stop icon next to the backtest node. You can stop nodes that you are using, but you need stop node permissions to stop nodes other members are using.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: