DefaultEmulationRandomizer

StockSharp.Algo.Testing

The decisions an emulated venue makes, drawn from a source of random values.

Implements: IEmulationRandomizer

Constructors

DefaultEmulationRandomizer
public DefaultEmulationRandomizer()
defaultEmulationRandomizer = DefaultEmulationRandomizer()

Initializes a new instance with a source nobody holds the seed of, so runs vary.

DefaultEmulationRandomizer
public DefaultEmulationRandomizer(int seed)
defaultEmulationRandomizer = DefaultEmulationRandomizer(seed)

Initializes a new instance drawing from the stated point, so the run can be had again.

seed
Where the series starts.
DefaultEmulationRandomizer
public DefaultEmulationRandomizer(IRandomProvider random)
defaultEmulationRandomizer = DefaultEmulationRandomizer(random)

Initializes a new instance drawing from the given source.

random
Source of random values.

Methods

NextSpreadStep
public int NextSpreadStep(int maxSpreadSize)
result = defaultEmulationRandomizer.NextSpreadStep(maxSpreadSize)

Gets next spread step multiplier for order book generation.

maxSpreadSize
Maximum spread size from settings.

Returns: Spread step multiplier (1 to maxSpreadSize).

NextVolume
public decimal NextVolume()
result = defaultEmulationRandomizer.NextVolume()

Gets next random volume for synthetic order book generation.

Returns: Random volume.

ShouldFail
public bool ShouldFail(double failingPercent)
result = defaultEmulationRandomizer.ShouldFail(failingPercent)

Determines whether operation should fail (for failure simulation).

failingPercent
Failing percentage from settings (0-100).

Returns: True if should fail.

ShouldMatch
public bool ShouldMatch()
result = defaultEmulationRandomizer.ShouldMatch()

Determines whether order should be matched when processing order book changes.

Returns: True if should match.