Hi community,
Starting from yesterday, making history call to VX future and trading VX future both failed, whereas they worked just fine before. Could anyone help me with this?
Here is the code for adding VIX future, making history calls, and sending orders:
self.VX=self.AddFuture(Futures.Indices.VIX,Resolution.MINUTE, dataNormalizationMode=DataNormalizationMode.BackwardsRatio, dataMappingMode=DataMappingMode.OpenInterest, extendedMarketHours=True),
df_VX = self.history(self.VX.symbol, 100, Resolution.HOUR) # empty
self.vx_contract = self.securities[self.VX.mapped]
if not self.portfolio.invested:
self.market_order(self.vx_contract.symbol, 1) # error
Thank you!
Mia Alissi
Here are some steps to address the issues Howard is facing with the VIX future history call and order placement:
Correct Method Usage: Ensure that the
add_future
method is used correctly. The corrected code snippet is:History Call: Verify that the
history
method is fetching data correctly. The corrected code snippet is:Ensure that the
symbol
attribute is accessed correctly and that the history call is made with the correct parameters.Market Order: Ensure the
market_order
method is called correctly:Make sure that
self.vx_contract.symbol
is correctly defined and accessible.Error Handling: Implement error handling to capture and log any exceptions or errors during the history call or order placement. This will help identify specific issues when they occur.
Check Data Subscription: Ensure that the data subscription for the VIX future is active and receiving data, especially during extended market hours.
By following these steps, Howard should be able to troubleshoot and resolve the issues with the VIX future history call and order placement.
Sources: Exploiting Term Structure Of Vix Futures, Pandas Data Frame History Algorithm
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.
Howard Hou
This procedure works for all future contracts except VIX future, and it worked for VIX future a few days ago. That's way I made the post. could you try it and look into the problem? Thanks.
Howard Hou
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!