Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Having pipeline run at market close?

Has this option been discussed?

When doing research and you want to look at forward returns of factors, naturally it makes more sense to use close to close data. Plus, it isnt possible to get open data in the pipeline yet which causes for a lot of calls to get pricing for open data slowing down computation.

I am sure this causes a whole other problem of "Well what data is available at 3pm" instead of the already solved "what data is available before trading"

5 responses

Hi Miles,
Open price should be available to you in the next day or two. That fix is in the final stages of testing.

As for thinking about running pipeline at different times of the day, we have considered this. At some point we have to allow users to schedule a function with longer computation capacity at any point during the day. This isn't something we are working on today, but it is on our radar.

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 Miles,

I don't understand your question. If before_trading_start runs overnight (any time between the close and the open), then it should be equivalent to running at the market close. Or are you talking about running pipeline before the close, so that you can get orders filled before the close?

@ Karen - How would you allow computation times longer than 1 minute during the trading day? Would you allow background (parallel) jobs, still allowing minutely calls to handle_data and scheduled functions? Or something else? I realize you aren't working on it, but perhaps the architecture has been discussed?

Grant

Grant

The main thing is returns calculation.

Your pipe runs and you get a basket of stocks to buy from data 2 days ago... Let's say Tues 1/5. So now you want to compute what was the return for that day on 1/5. If you use close price (open price is broke), the return will be from close 1/4-1/5, but really you don't get the return from close 1/4 to open 1/5. So we must manually download open data(inefficient). With this info, you see what factors were predictive yesterday to use in your model for today 1/6.

The main thing is to just line up returns based on when we are making our buy/sell lists.

I understand that if I make it at 3pm I won't get that price till the next morning anyway but it's s good practice to follow

Once open prices are available it shouldnt be a problem

Karen,

Any luck with the open price fix yet?

Hi Miles,
Open price has been fixed for pipeline, so you can now use USEquityPricing.open.

Remember that pipeline runs before the current trading day begins, so the open price it gives you will be yesterdays open.

KR