DefaultRandomProvider
StockSharp.Algo.Testing
Default random provider using system Random.
Implements: IRandomProvider
Constructors
DefaultRandomProvider
public DefaultRandomProvider()
defaultRandomProvider = DefaultRandomProvider()
Initializes a new instance with current time seed.
DefaultRandomProvider
public DefaultRandomProvider(int seed)
defaultRandomProvider = DefaultRandomProvider(seed)
Initializes a new instance with specified seed.
- seed
- Random seed.
Methods
NextSpreadStep
public int NextSpreadStep(int maxSpreadSize)
result = defaultRandomProvider.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 = defaultRandomProvider.NextVolume()
Gets next random volume for synthetic order book generation.
Returns: Random volume.
ShouldFail
public bool ShouldFail(double failingPercent)
result = defaultRandomProvider.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 = defaultRandomProvider.ShouldMatch()
Determines whether order should be matched when processing order book changes.
Returns: True if should match.