Hi
I wish to set up lean to backtest NSE options strategy.
https://github.com/QuantConnect/Lean/tree/master/Data/option-The documentation says that we currently support US options. I hope that it is only because quantconnect has data for US options.
-How do I set the currency as INR?
-How do I set timezone (+5:30)
-How does setfilter works? Will it look for the existence of different csv in zip?
-Is there any reference data and How to set it?
Shile Wen
Hi Amol,
We can use the self.SetAccountCurrency('INR') to set our account currency to INR.
See here on how to set the timezoneSetFilter filters the options to meet some criteria, such as the strike price relative to the underlying, expiration date, etc. Please see here for more information on options and SetFilter. First you will need to know if Indian options behave like US options. Then you will need the data for the underlying as this is what is used to calculate the strike price distance as well as the Greeks, as well as the options data as specified in the link you provided.
Please elaborate on what you mean by reference data.
Best,
Shile Wen
Amol gupta
Shile Wen,
Thank you for the response.
I have a followup question on timezone. In what timezone should be my CSV candle data timestamp be?
Indian options are European style i.e. no early exercise is possible. I hope that it is supported.
Reference data implied list of instruments that are tradeable maybe as CSV or in some other format. In case of options, it will have a strike, underlying, right, expiry etc. If reference data is not maintained then the backtesting engine will have to go through several folders and check for the existence of certain CSV files.
I am trying to understand how setfilter/options work. At an abstract level, it will take a list of options contract available for trading, do some filtering or pruning and pass on the list of tradeable security objects. My question is how does it determine the list of objects available for trading?
Alexandre Catarino
Hi amol gupta ,
It is hard to guide Lean users through the implementation of a complex feature such as support for Indian options in the Community Forum. You will have to make your own research on how options are implemented in Lean in order to make more specific questions.
Balamurali Pandranki has been working on the basic implementation for the Indian market support:
Indian stock markets & Zerodha brokerage implementation #4873
and you might want to take a look before moving forward.
Perhaps you should start by creating the files and add a data subscription in Lean. For example:
AddOption("UPL", Resolution.Minute, Marker.NSE);
to understand the options feature mechanics (e.g: how the options universe is created). The currency and the timezone are not really important at this point.
Amol gupta
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!