From the following link, if someone can make me understand the relevance and syntax of the following lines in this code
https://www.quantopian.com/algorithms/5667083d2a37e94ced000198 . If there is any reference ,please show me the link.
new_spreads = np.ndarray((context.num_pairs, 1))
new_spreads[i, :] = Y[-1] - hedge * X[-1]
if context.spread.shape[1] > context.z_window:
# Keep only the z-score lookback period
spreads = context.spread[i, -context.z_window:]
What are Y[-1] ,X[-1]? and z.window ?
Thanks in advance.