# Setting a list of stocks as screen in pipeline

**URL:** <https://forum.alpaca.markets/t/setting-a-list-of-stocks-as-screen-in-pipeline/1377>\
**Category:** Alpaca Integration Applications\
**Created:** [May 5, 2020, 6:41pm UTC](https://forum.alpaca.markets/t/setting-a-list-of-stocks-as-screen-in-pipeline/1377 "2020-05-05T18:41:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fachastorm](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@fachastorm](https://forum.alpaca.markets/u/fachastorm)\
**Post date:** [May 5, 2020, 6:41pm UTC](https://forum.alpaca.markets/t/setting-a-list-of-stocks-as-screen-in-pipeline/1377/1 "2020-05-05T18:41:06Z")

</div>

Hey guys, brand new here! I’ve had an algorithm running on Quantopian for quite some time and I’ve been working on bringing it over with pylivetrader, along with pipeline\_live and zipline. I believe I am almost done, but I am trying to set a custom screen on my pipeline and while it works in Quantopian, I cannot seem to get it to work in my environment.

`stocks = StaticAssets(symbols('SPY', 'F', 'TSLA, 'MSFT')`

Basically I would like to set these as a custom screen and only trade those stocks. I believe there is an issue with the zipline filter StaticAssets, but I am not sure. Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![hitoshi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/hitoshi/32/69_2.png) [@hitoshi](https://forum.alpaca.markets/u/hitoshi)\
**Post date:** [May 19, 2020, 7:27pm UTC](https://forum.alpaca.markets/t/setting-a-list-of-stocks-as-screen-in-pipeline/1377/2 "2020-05-19T19:27:44Z")

</div>

What kind of issue exactly are you referring to?

---

<div class="post-metadata">

**Author:** ![fachastorm](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@fachastorm](https://forum.alpaca.markets/u/fachastorm)\
**Post date:** [May 25, 2020, 8:30pm UTC](https://forum.alpaca.markets/t/setting-a-list-of-stocks-as-screen-in-pipeline/1377/3 "2020-05-25T20:30:08Z")

</div>

Well, it seems that my factors aren’t working on my StaticAssets list.

I am importing the following:

```
from zipline.pipeline import Pipeline
from pylivetrader.api import attach_pipeline,pipeline_output
from pylivetrader.api import ( order_percent, get_datetime, get_open_orders, cancel_order, schedule_function, order_target_percent, date_rules, time_rules, symbol, symbols)
from pipeline_live.data.alpaca.factors import (AverageDollarVolume, SimpleMovingAverage, RSI, ExponentialWeightedMovingAverage)
from pipeline_live.data.alpaca.pricing import USEquityPricing
from zipline.pipeline.filters import StaticAssets
from zipline.utils.tradingcalendar import trading_days
from zipline.utils.tradingcalendar import get_early_closes
import datetime
import numpy as np
import pandas as pd
import logbook
import talib
logbook.set_datetime_format(lambda: pd.Timestamp.now(tz='America/New_York'))

```

And this is my initialize where I am calling my make\_pipeline() method:

```
def initialize(context):

context.spy = symbol('SPY')
attach_pipeline(make_pipeline(), "pipeline")

```

And this is my make\_pipeline() method:

```
def make_pipeline():

stocks = (StaticAssets(symbols('SPY', 'F', 'TSLA, 'MSFT')))

sma_50 = SimpleMovingAverage(
inputs=[USEquityPricing.close],
window_length=50, 
mask=stocks 
)
sma_15 = SimpleMovingAverage(
inputs=[USEquityPricing.close],
window_length=15, 
mask=stocks
)
uptrend = sma_15 > sma_50
downtrend = sma_50 > sma_15

rsi = RSI(inputs=[USEquityPricing.close],
window_length=14, 
mask=stocks
)

pipe = Pipeline(
columns={ 
'close_price': close_price, 
'rsi': rsi, 
'SMA_50': sma_50, 
'SMA_15': sma_15, 
'Downtrend': downtrend, 
'Uptrend': uptrend
}, 
screen = (stocks)
)
return pipe

```

Basically what’s happening is that my algo is running but for some reason the sma15, sma50 and rsi are coming back as NaN and it’s not applying the screen of the stocks to the pipe. Instead, it’s returning all US Equities, but the factors are returning as NaN. I’m a little stuck as this code was working perfectly fine on Quantopian and I can’t see where the issue might be. Any help would be great hitoshi. Thank you so much for your response and I appreciate your time.

---

<div class="post-metadata">

**Author:** ![fachastorm](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@fachastorm](https://forum.alpaca.markets/u/fachastorm)\
**Post date:** [June 11, 2020, 6:17pm UTC](https://forum.alpaca.markets/t/setting-a-list-of-stocks-as-screen-in-pipeline/1377/4 "2020-06-11T18:17:16Z")

</div>

Any help would be appreciate as I seem to still be stuck with this issue and can’t seem to resolve what’s going on. Thank you so much.
