Quantopian has some built in features for modeling slippage, commisions, and dividends. These are described in the Help section: <a href="https:&#x2F;&#x2F;www.quantopian.com&#x2F;help#ide-slippage" rel="nofollow">https:&#x2F;&#x2F;www.quantopian.com&#x2F;help#ide-slippage</a>