When I do backtesting using market ordering the algorithm performance is great.  When you Liquidate or SetHoldings does it buy/sell at the closing price exactly? When I deploy the algorithm live using the same strategy with marekt orders the prices vary wildly and the gains are eliminated. Is there a better strategy using market orders or using Interactive Broker's back-end algorithmss (e.g smart routing etc) In other words, I know that marekt orders can be less than optimal getting you the best price but the execute immediately which is what I need. Any suggestions are welcomed :)

Author