Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
New to Python: pipeline question

Hi everyone, I'm very new to python and trying to learn from here, know some basic C language and matlab.

So i dont understand why we need these?
pipe = Pipeline()
attach_pipeline(pipe, name='my_pipeline')

since as my understanding, the pipe should be variable? so I don't see any necessary to rename it as my_pipeline?

or maybe I understand incorrectly, pipe here is actually standing for instance of class?

1 response

You need 'my_pipeline' because you will be calling something like results = pipeline_output('my_pipeline') inside before_trading_start. So 'my_pipeline' is just an unique identifier for that particular Pipeline. Currently only one pipeline is supported, but Q designed the API thinking at possible future extensions.