Skip to content

Commit 169ff62

Browse files
committed
Intraday historical data fix
1 parent 3e62688 commit 169ff62

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

eodhd/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99

1010
# Version of eodhd package
11-
__version__ = "1.0.29"
11+
__version__ = "1.0.30"

eodhd/apiclient.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ def get_historical_data(
330330
except ValueError:
331331
self.console.log("invalid end date (yyyy-mm-ddThh-mm-ss OR yyyy-mm-dd OR nnnnnnnnnn):", iso8601_end)
332332
sys.exit()
333-
333+
334+
LIMIT_FOR_1M = 120 # Limit for 1m interval
334335
if iso8601_start == "" or ((iso8601_start != "" and not re_iso8601.match(iso8601_start)) and (iso8601_start != "" and not re_date_only.match(iso8601_start))):
335336
if interval == "d":
336337
date_from = str(int((datetime.fromtimestamp(int(date_to)) - timedelta(days=(results - 1))).timestamp()))
@@ -339,7 +340,7 @@ def get_historical_data(
339340
elif interval == "m":
340341
date_from = str(int((datetime.fromtimestamp(int(date_to)) - timedelta(months=(results - 1))).timestamp()))
341342
else:
342-
date_from = str(int((datetime.fromtimestamp(int(date_to)) - timedelta(days=(results - 1))).timestamp()))
343+
date_from = str(int((datetime.fromtimestamp(int(date_to)) - timedelta(days=(LIMIT_FOR_1M))).timestamp()))
343344
else:
344345
try:
345346
if re_date_only.match(iso8601_start):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# This call to setup() does all the work
1717
setup(
1818
name="eodhd",
19-
version="1.0.29",
19+
version="1.0.30",
2020
description="Official EODHD API Python Library",
2121
long_description=long_description,
2222
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)