algo2t / alphatrade

Python APIs for SAS Online Alpha Trade Web platform for creating algo trading using python
https://algo2t.github.io/alphatrade
MIT License
44 stars 23 forks source link

Historical data of indices #20

Closed akshay1728 closed 2 years ago

akshay1728 commented 2 years ago

Hi @algo2t

I am trying below code to get historical data for bank nifty but its returning empty data frame. Tried Nifty, India Vix but the same result. However same code is working for stocks and returning data. Also tried with is_index=True but no luck. Could you please help.

print(sas.get_historical_candles('NSE','Nifty Bank', datetime.datetime(2021, 1, 1, 9, 15, 0), datetime.datetime.now(), interval=1))

Result - Instrument(exchange='NSE', token=26009, symbol='Nifty Bank', name='Nifty Bank', expiry=None, lot_size=None)
Empty DataFrame
Columns: [open, high, low, close, volume]
Index: []
dccgarch commented 2 years ago

check closed issues.. solution is there

algo2t commented 2 years ago

You cannot get data for Indices you will have to use alternate ways.