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

Hi,
I've been playing around with algorithms but I'm sort of at a loss for the best way to use this platform.

For example:

  1. At first I wanted to build a system that could trade based on O'Neil style breakouts from consolidation periods. However I'm struggling with how to find/calculate these in code. There are some formulas that I thought could work but so far I really haven't gotten anywhere with them. I can spot them on a chart and set alerts for myself if I were to trade on my own, but as far as coming up with a way for the algo to do it, I'm just not there.

  2. Then I thought it would be good for day trading. i.e. come up with a strategy and backtest it. However there are a few points that seem to make that not a good idea and/or confuse me to the point where I'm not sure it will work because you only get data after a full 1 minute candle is done, so limited reaction time. Also I am uncertain how long it will take from analyzing data to submitting order, so might have to go with market orders since not sure what price would be by the time the order is submitted to IB.

Can someone share insight into the best way to approach this? Is there something I'm missing? Or am I just not really looking at this the right way?

Appreciate your help.

2 responses

Hey Alex,

Could you elaborate on the O'Neil style breakouts you mentioned? The community here does a pretty good job of helping users out if they need help with algorithms. As for your second point, what kind of algorithm were you thinking of? In terms of data analyze to order speed, it's usually within the current/next minute (e.g. if I tell the algo to check for something at 10:10 am and rebalance, it will fulfill the rebalance orders at 10:11am).

Feel free to push out more questions

I think just getting some elbow grease in and testing out a couple algorithms will be the best place to start, and if not, putting up a strategy and asking us to help you code one will be helpful too :)

-Seong

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Hi,
For the O'Neil style breakouts I mean breakouts from consolidation periods with narrow price ranges. Ideally a tight pattern. Normally I'd consider this to be at least 4-6 weeks though in theory it could be used intraday as well.

There is also a "cup with handle" pattern but again this seems to require more of a chartist's eye than an algorithm - though it could just be my lack of experience talking.

From "How to Make Money In Stocks":

  1. "There should also be at least some tight areas in the price patterns of stocks under accumulation. On a weekly chart, tightness is defined as small price variations from high to low for the week, with several consecutive weeks' prices closing unchanged or remarkably near the previous week's close. If the base pattern has a wide spread between the week's high and low points every week, it's been constantly in the market's eye and frequently will not succeed when it breaks out."

  2. "Nearly all proper bases will show a dramatic drying up of volume for one or two weeks along the very low of the base pattern and in the low area or few last weeks of the handle. This means that all of the selling has been exhausted and there is very little stock coming into the marketplace. Healthy stocks that are under accumulation almost always show this symptom. The combination of tightness in prices (daily or weekly price closes being very near each other) and dried-up volume at key points is generally quite constructive."

I suppose I could use some sort of min/max calculation for this. I was originally looking at the Aroon indicator. Also would be important to keep track of average daily volume and ensure that in most cases the volume was less than average to confirm it dried up. Then would have to determine the highest point and add say 10 cents to that point as the buy point trigger for the breakout. Would also have to look at the minute by minute volume and compare to daily to determine if we were on track to exceed average daily volume by a large amount (ideally at least 20-50% above average).