Table of Contents

Class MarketDataGenerator

Namespace
StockSharp.Algo.Testing
Assembly
StockSharp.Algo.dll

The market data generator.

public abstract class MarketDataGenerator : Cloneable<MarketDataGenerator>
Inheritance
MarketDataGenerator
Derived
Extension Methods

Constructors

MarketDataGenerator(SecurityId)

Initialize MarketDataGenerator.

protected MarketDataGenerator(SecurityId securityId)

Parameters

securityId SecurityId

The identifier of the instrument, for which data shall be generated.

Properties

DataType

Market data type.

public abstract DataType DataType { get; }

Property Value

DataType

Interval

The data generation interval.

public TimeSpan Interval { get; set; }

Property Value

TimeSpan

LastGenerationTime

The time of last data generation.

protected DateTimeOffset LastGenerationTime { get; set; }

Property Value

DateTimeOffset

MaxPriceStepCount

The maximal number of price increments PriceStep to be returned through massive Steps.

public int MaxPriceStepCount { get; set; }

Property Value

int

Remarks

The default value is 10.

MaxVolume

The maximal volume. The volume will be selected randomly from MinVolume to MaxVolume.

public int MaxVolume { get; set; }

Property Value

int

Remarks

The default value equals 20.

MinVolume

The maximal volume. The volume will be selected randomly from MinVolume to MaxVolume.

public int MinVolume { get; set; }

Property Value

int

Remarks

The default value is 1.

RandomArrayLength

The length of massive of preliminarily generated random numbers. The default is 100.

public int RandomArrayLength { get; set; }

Property Value

int

SecurityDefinition

Information about the trading instrument.

protected SecurityMessage SecurityDefinition { get; }

Property Value

SecurityMessage

SecurityId

The identifier of the instrument, for which data shall be generated.

public SecurityId SecurityId { get; }

Property Value

SecurityId

Steps

The massive of random price increments in the range from 1 to MaxPriceStepCount.

public RandomArray<int> Steps { get; protected set; }

Property Value

RandomArray<int>

Volumes

The massive of random volumes in the range from MinVolume to MaxVolume.

public RandomArray<int> Volumes { get; protected set; }

Property Value

RandomArray<int>

Methods

CopyTo(MarketDataGenerator)

Copy the message into the destination.

protected void CopyTo(MarketDataGenerator destination)

Parameters

destination MarketDataGenerator

The object, to which copied information.

Init()

To initialize the generator state.

public virtual void Init()

IsTimeToGenerate(DateTimeOffset)

Is new data generation required.

protected bool IsTimeToGenerate(DateTimeOffset time)

Parameters

time DateTimeOffset

The current time.

Returns

bool

true, if data shall be generated, Otherwise, false.

OnProcess(Message)

Process message.

protected abstract Message OnProcess(Message message)

Parameters

message Message

Message.

Returns

Message

The result of processing. If null is returned, then generator has no sufficient data to generate new message.

Process(Message)

Process message.

public virtual Message Process(Message message)

Parameters

message Message

Message.

Returns

Message

The result of processing. If null is returned, then generator has no sufficient data to generate new message.