Not able to fetch NSE Derivative( ACC.NS,SBI.NS ) Tick history data using python api.

# Note: startdate and end date will be the current date.
# Require NSE derivative('ACC.NS','SBI.NS') contract with tick data for current date.


# MyCode:------
dScripts=['ACC.NS']
sfields=['Timestamp','Value',"Volume"]
df =ek.get_timeseries(dScripts,sfields,start_date = "2020-09-25T09:00:00", end_date = "20
20-09-25T17:00:00",interval="tick")




Best Answer

  • @ashish.shah That is because all requests/returns are in GMT timezone. Please see this thread on how to programmatically convert to different timezones in python. I hope this can help.

    dScripts=['ACC.NS'] 
    df =ek.get_timeseries(dScripts,start_date = "2020-09-30T03:30:00", end_date = "2020-09-30T11:30:00",interval="tick")
    df

    image


Answers

  • @ashish.shah for tick data there are only 2 fields supplied Value and Volume. If you remove the fields parameter entirely you will default to all fields or alternatively remove the 'Timestamp' field.

    dScripts=['ACC.NS']
    df =ek.get_timeseries(dScripts,start_date = "2020-09-25T09:00:00", end_date = "2020-09-25T17:00:00",interval="tick")

    image

  • ok, thanks but it's not giving the whole day tick data.

    if you noticed, it will give you from 09:00 Am to 11:12 AM, where I have given parameters from 09:00 to 17:00.

    Can you please help to get the current date tick data of "ACC.NS" (09:00 AM to 17:00)