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

Hi,

I'm fetching a CSV and have a column that indicate whether to buy or not.
any clue on how i can use this indicator, of for that matter, any data that is inside the CSV?

thanks,
Z

1 response

As this forum seems slow (or maybe the purpose of it isn't Q&A, I don't know) I'll attempt to answer although being new to it myself:

There is a good example for what you're trying to do in the help section. Search for "Using Fetcher to create a custom universe". If you fetch the csv as it is done there, you will get a "universe" (i.e. a list of stocks) from the CSV. All those stocks and the information for them will be available to you in the handle_data part of the script through "data".

Example: Lets say you got a column in your csv called "indicator" then you could do:

            for stock in data:  
                if data[stock]['indicator'] == 1:  
                    print "buy!"  

Remember that one of your columns has to be "symbol" and contain a list of tickers. That's how they're added to data (as part of your universe).