Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Question on ATR Example - Timing and execution of orders at market open

I'm completely new to all of this and I'm going to dabble in a ATR strategy to play around with this. I'm looking at the standard ATR example in the pipeline docs.

From what I can tell, this examines ATR data at 1 minute intervals and attempts to generate breakout signals (up or down).

In looking at this standard script, it seems that a potential trap that one could fall into is related to overnight volatility. It would seem that if the futures tanked, overnight, the call at 9:30:001 AM would trigger a sell. But by that millisecond in trading time, I would think that the opportunity was missed.

So:
Question 1
Am I overthinking this or is this a valid concern?

Question 2:
They way my brain works is that I would accept that I will always miss a call at market open . . . and I'd track the ATR until I see it making a come-back. . .. .at which point I'd buy at the low point (hopefully). How would I store the historical ATR and then read the prior 5 instances to generate a positive or negative trend. Is that possible?

1 response

Michael, before diving into the weeds I'd ask some higher-level questions. How often do you want to check for a new signal? Minutely? And how often should the algo trade? If you want to make several round-trip trades per day, you'll quickly rack up transaction costs. Even if you have a good strategy in mind, commissions can kill your profits. Take a look at this webinar to learn how to research and test your strategy on Quantopian: https://www.youtube.com/watch?v=mNkvHEbVt0s

As you develop your strategy, you should convince yourself of the economic rationale. Why does this algo work? And when will it stop working? You should try to think about the long-term horizon rather than fighting for millisecond wins.

As you code your algo, think about the robustness. What will happen if your algo can't trade at exactly the market open? For example, if you're not logged into the IB account. It's better to allow a time window for fills and leave some wiggle room. Hopefully that helps as you're crafting the idea.

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.