TradeViaPython / Kite_Zerodha

156 stars 108 forks source link

issue while fetching historic data #10

Open tarunmcom opened 1 year ago

tarunmcom commented 1 year ago

all the fuctions working for me except fetching historic data. The error:-

2sahil3 commented 1 year ago

That's probably because you have given one or more arguments wrongly. For example in my case, the wrong parameter was the instrument token. so i changed it to some other token (it was of tata steel), you can have token values by printing the instruments this line: # print(kite.instruments()) Also whenever you face this error try to understand the arguments since if we give wrong arguments, the GET request will return a NoneType Object(correct me if i am wrong) and that means that u didnt got your desired output. Thankyou.

tarunw07 commented 1 year ago

I also think you're probably using the wrong token. My guess would be that you are using an exchange token instead. The instrument token here is different from the exchange token(which is used generally by other API providers).

To fetch the instrument_token for the corresponding exchange_token, you can fetch all the instruments using kite.instruments("NFO") API and its response have both instrument_token and exchange_token.

jenish99 commented 1 year ago

Give values of "instrument_token, from_datetime, to_datetime, interval, continuous=False, oi=False" used in program here.