I migrated from Quantopian and I really enjoy the QC here. One thing I want to ask is, in Quantopian they provide default slippage model like this:

"If you do not specify a slippage method, slippage defaults to VolumeShareSlippage(volume_limit=0.025, price_impact=0.1) (you can take up to 2.5% of a minute's trade volume)."

I was wondering in QC, how can I set up something like above - as far as I could understand, all partially filled orders in QC are set to immediately filled. After some research, it seems that I should use

// Set the fill models in initialize: Securities["IBM"].FillModel = new PartialFillModel(); // Custom fill model implementation stub public class PartialFillModel : ImmediateFillModel { public override OrderEvent MarketFill(Security asset, MarketOrder order) { //Override order event handler and return partial order fills, } }

However, I am stuck at this point:

1. My algo is not using individual Securities function to add stocks, it is using custom universe, so I was wondering if I could use something like, Universe.FillModel to set every stock in the universe.

 

2. What code should go in the the PartialFillModel to let it perform similar function as the slippage model in Quantopian?

 

Thanks so much!

Author