Hi all,

I am re-implementing my code @ Quantopian on QC platform.  Below is a simple code snippet, where I am calculating future spread and ratio for NGH19/NGJ19.  Could anyone direct me on how to implement this using QC APIs? while I am comfortable with Quantopian libs/APIs, I am still trying to understand how to work with futures on QC.  

front_contract = "NGH19" back_contract = "NGJ19" contracts = symbols([front_contract, back_contract]) prices = get_pricing(contracts, start_date='2018-01-01', end_date='2019-02-07', fields='price') prices.columns = map(lambda x: x.symbol, prices.columns) prices = prices.dropna() spread = prices[front_contract] - prices[back_contract] ratio = prices[front_contract] / prices[back_contract]

Thanks in advance!    

Author