Skip to content

Commit

Permalink
Add a comment on the order sequence and update the version.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaz001 committed Oct 25, 2023
1 parent 92f1d64 commit bf8f966
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hftbacktest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
'correct'
)

__version__ = '1.6.5'
__version__ = '1.6.6'


# JIT'ed latency models
Expand Down
3 changes: 3 additions & 0 deletions hftbacktest/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bf8f966

Please sign in to comment.