---
title: "Writing Algorithms"
description: "Learn tools you need to build algorithmic trading strategies."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms
modified: 2026-10-21
index: https://www.quantconnect.com/llms.txt
---

# Writing Algorithms

[Documentation](https://www.quantconnect.com/docs/v2.md) > Writing Algorithms

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

![](https://cdn.quantconnect.com/i/tu/docs-algo-icon.svg)

### Writing Algorithms

### Learn tools you need to build algorithmic trading strategies

### Feature Complete Algorithmic Trading API

Build on a mature, flexible, feature-complete API managing billions of dollars capital, and used by 5,000+ investors every month.

[Get Started](https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/getting-started.md) [Download PDF](https://cdn.quantconnect.com/docs/i/Quantconnect-Writing-Algorithms-Python.pdf)

![Writing Algorithms](https://cdn.quantconnect.com/i/tu/header-img-algo.webp)

#### IN THIS SECTION

[Getting Started](https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/getting-started.md) [Supported Asset Classes](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes.md) [Trading and Orders](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/key-concepts.md) [API Reference](https://www.quantconnect.com/docs/v2/writing-algorithms/api-reference.md)

---

- [Key Concepts](https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/getting-started.md): Learn the key concepts before developing your algorithm
- [Initialization](https://www.quantconnect.com/docs/v2/writing-algorithms/initialization.md): The starting point of all algorithms
- [Securities](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/key-concepts.md): Model of individual financial assets in your algorithm
- [Portfolio](https://www.quantconnect.com/docs/v2/writing-algorithms/portfolio/key-concepts.md): Model of the collection of assets in your algorithm
- [Universes](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/key-concepts.md): Process of screening or filtering the assets you'd like to trade
- [Datasets](https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/overview.md): Learn about the available datasets
- [Importing Data](https://www.quantconnect.com/docs/v2/writing-algorithms/importing-data/key-concepts.md): Import your custom data into your algorithm
- [Consolidating Data](https://www.quantconnect.com/docs/v2/writing-algorithms/consolidating-data/getting-started.md): Create bars of any length from smaller bars
- [Historical Data](https://www.quantconnect.com/docs/v2/writing-algorithms/historical-data/history-requests.md): Request historical data
- [Trading and Orders](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/key-concepts.md): Place and manage orders
- [Reality Modeling](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/key-concepts.md): Model the behavior of things like the fills, slippage, and fees.
- [Scheduled Events](https://www.quantconnect.com/docs/v2/writing-algorithms/scheduled-events.md): Execute time-based events
- [Indicators](https://www.quantconnect.com/docs/v2/writing-algorithms/indicators/key-concepts.md): LEAN provides more than 100 pre-built technical indicators and candlestick patterns
- [Optimization](https://www.quantconnect.com/docs/v2/writing-algorithms/optimization/parameters.md): Find the optimal parameter values for your strategy
- [Object Store](https://www.quantconnect.com/docs/v2/writing-algorithms/object-store.md): File system that you can use in your algorithms to save, read, and delete data
- [Machine Learning](https://www.quantconnect.com/docs/v2/writing-algorithms/machine-learning/key-concepts.md): Use machine learning to generate trading signals
- [Algorithm Framework](https://www.quantconnect.com/docs/v2/writing-algorithms/algorithm-framework/overview.md): Use pluggable algorithm modules to create your algorithm
- [Charting](https://www.quantconnect.com/docs/v2/writing-algorithms/charting.md): Add custom charting to your algorithm
- [Logging](https://www.quantconnect.com/docs/v2/writing-algorithms/logging.md): Log important information from your algorithm to further analysis
- [Statistics](https://www.quantconnect.com/docs/v2/writing-algorithms/statistics.md): Tracks all the statistics of your algorithm
- [Live Trading](https://www.quantconnect.com/docs/v2/writing-algorithms/live-trading.md): Deploy algorithm that trade with real-time data
- [Strategy Library](https://www.quantconnect.com/docs/v2/writing-algorithms/strategy-library.md): Collection of tutorials written by the QuantConnect team and community members.
- [API Reference](https://www.quantconnect.com/docs/v2/writing-algorithms/api-reference.md): QCAlgorithm API Reference
- [Migrations](https://www.quantconnect.com/docs/v2/writing-algorithms/migrations/zipline.md): Transition from other trading engines to LEAN

## Pages in This Section

- [Key Concepts](https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/getting-started.md)
- [Initialization](https://www.quantconnect.com/docs/v2/writing-algorithms/initialization.md): The Initialize method is the entry point of your algorithm where you define a series of settings, including security subscriptions, and starting cash balances.
- [Securities](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/key-concepts.md)
- [Portfolio](https://www.quantconnect.com/docs/v2/writing-algorithms/portfolio/key-concepts.md)
- [Universes](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/key-concepts.md)
- [Datasets](https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/overview.md)
- [Importing Data](https://www.quantconnect.com/docs/v2/writing-algorithms/importing-data/key-concepts.md)
- [Consolidating Data](https://www.quantconnect.com/docs/v2/writing-algorithms/consolidating-data/getting-started.md)
- [Historical Data](https://www.quantconnect.com/docs/v2/writing-algorithms/historical-data/getting-started.md)
- [Trading and Orders](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/key-concepts.md)
- [Reality Modeling](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/key-concepts.md)
- [Scheduled Events](https://www.quantconnect.com/docs/v2/writing-algorithms/scheduled-events.md): Scheduled Events let you trigger code to run at specific times of day, regardless of your algorithm's data subscriptions.
- [Indicators](https://www.quantconnect.com/docs/v2/writing-algorithms/indicators/supported-indicators.md)
- [Object Store](https://www.quantconnect.com/docs/v2/writing-algorithms/object-store.md): The Object Store is an organization-specific file system that you can use in your algorithms to save, read, and delete data.
- [Optimization](https://www.quantconnect.com/docs/v2/writing-algorithms/optimization/parameters.md)
- [Machine Learning](https://www.quantconnect.com/docs/v2/writing-algorithms/machine-learning/key-concepts.md)
- [Algorithm Framework](https://www.quantconnect.com/docs/v2/writing-algorithms/algorithm-framework/overview.md)
- [Charting](https://www.quantconnect.com/docs/v2/writing-algorithms/charting.md): We provide a powerful charting API that you can use to build many chart types.
- [Logging](https://www.quantconnect.com/docs/v2/writing-algorithms/logging.md): Logging statements are statements you can add to your algorithm in order to add information to the log file, Cloud Terminal, or stop the algorithm.
- [Statistics](https://www.quantconnect.com/docs/v2/writing-algorithms/statistics.md): LEAN automatically monitors a set of statistics as your algorithms execute. You can even create custom statistics for further analysis.
- [Live Trading](https://www.quantconnect.com/docs/v2/writing-algorithms/live-trading.md): QuantConnect enables you to run your algorithms in live mode with real-time market data.
- [Strategy Library](https://www.quantconnect.com/docs/v2/writing-algorithms/strategy-library.md): Review this collection of tutorials written by the QuantConnect team and community members to learn about trading strategies in the literature.
- [API Reference](https://www.quantconnect.com/docs/v2/writing-algorithms/api-reference.md): The QuantConnect API Reference is a comprehensive technical document that details the LEAN algorithmic trading framework.
- [Migrations](https://www.quantconnect.com/docs/v2/writing-algorithms/migrations/zipline.md)
