DefaultRandomProvider
StockSharp.Algo.Testing
使用系统随机的默认随机提供者 。
实现: IRandomProvider
构造函数
DefaultRandomProvider
public DefaultRandomProvider()
defaultRandomProvider = DefaultRandomProvider()
初始化当前时间种子的新实例 。
DefaultRandomProvider
public DefaultRandomProvider(int seed)
defaultRandomProvider = DefaultRandomProvider(seed)
初始化新实例,并指定种子。
- seed
- 随机相出种子.
方法
NextSpreadStep
public int NextSpreadStep(int maxSpreadSize)
result = defaultRandomProvider.NextSpreadStep(maxSpreadSize)
获得下个传播步骤乘以生成订单书.
- maxSpreadSize
- 设置的最大扩展大小 。
返回值: Spread step multiplier (1 to maxSpreadSize).
NextVolume
public decimal NextVolume()
result = defaultRandomProvider.NextVolume()
获得下个随机量,用于合成订单书生成.
返回值: 随机相出.
ShouldFail
public bool ShouldFail(double failingPercent)
result = defaultRandomProvider.ShouldFail(failingPercent)
确定操作是否失败( 对于失败模拟) 。
- failingPercent
- 设置失败百分比( 0- 100) 。
返回值: 如果失败的话,是的。
ShouldMatch
public bool ShouldMatch()
result = defaultRandomProvider.ShouldMatch()
确定处理命令簿更改时是否应当匹配命令。
返回值: 说得没错