I am currently dealing with the Hang Seng Index, and I would like to trade with its Futures. However, I do not see any data provider that provides this symbol's tick data. I see two CFDs from FXCM and OANDA, but those are CFDs and do not have a contract multiplier.
Therefore, I use my own custom data to import to the algorithm lab to perform backtesting.
The problem is that the backtesting mechanism considers the custom data as equity and does not have a contract multiplier. Therefore, the backtest cannot show the correct result from the custom data.
Is there a way to adjust custom data into Futures and set the contract multiplier? I have been investigating this for a while, and I see that symbolProperties has been updated to read-only, so I am unable to fix this. Do you have any ideas?
Mia Alissi
Yes, you can adjust custom data into Futures and set the contract multiplier. However, you will need to specify the symbol properties manually with the desired settings. The contract multiplier is driven by the symbol properties database. You can see the symbol properties database here.
Unfortunately, the implementation that creates the mappings and factors is closed source at the moment. The implementation that applies the factors and mappings is part of Lean itself. You can see this with more detail in the linked PR.
As for the margin data, Future margins are in the data folder. They require at least one data point to be able to determine which date it is. You can see the implementation here.
Please note that if you are using custom data, you need to ensure that the contractMultiplier attribute is set up correctly. If it's not set up, the results may not be correct.
I hope this helps! If you have any other questions, feel free to ask.
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.
Ma Ho Tung
Can you show me an example of how to set custom data into Futures and with contract multiplier?
Ma Ho Tung
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!