29 private readonly decimal _priceImpact;
30 private readonly decimal _volumeLimit;
39 _priceImpact = priceImpact;
40 _volumeLimit = volumeLimit;
49 if (lastData ==
null)
return 0;
52 var slippagePercent = _volumeLimit * _volumeLimit * _priceImpact;
54 switch (lastData.DataType)
57 barVolume = ((
TradeBar)lastData).Volume;
84 var volumeShare = Math.Min(order.
AbsoluteQuantity / barVolume, _volumeLimit);
86 slippagePercent = volumeShare * volumeShare * _priceImpact;
89 return slippagePercent * lastData.Value;