Austin,
This is a great question! The backtesting and live trading environments differ by 4 main factors: data source for pricing, slippage effect, commissions, and end of day behavior.
Data source: We use a private data vendor to feed historical prices into the backtester and use Nanex's NxCore product for the data in live trading algorithms.
Slippage: This effect is modeled in the backtester. If left undefined, it will take on the default values. You can adjust these parameters to better fit your strategy, or write your own custom-slippage model. In live trading, this variable is ignored and the broker fills the order according to market conditions.
Commissions: This is also modeled in the backtester and has default values. These parameters are adjustable and you can tweak it for your algo and expected broker expenses. In live trading, this variable is ignored and the broker charges the standard commission fees.
EOD behavior: In live trading, all open orders are cancelled at the end of the day. To be more precise, when we submit an order to IB, it's sent with a note to expire at 4PM. The reason for this is because prices can move significantly overnight, especially for thinly traded securities. We took a more prudent and conservative approach in live trading, and didn't want to expose an algo to any wild fluctuations. To be clear, if you have a partially filled position, any remaining open orders for that position will be cancelled at the end of day.
In backtesting, open orders persist from day-to-day. This means if you have an open position at 4PM on Monday, it will be available to be filled at 9:31PM on Tuesday. This is one of the differences between backtesting and live trading and we'd like to close this gap to align the behavior.
Now to the fun part: how does the performance differ between a backtest and a live trading algorithm? Below is a screenshot of a live trading algorithm that is trading the 9 Sector ETF Diversified Portfolio, whose code is available here. This is an algorithm we wrote and shared as a live trading example. This screenshot says the market is closed because I grabbed the image after 4PM EST. During market hours, the color of the banner changes and it says "live trading".
The results are pretty darn close. The backtest shows algorithm total returns of 11.2% versus live algorithm returns of 10.7%. If you don't feel comfortable immediately jumping from backtesting to trading real money, you can use an IB paper account to simulate the trades. This uses the same infrastructure as IB real money accounts.
Alisa
Disclaimer
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.