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

Hello-I haven't the faintest idea how to write code, but I have been investing for awhile. I have been using bollinger bands and moving averages fairly successfully to identify stocks to purchase call options, but I've never back-tested the idea. Is there anyone out there who has any interest in helping? I don't day trade, but my holding period is typically a few days to a month.

5 responses

Hello Pat,

There was a recent post on Bollinger Bands (https://www.quantopian.com/posts/bollinger-bands). Fawce provided some example code, and I added some code for computing z-scores of multiple securities.

What are you looking to do, specifically? Screening criteria? How many securities would you need to screen? Using daily or minutely data?

Grant

Hi Grant-For the bollinger band component, I use 20 day moving average with two standard deviations. Securities also need to be above the 50/100 EMA, and the scan is based on a crossover from below the bollinger band to back inside the band. I would be using daily data. My screen now scans 5200 securities, so I know I would have to narrow the securities. I don't really know what is "manageable" for securities, but I could use ETF's as a baramater first. I will check out the post you have above. Is that specific enough? Thanks for posting!

Hello Pat,

Presumably "EMA" stands for exponentially moving average? What does the "50/100" stand for?

Also, you say that "the scan is based on a crossover from below the bollinger band to back inside the band." Over what time frame? At any point within the 20 days?

For screening, it sounds like you should consider the set_universe option (see the help page). My recollection is that you should be able to capture up to ~ 600 securities with that tool. Otherwise, you can specify up to 100 individual ones.

Seems doable, but the details matter. Quantopian has some built-in transforms that potentially could be used (mavg & stddev), but I'm not yet clear if they'll work in this case.

Grant

EMA does equal exponentially moving average, and the 50/100 refer to the 50 day EMA, 100 day EMA. The time frame used is daily. Thanks again Grant.

Pat,

How is the EMA computed? Specifically, if one used http://docs.scipy.org/doc/numpy/reference/generated/numpy.average.html, how would the weights be computed for the 50-day and the 100-day EMAs?

Alternatively, have a look at http://pandas.pydata.org/pandas-docs/dev/computation.html, "Exponentially weighted moment functions." Would this work?

By the way, how are you doing the screening now? Did you develop a spreadsheet, or are you using an application-specific software package? If the latter, what is it?

Grant