I’ve been trying to pass a list of specific stocks into the pipeline and I haven’t been able to do it. In Quantopian we could use StaticAssets, but it doesn’t seem to be working on pylivetrader. I think this would be an incredible feature for people that are looking to trade specific stocks for specific sectors.
Something like this is what I’m trying to do:
def initialize(context):
stocks = (StaticAssets(symbols("QQQ", "AAPL", "MSFT")))
sma_50 = SimpleMovingAverage(
inputs=[USEquityPricing.close],
window_length=50,
mask=stocks
)
sma_15 = SimpleMovingAverage(
inputs=[USEquityPricing.close],
window_length=15,
mask=stocks
)
context.pipe = Pipeline({
'SMA_50': sma_50,
'SMA_15': sma_15,
})
before_trading_start()
context.attach_pipeline(context.pipe, "pipe")