tensortrade.oms.services.slippage.random_slippage_model module¶
- class tensortrade.oms.services.slippage.random_slippage_model.RandomUniformSlippageModel(*args, **kwargs)[source]¶
Bases:
SlippageModel
A uniform random slippage model.
- Parameters:
max_slippage_percent (float, default 3.0) – The maximum random slippage to be applied to the fill price.
- adjust_trade(trade: Trade, **kwargs) Trade [source]¶
Simulate slippage on a trade ordered on a specific exchange.
- Parameters:
trade (Trade) – The trade executed on the exchange.
**kwargs (keyword arguments) – Any other arguments necessary for the model.
- Returns:
Trade – A filled trade with the price and size adjusted for slippage.