INNER CODE UNIT · Python
hist_order_depth
pe049395/IMC-Prosperity-2024 · submissions/round5.py:221
def hist_order_depth(self, type: str, depth: int, size) -> np.ndarray:
"""Return historical order depth.
Args:
type (str): 'bidprc' or 'bidamt' or 'askprc' or 'askamt'
depth (int): depth, 1 or 2 or 3
size (int): size of data
Returns:
np.ndarray: historical order depth for given type and depth
"""
return np.array(self._hist_order_depths[self.product][f'{type}{depth}'][-size:], dtype=np.float32)
@property
def timestep(self) -> int:
return self._state.timestamp / 100