Hi, Couple of days ago, I opted for the historical api and I am able to get historical api for various instruments. My issue is with the interval. In the documentation it is mentioned that we can use various intervals such as 1min,3min,5min,15min and so on ( basically, what we see in the drop down menu at the kite web and kite mobile).
I am able to get historical data for the 2 min interval but when I try to get one minute candle data, it throws "Invalid interval " error. I am not asking for more than two days of data.
What should I do to get historical data for instruments for one minute candle ?
Images for the code and error messages are attached. As you can see from the image, it is working for 2 min candle but not for the 1 min candle.
I am able to get historical data for the 2 min interval but when I try to get one minute candle data, it throws "Invalid interval " error.
Can see 2minute requested candle interval in given code snap-shot, not 1minute, as stated above. Are you sending 1minute as requested param for the interval? If yes, then it should be minute not 1minute. You can check all allowed candle interval here.
@rakeshr Yes, I was using 1minute as the parameter . I have now tried with the minute parameter and it works now.
Thank you for the help.
Also, could you help me with one more thing. the strategy I have created is able to successfully place order as per the calculation I have mentioned but on placing stop loss, it gives "Invalid trigger price" error.
I wish I could use cover order but I am not getting how to get order id of the second leg. if I convert kite.orders() in the dataframe then I am able to get order_id and parent_order_id but how do I search through them is something I am not understanding. I have tried with
df1['order_id'] = np.where(df1['order id'] == 458035(whatever the order id is), parent order id)
but this doesn't work. And, if I am correct then first leg of the order is the parent order id and the second leg of the cover order is child order.
Are you sending 1minute as requested param for the interval?
If yes, then it should be
minute
not 1minute. You can check all allowed candle interval here.Thank you for the help.
Also, could you help me with one more thing. the strategy I have created is able to successfully place order as per the calculation I have mentioned but on placing stop loss, it gives "Invalid trigger price" error.
I am using following code for placing stop loss
stop_number=kite.place_order(tradingsymbol=instrument, price=vwa_price, variety=kite.VARIETY_REGULAR, exchange=kite.EXCHANGE_NFO, transaction_type=kite.TRANSACTION_TYPE_SELL, quantity=Quantity,order_type=kite.ORDER_TYPE_SLM, product=kite.PRODUCT_MIS)
I wish I could use cover order but I am not getting how to get order id of the second leg.
if I convert kite.orders() in the dataframe then I am able to get order_id and parent_order_id but how do I search through them is something I am not understanding. I have tried with
df1['order_id'] = np.where(df1['order id'] == 458035(whatever the order id is), parent order id)
but this doesn't work.
And, if I am correct then first leg of the order is the parent order id and the second leg of the cover order is child order.