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

Empty DataFrame Columns: [open, high, low, close, volume] Index: [] #44

Closed eaywok closed 1 year ago

eaywok commented 1 year ago

nifty_bank_nse_index = sas.get_instrument_by_symbol('NSE', 'Nifty Bank') df = sas.get_historical_candles(nifty_bank_nse_index.exchange, nifty_bank_nse_index.symbol, datetime(2022, 10, 11, 9, 15, 0), datetime.now(), interval=15, is_index=True)

print(df)

Empty DataFrame Columns: [open, high, low, close, volume] Index: []

neevgujral7 commented 1 year ago

bro got the issue resolved ? Please let me know

algo2t commented 1 year ago

Use the option is_index=True


nifty_bank_nse_index = sas.get_instrument_by_symbol('NSE', 'Nifty Bank')
# print(nifty_bank_nse_index)
print(sas.history(nifty_bank_nse_index, datetime(2022, 2, 2, 9, 15, 0), datetime.now(), interval=30, is_index=True))