tensortrade.oms.services.slippage.random_slippage_model module

class tensortrade.oms.services.slippage.random_slippage_model.RandomUniformSlippageModel(max_slippage_percent: float = 3.0)[source]

Bases: tensortrade.oms.services.slippage.slippage_model.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: tensortrade.oms.orders.trade.Trade, **kwargs) → tensortrade.oms.orders.trade.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.