Learning QuantConnect - Part VII: Reality Modeling (Python) ππ¨βπ
Screenshot: QuantConnect Strategy results
QuantConnect is a powerful open-source, cloud-based platform for algorithmic trading platform. It allows users to design, test, and deploy trading strategies across various financial markets including equities, FX, futures, options, and cryptocurrencies.
QuantConnect can be a bit of a beast when it comes to complexity. This thing is packed with features and, let's be real, wading through the docs can be a bit of a drag. So in this series I tried to break it down into bite-sized chunks that won't make your head hurt. In this part we will take a look at how to use a really cool backtesting feature: reality models.
Suggested Reads:
Learning QuantConnect - Part II: Portfolio, Security Holding & Cashbook
Learning QuantConnect - Part IV: Working with Data and DataSets
Learning QuantConnect - Part VI: Indicators & Candlestick Patterns
This story is solely for general information purposes, and should not be relied upon for trading recommendations or financial advice. Source code and information is provided for educational purposes only, and should not be relied upon to make an investment decision. Please review my full cautionary guidance before continuing
What is Reality Modeling?
Reality Modeling is a QuantConnect term for creating conditions that make backtests more realistic in order to simulator live trading. Reality models can be set for individual securities as well as on the portfolio level. However, only specific models are available to be set on the security, versus the portfolio levels.
Here a list of the supported types of Reality Models and the levels to which they can be applied to:
Security-level models:
Trade Fills
Slippage
Fee
Brokerages
Buying Power
Settlement
Short Availability
Option models (Pricing, Volatility, Exercise)
Assignment
Margin Interest Rate
Dividend Yield
Portfolio-level models:
Margin Call model
Risk-free interest rate model.
Since there are quite a few of these models, not all will be discussed in detail in this post.