Notebook
In [14]:
import pandas as pd
import numpy as np
from quantopian.pipeline import Pipeline
from quantopian.pipeline import CustomFactor
from quantopian.research import run_pipeline
from quantopian.pipeline.data.builtin import USEquityPricing

def initialize(context):

#load data for yield curve recession indicator
    fetch_csv('https://www.quandl.com/api/v3/datasets/USTREASURY/YIELD.csv?start_date=2002-01-01',date_column='Date', usecols=['3MO','10YR'], symbol=('CURVE'))


class YieldC(CustomFactor):
    inputs = [data.current(CURVE.10YR)]
    window_length = 1
    def compute(self, today, assets, out, yc):
        out[:] = yc

def pipeline_fundamental(context):
    
    pipe = Pipeline()
     
    yc = YieldC()
    pipe.add(Yield, 'YieldC')
return pipe


def before_trading_start(context, data):
    """
    Called every day before market open.
    """
    context.pipeline_fundamental_output = pipeline_output('pipeline_fundamental') 
  File "<ipython-input-14-3859bcfda02b>", line 15
    inputs = [data.current(CURVE.10YR)]
                                  ^
SyntaxError: invalid syntax
In [ ]:
run_pipeline(pipe, start_date='2015-11-01', end_date='2015-11-25')