Beispiel #1
0
def make_strategy_pipeline(context):
    pipe = Pipeline()
    assets = [asset for asset in context.universe]
    screener = filter_universe(assets)
    pipe.add(technical_factor(context.lookback, volatility, 1), 'vol')
    pipe.set_screen(screener)

    return pipe
Beispiel #2
0
def make_strategy_pipeline(context):
    pipe = Pipeline()

    # Set the volume filter, 126 days is roughly 6 month daily data
    volume_filter = average_volume_filter(126, 1E7)
    
    # compute past returns
    rsi_factor = technical_factor(126, rsi, 14)
    ema20_factor = technical_factor(126, ema, 20)
    ema50_factor = technical_factor(126, ema, 50)
    
    # add to pipelines
    pipe.add(rsi_factor,'rsi')
    pipe.add(ema20_factor,'ema20')
    pipe.add(ema50_factor,'ema50')
    pipe.set_screen(volume_filter)

    return pipe
def make_strategy_pipeline(context):
    pipe = Pipeline()

    # get the strategy parameters
    lookback = context.params['lookback'] * 21
    v = context.params['min_volume']

    # Set the volume filter
    volume_filter = average_volume_filter(lookback, v)

    # compute past returns
    vol_factor = technical_factor(lookback, volatility, 1)
    skew_factor = technical_factor(lookback, skewness, None)
    pipe.add(vol_factor, 'vol')
    pipe.add(skew_factor, 'skew')
    pipe.set_screen(volume_filter)

    return pipe
def make_strategy_pipeline(context):
    pipe = Pipeline()
    func = lambda asset: asset.instrument_type != InstrumentType.FUNDS
    asset_filter = filter_assets(func)
    volume_filter = average_volume_filter(context.lookback, context.min_volume)
    screener = asset_filter & volume_filter
    screener = volume_filter

    pipe.add(period_returns(context.lookback, context.offset), 'momentum')
    pipe.add(technical_factor(context.lookback, volatility, 1), 'vol')
    pipe.set_screen(screener)

    return pipe
def make_strategy_pipeline(context):
    pipe = Pipeline()

    # get the strategy parameters
    lookback = context.params['lookback'] * 21
    v = context.params['min_volume']

    # Set the volume filter
    volume_filter = average_volume_filter(lookback, v)

    # compute past returns
    rsi_factor = technical_factor(lookback, rsi, 14)
    pipe.add(rsi_factor, 'rsi')
    pipe.set_screen(volume_filter)

    return pipe