As an example, the following code can be used to know the available futures of E-mini S&P 500. “xx” in the code represents the expiry of the futures.
def initialize(context): request_data(contractDetails=[symbol('FUT,ES,USD,xx')]) def handle_data(context, data): print data.data[symbol('FUT,ES,USD,xx')].contractDetails exit()
Another example is provided to get the option chains of E-mini S&P 500 futures. “xx,xx,xx,xx” in the code represents expiry, strike price, right and multiplier, in this order. If you want to limit the returned option chains with only “Call”, “xx,xx,xx,xx” should be replaced by “xx,xx,C,xx”
def initialize(context): request_data(contractDetails=[symbol('OPT,ES,USD,xx,xx,xx,xx')]) def handle_data(context, data): print data.data[symbol('OPT,ES,USD,xx,xx,xx,xx')].contractDetails exit()
My brother suggested I could possibly like this web site. He was entirely correct. This post genuinely produced my day. You can not envision just how much time I had spent for this information and facts! Thanks!
It’s nearly impossible to find knowledgeable folks on this topic, but the truth is could be seen as do you know what you are dealing with! Thanks