I am new to QuantConnect and am currently back testing a strategy using BackwardsPanamaCanal continuous futures data.
All calculations and order generation is derived from this back-adjusted data, however limit orders for the back test are being executed QC's raw unadjusted data which is obviously non-sensical.
How I can for the purpose of the back test, trade on the back-adjusted data?
Steven Biggs
Rereading my post and seeing that as yet there are no replies, perhaps my message was not all that clear. So let me ask again using a very simple example.
Please keep in mind that this query relates solely to backtesting and is not relevant to live trading.
Let’s make up a rule where we calculate a 20-day moving average (MA) based on daily bars and then simply place a limit order to buy if the market falls 5 points below the MA.
Anyone with any experience working with historical futures data knows that in order to accurately calculate the MA we need to firstly adjust the historical daily data so as to remove the gaps that occur when rolling from an expiring contract to a new contract. QuantConnect offers a few methods to do this, but the most suitable is via BackwardsPanamaCanal.
So to pick a past date, back on Jan 2nd 2009 the 20 day MA for the back-adjusted data for the e-mini S&P was 533 … so we want to place a limit order to buy at 528. All good so far.
However, the way that QuantConnect works is that it places the 528 limit order to work, not on the back-adjusted data but on the actual March 2009 contract which was then trading at 925. Effectively calculating our orders based on adjusted data, and then trying to fill on unadjusted data. Obviously, this is not our intent when carrying out the backtest.
I’ve never come across this before. Every other platform I’ve worked with (including TradeStation, MultiCharts, NinjaTrader, AmiBroker etc) correctly fills on the same adjusted data used to calculate indicators, orders etc.
I’m an experienced futures trader but new to Quantconnect so I’m hopeful there’s a fairly obvious solution to this. But if not then I’d suggest that QuantConnect is totally unusable as a platform to backtest strategies employing futures contracts … please prove me wrong!
Louis Szeto
Hi Sorin
Continuous Future contracts are developed mainly for feeding data to time series predictions and indicators, but not for execution purpose. There are many methods on exeuction or limit order price setting. Do you mind telling us what is your desired logic, so we can give a helping hand?
Best
Louis
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.
Steven Biggs
Hi Sorin, I’m afraid I never got any response from QuantConnect on this, so I still stand by my statement that “QuantConnect is totally unusable as a platform to backtest strategies employing futures contracts”
Louis, if you take the time to read the above post you will see that the issue relates to backtesting not execution.
Steven Biggs
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!