aboutsummaryrefslogtreecommitdiffstats
path: root/python/api_quotes
diff options
context:
space:
mode:
Diffstat (limited to 'python/api_quotes')
-rw-r--r--python/api_quotes/__main__.py10
-rw-r--r--python/api_quotes/api.py2
2 files changed, 6 insertions, 6 deletions
diff --git a/python/api_quotes/__main__.py b/python/api_quotes/__main__.py
index d75f7ca9..e50bfdf6 100644
--- a/python/api_quotes/__main__.py
+++ b/python/api_quotes/__main__.py
@@ -20,7 +20,7 @@ def process_asset_class(asset_class, start_from, end):
try:
if data := MarkitAPI.get_data(asset_class, start_from):
for (quoteid, receiveddatetime), quotes in data:
- if end and (receiveddatetime < end):
+ if end and (receiveddatetime > end):
return
quotes = list(quotes)
# Don't try to insert into DB if already uploaded
@@ -74,15 +74,15 @@ if __name__ == "__main__":
args = parser.parse_args()
with concurrent.futures.ThreadPoolExecutor() as executor:
start = (
- int((args.start_from + datetime.timedelta(days=1)).strftime("%s")) * 1000
+ int((args.start_from - datetime.timedelta(days=1)).strftime("%s")) * 1000
)
- end = int((args.start_from - bus_day * 1).strftime("%s")) * 1000
+ end = int((args.start_from + bus_day * 1).strftime("%s")) * 1000
futures = [
executor.submit(
process_asset_class,
asset_class,
- start,
- end if not args.backfill else None,
+ start if not args.backfill else None,
+ end,
)
for asset_class in ["ABS", "CD", "TRS"]
]
diff --git a/python/api_quotes/api.py b/python/api_quotes/api.py
index 3850b0fe..9d5b76f8 100644
--- a/python/api_quotes/api.py
+++ b/python/api_quotes/api.py
@@ -34,7 +34,7 @@ class MarkitAPI:
"apikey": cls.api_key,
"limit": 1000,
"sortBy": "receivedDateTime",
- "descending": "true",
+ "descending": "false",
"dateformat": "MILLISECONDSSINCEEPOCH",
}
if after: