## Algorithm Control

### Introduction

The algorithm control features let you adjust your algorithm while it executes live so that you can perform actions that are not written in the project files. The control features let you intervene in the execution of your algorithm and make adjustments. The control features that are available to you depend on if you deploy the algorithm on your local machine or on the QuantConnect cloud servers.

### Control Local Algorithms

While your local algorithms run, you can add security subscriptions, submit orders, adjust orders, and stop their execution.

You can manually create security subscriptions for your algorithm instead of calling the AddsecurityType methods in your code files. If you add security subscriptions to your algorithm, you can place manual trades without having to edit and redeploy the algorithm. To add security subscriptions, open a terminal in the workspace that contains the project and then run lean live add-security "My Project".

#### Update Orders

To update an existing order, open a terminal in the workspace that contains the project and then run lean live update-order "My Project".

#### Liquidate Positions

To liquidate a specific asset in your algorithm, open a terminal in the workspace that contains the project and then run lean live liquidate "My Project".

### Control Cloud Algorithms

While your cloud algorithms run, you can liquidate their positions and stop their exeuction.

#### Liquidate Positions

The lean cloud live liquidate command acts as a "kill switch" to sell all of your portfolio holdings. If your algorithm has a bug in it that caused it to purchase a lot of securities that you didn't want, this command let's you easily liquidate your portfolio instead of placing many manual trades. When you run the command, if the market is open for an asset you hold, the algorithm liquidates it with market orders. If the market is not open, the algorithm places market on open orders. After the algorithm submits the liquidation orders, it stops executing.

To stop an algorithm, open a terminal in the workspace that contains the project and then run lean cloud live liquidate "My Project".