NewOrderLinkedList
This library implements a linked list data structure for managing orderbook prices.
Variables
PriceLinkedList
(struct)
PriceLinkedList
(struct)a storage struct type for storing price linked lists
Internal Functions
_setLmp
_setLmp
Sets the last matched price in the PriceLinkedList.
Parameters
_heads
_heads
Returns the heads of the ask and bid price linked lists.
Parameters
Returns
_askHead
_askHead
Returns the head of the ask price linked list.
Parameters
Returns
_bidHead
_bidHead
Returns the head of the bid price linked list.
Parameters
Returns
_mktPrice
_mktPrice
Returns the last matched price.
Parameters
Returns
_next
_next
Returns the next price in the linked list based on the current price and whether it is a bid or ask price.
Parameters
Returns
_insert
_insert
Inserts a new price into the linked list based on whether it is a bid or ask price. The new price is inserted in the correct position, maintaining the order of the linked list.
Parameters
_getPrices
_getPrices
Retrieves an array of prices from the linked list, starting from the head and moving to the next price in the specified direction (bid or ask). The number of prices returned is limited by the n
parameter.
Parameters
Returns
Last updated