I've recently joined QuantConnect after using Quantopian for awhile, since I'm a C# programmer by trade. For my first algorithm I've done a simple Faber Sector Rotation just to get the hang of things.
I've noticed that the results from QuantConnect vs Quantopian are fairly different. QuantConnect gives me a return of 70% while Quantopian is at 63%.
Both sites say equity prices are split and dividend adjusted, but I've looked at the trades from both and the prices for securities at a given time definitely don't match up.
Has anyone run into this as well? I'm wondering which site's prices are more accurate? Any info or insights would be appreciated.
Here's a link to the Quantopian backtest: https://www.quantopian.com/posts/fabers-sector-rotation
Sean McKenna
I would think Quantconnect, since they have per tick data on equities. Quantopian is only every 5 minutes.
I also just switch from Quantopian, mainly because I hate python, and I think their API docs are rubbish.
Jared Broad
From a quick look there are a few differences. I'd guess its a combination of the MOM indicator as your performance indicator, and the daily indicator values. Comparing the net return isn't helpful though - you need to ask different questions. E.g. what exactly is happening at every moment for every trade in your algorithm? When you understand this and differences become transparent. To truely understand this you should analyse every single trade.
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Caleb Sandfort
@Jared thanks for the tips, I will definitely keep these in mind going forward.
I assumed the MOM indicator was percentage based; switched to MOMP and now getting behavior closer to what I expected.
John Glossner
As a new QC subscriber I've been looking at this since my algorithms are currently at Quantopian.
Quantopian equity data is 1-minute/daily resolution TRADE data ONLY during market open (9:30 to 16:00) since 2002 ALWAYS adjusted.
QuantConnect equity data is tick/second/minute/hourly/daily resolution TRADE data from 7:00 to 18:00 since 1998 avaiable as Raw/Adjusted/SplitAdjusted/TotalReturn.
QuantConnect has consolidators that allow you to easily build other timeframes (e.g. 5-minute bars). In Quantopian you have to write your own resampler.
However, I'm still trying to figure out calls to History. In Quantopian they prefer you do not store history in your backtest because each bar is adjusted for every call to data.history()
The examples I've seen for indicators in QC tend to use rolling windows and append new values to a window thereby saving data that might not be correctly adjusted. If you're trading on an intraday basis probably not a problem. Monthly indicators might be an issue.
I did get my indicators to work with consolidators using the rolling window approach but I'm guessing I should really port my resampling code and call History() every bar period so values are always adjusted properly.
QC - any thoughts on this? Is there a way to use consolidators in calls to History()?
John Glossner
Attached is code that is likely to be quite useful to Quantopian programmers transitioning to QC. I wrote it to try to figure out why Q and QC data is different and it contains the following features:
The code uses Consolidators and pandas.resample() to compare 1min/5min data. I also compare those values to my broker data. Unfortunately I can't make the output available because it is against the terms of service. However, I did make all the code available so anyone can run it themselves. Here is what I found:
I used FB for comparison and only looked at 20 minutes of data. Before accepting the conclusions below much more data should be evaluated.
Caleb Sandfort
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!