From bf8f966e4f7f9e2db6bc53c5e313b448c6a26a74 Mon Sep 17 00:00:00 2001 From: nkaz001 Date: Wed, 25 Oct 2023 10:06:02 -0400 Subject: [PATCH] Add a comment on the order sequence and update the version. --- hftbacktest/__init__.py | 2 +- hftbacktest/order.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hftbacktest/__init__.py b/hftbacktest/__init__.py index 775dbfe..8f9e1ff 100644 --- a/hftbacktest/__init__.py +++ b/hftbacktest/__init__.py @@ -128,7 +128,7 @@ 'correct' ) -__version__ = '1.6.5' +__version__ = '1.6.6' # JIT'ed latency models diff --git a/hftbacktest/order.py b/hftbacktest/order.py index 8a04347..9330d5c 100644 --- a/hftbacktest/order.py +++ b/hftbacktest/order.py @@ -132,6 +132,9 @@ def append(self, order, timestamp): timestamp = int(timestamp) # Prevents the order sequence from being out of order. + # In crypto exchanges that use REST APIs, it might be still possible for order requests sent later to reach the + # matching engine before order requests sent earlier. But, for the purpose of simplifying the backtesting + # process, all requests and responses are assumed to be in order. if len(self.order_list) > 0: _, latest_timestamp = self.order_list[-1] if timestamp < latest_timestamp: