Initialization
Configuration
Global Configuration
The global CLI configuration directory stores the CLI defaults and API credentials. The exact location of the directory depends on your operating system. The following table shows the path of each operating system:
Operating System | Path |
---|---|
Windows | C: \ Users \ <username> \ .lean |
macOS | / Users / <username> / .lean |
Linux | / home / <username> / .lean |
The global CLI configuration directory contains three files and one directory. The following table describes the files and directory:
Name | Description |
---|---|
credentials | This file contains the API credentials given via lean login . |
config | This file contains the CLI defaults, like the default project language used when running lean project-create . |
cache | This file contains an internal cache that the CLI uses whenever it needs to persistently store data. One of its uses is to store the last time an update check has run to make sure we don't check for updates too often. |
ssh | This directory contains the SSH keys that are needed to debug over SSH when debugging with Rider. |
The global configuration files are always updated via the CLI and should not be updated or removed manually, unless when you are uninstalling the CLI.
Lean Configuration
The Lean configuration contains settings for locally running the LEAN engine.
This configuration is created in the lean.json file when you run lean init
in an empty directory.
The configuration is stored as JSON, with support for both single-line and multiline comments.
The Lean configuration file is based on the Launcher / config.json file from the Lean GitHub repository.
When you run lean init
, the latest version of this file is downloaded and stored in your organization workspace.
Before the file is stored, some properties are automatically removed because the CLI automatically sets them.
The CLI commands can update most of the values of the lean.json file. The following table shows the configuration settings that you need to manually adjust in the lean.json file if you want to change their values:
Name | Description | Default |
---|---|---|
show-missing-data-logs | Log missing data files. This is useful for debugging. | true |
algorithm-manager-time-loop-maximum | The maximum amount of time the algorithm can spend in a single time loop. | 20 |
maximum-warmup-history-days-look-back | The maximum number of days of data the history provider will provide during warm-up in live trading. The history provider expects older data to be on disk. | 5 |
maximum-chart-series | The maximum number of chart series you can create in backtests. | 30 |
maximum-data-points-per-chart-series | The maximum number of data points you can add to a chart series in backtests. | 1,000,000 |
Project Configuration
For information about project configuration, see Projects > Configuration.