To get price data for a future instrument, is it recommended to use the “continuous Future contract” that are subscribed to my default when calling self.AddFuture(), or is it better to use the price data of a specific future contract retrieved my the future.Mapped property? Take the micro e-mini S&P futures for example: For my price analysis, should I use the price of the continuous /MES symbol or the underlying MES15H24 MES16M23 contracts? Why does the price differ between the continuous aggregated contract and a specific contract?
Also, if the plan is to day trade, thereby exiting all positions before the end of the day, does it matter which of the specific future contracts I select when entering a trade in the future instrument?
B9 Mike
Hi Haakon
Since you are day trading, you will likely want the unadjusted raw price data from the ES contract with the largest open interest.
Running the cells below in a Research Notebook will load and display the one minute resolution ES data for 12/15/2022. That date happens to be the day prior to the Expiration date for the December contract. Because dataMappingMode = DataMappingMode.OpenInterest and dataNormalizationMode = DataNormalizationMode.Raw, you will get the actual unadjusted price data for the March 23 contract because it has a higher open interest than the soon to be expired Dec 22 contract.
Note also that my “get_ES_Hist” function assumes you want the extended trading hours data as well, so the data will start at 6pm ET the prior evening and run through the end date.
Hope this helps,
MikeJ
Haakon
MikeJ Thanks a lot for the reply! 😊 I have some follow-up questions:
Code:
Plot resultB9 Mike
Best,
MikeJ
Haakon
B9 Mike Thanks again!
Haakon
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!