Datasets
Generating Random Data
Introduction
Running the LEAN engine locally with the CLI requires you to have your own local data. Instead of using actual market data, you can also opt to use realistic fake data by using LEAN's random data generator. This generator uses a Brownian motion model to generate realistic market data. It is capable of generating data for most of LEAN's supported security types and resolutions, which makes it a good solution to design and test algorithms without the need to buy real financial data.
Supported Security Types
The random data generator supports the following security types and resolutions:
Security Type | Supported Resolutions |
---|---|
Equity | Tick, Second, Minute, Hour, and Daily |
Forex | Tick, Second, Minute, Hour, and Daily |
CFD | Tick, Second, Minute, Hour, and Daily |
Future | Tick, Second, Minute, Hour, and Daily |
Crypto | Tick, Second, Minute, Hour, and Daily |
Option | Minute |
Run the Generator
Follow these steps to generate random data:
- Open a terminal in your CLI root directory.
-
Run
lean data generate --start 20150101 --symbol-count 10
to generate dense minute equity data since 01-01-2015 for 10 random symbols.$ lean data generate --start 20150101 --symbol-count 10 Begin data generation of 10 randomly generated Equity assets...
--end <yyyyMMdd>
, generate data for a different security type using--security-type <type>
, for a different resolution using--resolution <resolution>
, or with a different density using--data-density <density>
.
It may also be helpful to runlean data generate --help
for the full list of options.