I think I understand your problem. You want to use the pipeline to filter the stocks, but you also want to see data of stocks which don't pass the filter.
The very purpose of pipeline is stock selection is universe filtering, and conveniently not seeing stocks which don't pass the filter.
So if you wanted to see data from stocks that don't pass the filter, then don't filter the pipeline output
Instead, you can add a column in your pipeline which tracks the value of whether the security passes the filter (true or false), and not actually filter the pipeline output (which is set by screen
).
Then, for stocks in your existing portfolio, you could check the value of the various factors that were computed in your pipeline, since they haven't been filtered out.
There is something similar to this in this tutorial, where he sets a column named longs
and uses the truth value of that column to determine whether to go long on the stock. However, in your case, you wouldn't want to set the pipeline screen (longs | shorts)
, since you might want to see stocks that don't fit either criteria.
You can use pipeline to statically select instruments although it's not recommended. You can do something like
sym = morningstar.share_class_reference.symbol
security_filter = sym.element_of(list of stocks you want)
and screen on security_filter, which will compute pipeline values only for stocks in your list.