Hey all, two quick questions from a beginner:
- How do I call a security from pipeline? My pipeline has a few filters/screens on it, but when I try to handle_data on the output, it says I need to use sid to reference a security.
def before_trading_start(context, data):
context.output = pipeline_output('my_pipeline').sort('sma_2')
log.info(context.output.head(5))
def handle_data(context, data):
for stock in context.output:
order_target_percent(stock, 0)
- Where can I find documentation on using if/then commands? For example: IF sma_2 > sma_5, THEN order_target_percent(stock, #)?
Thanks in advance!