How can I get historical data of the last 100 open market(working days) days.

I am trying to get historical data for the last 100 working days If you have any suggestions or solutions please comment.

# Python code
if time_frame_type=="minute":
time_frame_duration = 10
period = 200
pastDays= ((int(time_frame_duration,0)*int(period,0))/375) + 1
#calculate saturday and sunday
if pastDays <= 7:
pastDays = pastDays + ((pastDays/7) * 3)
from_date=current_date - timedelta(days=pastDays)
from_date_string=from_date.strftime("%Y-%m-%d %H:%M:%S")

  • premjit
    Include the list of holidays as given by exchange as well
Sign In or Register to comment.