Hi, I am new to Quantopian
From the following link on Pair Trading
https://www.quantopian.com/algorithms/5667083d2a37e94ced000198
Please help me in understanding these codes and its functioning here, If there is any description of these functions on Quantopian,please let me know.
Q1)
set_slippage(slippage.FixedSlippage(spread=0))
set_commission(commission.PerTrade(cost=1))
set_symbol_lookup_date('2014-01-01')
Q2) context.spread = np.ndarray((context.num_pairs, 0))
# context.hedgeRatioTS = np.ndarray((context.num_pairs, 0))
context.inLong = [False] * context.num_pairs
context.inShort = [False] * context.num_pairs
Q3) prices = history(35, '1d', 'price').iloc[-context.lookback::]
new_spreads = np.ndarray((context.num_pairs, 1))
4) new_spreads[i, :] = Y[-1] - hedge * X[-1]
Thanks in advance.