Hello, I am getting wrong open interest for bank nifty put options for Feb monthly series. I am getting 1,00,28,000 open interest for 28900 PE. For this reason, I am getting wrong PCR. I checked other websites and I am sure that there is a bug and I would like to bring it to Kite team's attention to look at it because there is a bug like this in all other bank nifty weekly and monthly series. I am pasting the following response that I am getting. also, check the date in timestamp
Hi @sujith agreed........but the trading symbol was for 28900 pe for bank nifty expiring Feb 08 2018. So my question is that why am I getting some random cached value for the open interest of a token that is not expired. Please note that it was not expired on Feb 8 when I was fetching the quote. And this is happening on all weekly and monthly series of Banknifty Put option instruments.
Here's another example of the weekly series put options expiring 15 Feb 18. Instrument token is 12456706 and trading symbol is BANKNIFTY15FEB1828700PE and strike is 28700. Here, getting oi 481000 and timestamp 2017-12-28. But in reality there is no open interest for this strike
In the feb monthly series there are two strikes with wrong open interest values. Instrument token is 12469762 & 11437314 and trading symbol is BANKNIFTY18FEB28900PE & BANKNIFTY18FEB28400PE with strikes 28900 & 28400. Here, oi is 1,00,28,000 & 90,000 and timestamp 2017-12-28. On NSE website and other websites there is no open interest for these strikes.
In conclusion, my point is that in every weekly or monthly series there seems to be some bug where some strike of banknifty option is giving wrong oi values or cached values of that same strike from a previous series, particularly if that strike doesnt have any transaction or trade data in succeeding time series. And this in turn gives wrong open interest data or put to call ratio specifically. I am sure, a lot of people here probably use PCR in some way or the other.
The way it works is, getQuote receives data from Kite Ticker. Kite Ticker always caches the last received tick in order to serve data immediately when someone requests for it. We use it on all our platforms. We never clear cache in the Kite Ticker unless there is some maintenance going on.
This won't be an issue if you are looking at a liquid instrument because you will likely receive the same day's tick or previous day's tick. If you are looking at illiquid instruments then you need to add a check to go through tick's time stamp.
This instrument is illiquid now. You can see that tick timestamp is 2017-12-28 15:30:06 which means it is cached value from 28/12/2017
agreed........but the trading symbol was for 28900 pe for bank nifty expiring Feb 08 2018. So my question is that why am I getting some random cached value for the open interest of a token that is not expired. Please note that it was not expired on Feb 8 when I was fetching the quote. And this is happening on all weekly and monthly series of Banknifty Put option instruments.
Here's another example of the weekly series put options expiring 15 Feb 18. Instrument token is 12456706 and trading symbol is BANKNIFTY15FEB1828700PE and strike is 28700. Here, getting oi 481000 and timestamp 2017-12-28. But in reality there is no open interest for this strike
{u'NFO:BANKNIFTY15FEB1828700PE': {u'oi': 481000, u'timestamp': datetime.datetime(2017, 12, 28, 15, 29, 57), u'average_price': 906.97, u'last_price': 901.55, u'oi_day_low': 481000, u'ohlc': {u'high': 920.15, u'close': 915.4, u'open': 901.15, u'low': 900.2}........
In the feb monthly series there are two strikes with wrong open interest values. Instrument token is 12469762 & 11437314 and trading symbol is BANKNIFTY18FEB28900PE & BANKNIFTY18FEB28400PE with strikes 28900 & 28400. Here, oi is 1,00,28,000 & 90,000 and timestamp 2017-12-28. On NSE website and other websites there is no open interest for these strikes.
{u'NFO:BANKNIFTY18FEB28900PE': {u'oi': 10028000, u'timestamp': datetime.datetime(2017, 12, 28, 15, 30, 6), u'average_price': 201.04, u'last_price': 199.15, u'oi_day_low': 10028000, u'ohlc': {u'high': 202.2, u'close': 201.85, u'open': 202.05, u'low': 199}.......
{u'NFO:BANKNIFTY18FEB28400PE': {u'oi': 90000, u'timestamp': datetime.datetime(2017, 12, 28, 15, 7, 19), u'average_price': 0.05, u'last_price': 0.05, u'oi_day_low': 90000, u'ohlc': {u'high': 0.05, u'close': 0.1, u'open': 0.05, u'low': 0.05}}...........
In conclusion, my point is that in every weekly or monthly series there seems to be some bug where some strike of banknifty option is giving wrong oi values or cached values of that same strike from a previous series, particularly if that strike doesnt have any transaction or trade data in succeeding time series. And this in turn gives wrong open interest data or put to call ratio specifically. I am sure, a lot of people here probably use PCR in some way or the other.
This won't be an issue if you are looking at a liquid instrument because you will likely receive the same day's tick or previous day's tick.
If you are looking at illiquid instruments then you need to add a check to go through tick's time stamp.