开云体育

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Futures data for indian market


 

I am currently trying to fetch futures data for indian market, from what i see there is no extra commission for this data.?

"No security definition has been found for the request"

this is the error i get when i try to fetch historical data for furtures.


configuration of the contract formed is : -?
contract.secType("IND");
contract.exchange("NSE");
contract.primaryExch("NSE");
contract.currency("USD");
contract.localSymbol("NIFTY");


 

开云体育

Go to the Exchange listing for NSE on IB’s website. Select ‘Indices’ as the product type. Then you will see that there are several contracts that begin with ‘NIFTY’, but they all have some kind of suffix, such as ‘NIFTYIT’ or ’NIFTYOIL’. In other words, ‘NIFTY’ is not a valid symbol (which is exactly what the error message is telling you).

?

?

?

From: [email protected] <[email protected]> On Behalf Of ram.bharadwaj.arya@...
Sent: 20 February 2023 09:01
To: [email protected]
Subject: [TWS API] Futures data for indian market

?

I am currently trying to fetch futures data for indian market, from what i see there is no extra commission for this data.?

"No security definition has been found for the request"


this is the error i get when i try to fetch historical data for furtures.


configuration of the contract formed is : -?

contract.secType("IND");
contract.exchange("NSE");
contract.primaryExch("NSE")
;
contract.currency(
"USD");
contract.localSymbol("NIFTY");


 

On Mon, Feb 20, 2023 at 02:49 PM, Richard L King wrote:
Exchange listing for NSE on IB’s website
tried with "NIFTYIT" symbol still the same issue.


 

You can use NIFTY50 and currency as INR
Security descriptions are available in TWS. Right click on the security -> "Financial Instrument Info" -> Description


 

tried NIFTY50 with INR, still the same issue.


 

开云体育

NIFTY50 and NIFTYIT with currency INR work fine for me.

?

Please show your contract attributes again.

?

?

From: [email protected] <[email protected]> On Behalf Of ram.bharadwaj.arya@...
Sent: 20 February 2023 09:53
To: [email protected]
Subject: Re: [TWS API] Futures data for indian market

?

tried NIFTY50 with INR, still the same issue.


 

开云体育

By the way, if you use my ContractInspector tool, freely available from the link below (Windows only), you can easily experiment with different contract parameters to see what they give you. This can save you lots of frustration:

?

?

?

?

From: [email protected] <[email protected]> On Behalf Of Richard L King
Sent: 20 February 2023 10:00
To: [email protected]
Subject: Re: [TWS API] Futures data for indian market

?

NIFTY50 and NIFTYIT with currency INR work fine for me.

?

Please show your contract attributes again.

?

?

From: [email protected] <[email protected]> On Behalf Of ram.bharadwaj.arya@...
Sent: 20 February 2023 09:53
To: [email protected]
Subject: Re: [TWS API] Futures data for indian market

?

tried NIFTY50 with INR, still the same issue.


 

Thanks Richard. I have also spent lot of time to find right contract info. This tool would have saved lot of time.

@Ram,
Use this tool to find right details.
Looking at the code, i believe you should use contract.symbol instead of localSymbol. Try that


 

"Historical Market Data Service error message:No market data permissions for NSE FUT"


contract.primaryExch("NSE");
contract.exchange("NSE");
contract.secType("FUT");
contract.currency("INR");
contract.symbol("NIFTY50");
contract.includeExpired(true);
contract.lastTradeDateOrContractMonth("20230329");


 

You need to subscribe for NSE derivative market data from IBKR portal


 

okay,?
i am getting "No security definition has been found for the request" for us based futures as well, do you have a working example of a contract for us based futures??


 

Its all same once you understand how to form a contract structure. Only changes would be the symbol, currency and exchange. If you have any confusion, better to use the tool Richard suggested. Trust me, it will save lot of your time.

I dont trade US market. So no working example from my end. However, the sample code has host of examples. You can look into ContractSamples.py?

Closest that I found in ContractSamples.py -
?
? ? ? ? contract = Contract()
? ? ? ? contract.symbol = "ES";
? ? ? ? contract.secType = "FUT";
? ? ? ? contract.exchange = "QBALGO";
? ? ? ? contract.currency = "USD";
? ? ? ? contract.lastTradeDateOrContractMonth = "202003";

Remember, you should have subscription of US derivatives market data for that particular exchange