Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Getting started

Can some one please help with my syntax error on line five. I just wanted to declare my variables to context.portfolio. Also I hand selected my stocks will I have to individually write if and elif statements to run scheduled market orders for a simple moving avg?

2 responses

Hi Kenneth

You only need to use the context.portfolio method for global variables in the algorithm.

For the ipython notebook you should use:

portfolio =

If you require it to be global then declare the variable outside of of the function first

Thanks Daniel I'll give it a whirl!