Hi! Can anyone explain me how future contract trading works?
I know, that OrderEvents (Trades) are filled in the FillModel. FillModel is using prices from the Security itself.
When you trading futures, you can get info about FutureContract and trade it. FutureContract only has a Symbol, not Security.
All FutureContract for current future security are stored in the FuturesChain. FuturesChain is a BaseData, but fields Price or Value are not set anywhere. Probably because we can't define a single Price for many contracts.
I have couple of ideas about contract trading, but I can't find any code to confirm them.
When I create order on a Contract's Symbol:
1. Lean will automatically create Security from it. But I don't know how Price of this Security will be set.
2. Lean will use main future security to handle this order, but this is more confusing, because our future can have more than one active contract at the same time. Which contract's price will be used in Security state? Will Lean override current security state to handle trade for a specific contract?
Varad Kabade
Hi Sava,
Best,
Varad Kabade
Sava Lifanov
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!