Lean  $LEAN_TAG$
QuantConnect.ToolBox.RandomDataGenerator.TickGenerator Class Reference

Generates random tick data according to the settings provided More...

Inheritance diagram for QuantConnect.ToolBox.RandomDataGenerator.TickGenerator:
[legend]

Public Member Functions

 TickGenerator (RandomDataGeneratorSettings settings, TickType[] tickTypes, Security security, IRandomValueGenerator random)
 
IEnumerable< TickGenerateTicks ()
 Generates and enumerates data points for current symbol More...
 
virtual Tick NextTick (DateTime dateTime, TickType tickType, decimal maximumPercentDeviation)
 Generates a random Tick that is at most the specified maximumPercentDeviation away from the previous price and is of the requested tickType More...
 
Tick NextOpenInterest (DateTime dateTime, decimal previousValue, decimal maximumPercentDeviation)
 Generates a random Tick that is at most the specified maximumPercentDeviation away from the previousValue and is of the Open Interest More...
 
virtual DateTime NextTickTime (DateTime previous, Resolution resolution, DataDensity density)
 Generates a random DateTime suitable for use as a tick's emit time. If the density provided is DataDensity.Dense, then at least one tick will be generated per resolution step. If the density provided is DataDensity.Sparse, then at least one tick will be generated every 5 resolution steps. if the density provided is DataDensity.VerySparse, then at least one tick will be generated every 50 resolution steps. Times returned are guaranteed to be within market hours for the specified Symbol More...
 

Detailed Description

Generates random tick data according to the settings provided

Definition at line 28 of file TickGenerator.cs.

Member Function Documentation

◆ GenerateTicks()

IEnumerable<Tick> QuantConnect.ToolBox.RandomDataGenerator.TickGenerator.GenerateTicks ( )

Generates and enumerates data points for current symbol

Implements QuantConnect.ToolBox.RandomDataGenerator.ITickGenerator.

Definition at line 60 of file TickGenerator.cs.

Here is the call graph for this function:

◆ NextTick()

virtual Tick QuantConnect.ToolBox.RandomDataGenerator.TickGenerator.NextTick ( DateTime  dateTime,
TickType  tickType,
decimal  maximumPercentDeviation 
)
virtual

Generates a random Tick that is at most the specified maximumPercentDeviation away from the previous price and is of the requested tickType

Parameters
dateTimeThe time of the generated tick
tickTypeThe type of Tick to be generated
maximumPercentDeviationThe maximum percentage to deviate from the previous price for example, 1 would indicate a maximum of 1% deviation from the previous price. For a previous price of 100, this would yield a price between 99 and 101 inclusive
Returns
A random Tick value that is within the specified maximumPercentDeviation from the previous price

Implements QuantConnect.ToolBox.RandomDataGenerator.ITickGenerator.

Definition at line 142 of file TickGenerator.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NextOpenInterest()

Tick QuantConnect.ToolBox.RandomDataGenerator.TickGenerator.NextOpenInterest ( DateTime  dateTime,
decimal  previousValue,
decimal  maximumPercentDeviation 
)

Generates a random Tick that is at most the specified maximumPercentDeviation away from the previousValue and is of the Open Interest

Parameters
dateTimeThe time of the generated tick
previousValueThe previous price, used as a reference for generating new random prices for the next time step
maximumPercentDeviationThe maximum percentage to deviate from the previousValue , for example, 1 would indicate a maximum of 1% deviation from the previousValue . For a previous price of 100, this would yield a price between 99 and 101 inclusive
Returns
A random Tick value that is within the specified maximumPercentDeviation from the previousValue

Definition at line 197 of file TickGenerator.cs.

Here is the caller graph for this function:

◆ NextTickTime()

virtual DateTime QuantConnect.ToolBox.RandomDataGenerator.TickGenerator.NextTickTime ( DateTime  previous,
Resolution  resolution,
DataDensity  density 
)
virtual

Generates a random DateTime suitable for use as a tick's emit time. If the density provided is DataDensity.Dense, then at least one tick will be generated per resolution step. If the density provided is DataDensity.Sparse, then at least one tick will be generated every 5 resolution steps. if the density provided is DataDensity.VerySparse, then at least one tick will be generated every 50 resolution steps. Times returned are guaranteed to be within market hours for the specified Symbol

Parameters
previousThe previous tick time
resolutionThe requested resolution of data
densityThe requested data density
Returns
A new DateTime that is after previous according to the specified resolution and density specified

Implements QuantConnect.ToolBox.RandomDataGenerator.ITickGenerator.

Definition at line 222 of file TickGenerator.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: