Live Algorithms

Managing Deployments

Introduction

This page explains how to create and manage live trading algorithms from the Research Environment with the QuantConnect API.

Prerequisites

Working knowledge of C#.

Working knowledge of Python and pandas. If you are not familiar with pandas, refer to the pandas documentation.

Liquidate Algorithms

To liquidate and stop an algorithm, call the LiquidateLiveAlgorithm method with the project ID.

var response = api.LiquidateLiveAlgorithm(projectId);
response = api.LiquidateLiveAlgorithm(project_id)

The LiquidateLiveAlgorithm method returns a RestResponse object, which have the following attributes:

Stop Algorithms

To stop an algorithm but maintain its holdings, call the StopLiveAlgorithm method with the project ID.

var response = api.StopLiveAlgorithm(projectId);
response = api.StopLiveAlgorithm(project_id)

The StopLiveAlgorithm method returns a RestResponse object, which have the following attributes:

List Algorithms

To get details on all your live algorithms, call the ListLiveAlgorithms method.

var liveList = api.ListLiveAlgorithms();
live_list = api.ListLiveAlgorithms()

The ListLiveAlgorithms method accepts the following additional arguments so you can select specific live algorithms:

ArgumentData TypeDescription
statusAlgorithmStatusFilter the statuses of the algorithms returned from the API. The AlgorithmStatus enumeration has the following members:
startTimeDateTimedatetimeEarliest launched time of the algorithms returned by the API
endTimeDateTimedatetimeLatest launched time of the algorithms returned by the API
var liveList = api.ListLiveAlgorithms(status: AlgorithmStatus.Running,
                                      startTime: new DateTime(2022, 1, 30),
                                      endTime: new DateTime(2021, 2, 10));
live_list = api.ListLiveAlgorithms(status=AlgorithmStatus.Running,
                                   startTime=datetime(2022, 1, 30),
                                   endTime=datetime(2022, 2, 10))

The ListLiveAlgorithms method returns a LiveList object, which have the following attributes:

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: