Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaz001 committed Apr 30, 2023
1 parent a2d533a commit 8cee2ff
Show file tree
Hide file tree
Showing 13 changed files with 2,963 additions and 115 deletions.
10 changes: 3 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ Get a glimpse of what backtesting with hftbacktest looks like with these code sn
last_order_id = -1
order_id = 0
while hbt.run:
# Checks every 0.1s
if not hbt.elapse(0.1 * 1e6):
return False
# Checks every 0.1s
while hbt.elapse(100_000):
# Clears cancelled, filled or expired orders.
hbt.clear_inactive_orders()
Expand All @@ -92,7 +89,7 @@ Get a glimpse of what backtesting with hftbacktest looks like with these code sn
# Clears cancelled, filled or expired orders.
hbt.clear_inactive_orders()
last_order_id = -1
last_order_id = -1
if hbt.position < max_position:
# Submits a new post-only limit bid order.
order_id += 1
Expand Down Expand Up @@ -122,7 +119,6 @@ Get a glimpse of what backtesting with hftbacktest looks like with these code sn
# Records the current state for stat calculation.
stat.record(hbt)
return True
Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
author = 'nkaz001'

# The full version, including alpha/beta/rc tags
release = '1.5.3'
release = '1.5.4'


# -- General configuration ---------------------------------------------------
Expand Down
29 changes: 14 additions & 15 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,12 @@ Get a glimpse of what backtesting with hftbacktest looks like with these code sn
last_order_id = -1
order_id = 0
while hbt.run:
# Check every 0.1s
if not hbt.elapse(0.1 * 1e6):
return False
# Clear cancelled, filled or expired orders.
# Checks every 0.1s
while hbt.elapse(100_000):
# Clears cancelled, filled or expired orders.
hbt.clear_inactive_orders()
# Obtain the current mid-price and compute the reservation price.
# Obtains the current mid-price and computes the reservation price.
mid_price = (hbt.best_bid + hbt.best_ask) / 2.0
reservation_price = mid_price - skew * hbt.position * hbt.tick_size
Expand All @@ -86,16 +83,16 @@ Get a glimpse of what backtesting with hftbacktest looks like with these code sn
last_order_id = order.order_id
# All order requests are considered to be requested at the same time.
# Wait until one of the order cancellation responses is received.
# Waits until one of the order cancellation responses is received.
if last_order_id >= 0:
hbt.wait_order_response(last_order_id)
# Clear cancelled, filled or expired orders.
# Clears cancelled, filled or expired orders.
hbt.clear_inactive_orders()
last_order_id = -1
last_order_id = -1
if hbt.position < max_position:
# Submit a new post-only limit bid order.
# Submits a new post-only limit bid order.
order_id += 1
hbt.submit_buy_order(
order_id,
Expand All @@ -106,7 +103,7 @@ Get a glimpse of what backtesting with hftbacktest looks like with these code sn
last_order_id = order_id
if hbt.position > -max_position:
# Submit a new post-only limit ask order.
# Submits a new post-only limit ask order.
order_id += 1
hbt.submit_sell_order(
order_id,
Expand All @@ -117,13 +114,12 @@ Get a glimpse of what backtesting with hftbacktest looks like with these code sn
last_order_id = order_id
# All order requests are considered to be requested at the same time.
# Wait until one of the order responses is received.
# Waits until one of the order responses is received.
if last_order_id >= 0:
hbt.wait_order_response(last_order_id)
# Record the current state for stat calculation.
# Records the current state for stat calculation.
stat.record(hbt)
return True
Examples
Expand Down Expand Up @@ -164,7 +160,10 @@ You can find more examples in `examples <https://github.com/nkaz001/hftbacktest/
tutorials/Getting Started
tutorials/Working with Market Depth and Trades
tutorials/Integrating Custom Data
tutorials/High-Frequency Grid Trading
tutorials/Impact of Order Latency
tutorials/GLFT Market Making Model and Grid Trading
tutorials/Making Multiple Markets
tutorials/examples

.. toctree::
Expand Down
67 changes: 32 additions & 35 deletions docs/tutorials/GLFT Market Making Model and Grid Trading.ipynb

Large diffs are not rendered by default.

475 changes: 475 additions & 0 deletions docs/tutorials/High-Frequency Grid Trading.ipynb

Large diffs are not rendered by default.

476 changes: 476 additions & 0 deletions docs/tutorials/Impact of Order Latency.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 8cee2ff

Please sign in to comment.