Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
get_pricing for minute bars - last bar only close price?

I'm seeing zero volume and no OHL prices for the last minute bar of the day when using:

https://www.quantopian.com/docs/api-reference/research-api-reference#quantopian.research.get_pricing

high = get_pricing(['SPY'],start_date='2020-04-09',end_date='2020-04-10',fields='high',frequency='minute')  
low = get_pricing(['SPY'],start_date='2020-04-09',end_date='2020-04-10',fields='low',frequency='minute')  
close = get_pricing(['SPY'],start_date='2020-04-09',end_date='2020-04-10',fields='close_price',frequency='minute')  
volume = get_pricing(['SPY'],start_date='2020-04-09',end_date='2020-04-10',fields='volume',frequency='minute')  

Is this expected? If minute bars are being returned, shouldn't the last minute bar be OHLCV for the last trading minute?

6 responses

@Grant Thank you for pointing this out. Our engineering team is looking into why there is no data for the last minute at times. I'll post a follow up when we learn more.

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 Dan -

Any update on this? For minute data, there should be OHLCV bars for every minute, right?

@Grant

Again, thanks for pointing this out. There isn't always OHLC data for every minute. If a stock hasn't traded in that minute then these values will be nan. However, 'volume' should always have a value. If a stock hasn't traded in that minute then the volume will be zero.

We've isolated the problem to a data issue. The file Quantopian typically gets from our data provider has the last minute trade data timestamped as 20:00:00.0000+00:00. However, on some days, beginning mid December 2019, the timestamps appear slightly delayed (eg 20:00:00.200000+00:00). Quantopian then thinks this is 'after market' data and discards it. We are actively trying to understand the cause and, of course, the fix for this. We don't want to discard this last minute data, however we also do not want to include 'after hour' trades either.

Our engineering team is working on this and we'll keep the community posted. Thanks again @Grant.

Thanks Dan -

Who is your data vendor for minute bars? Is it still Nanex? And have they published details on how they obtain their data?

The implication is that your data vendor provides both normal trading day and after market data all in one data file (since you have an algorithm that rejects data after 20:00:00.0000+00:00). If you are paying for the after market data, why don't you make it available to Quantopian users?

Also, SPY, for example, undergoes an end-of-day process per this:

https://www.nyse.com/markets/nyse-arca/trading-info#closing

Things appear to be more complicated that just capturing the last trade at 20:00:00.0000+00:00, along with the OHLV for the trailing minute; there's a closing auction process.

Generally, it would be interesting to understand how the Quantopian OHLCV minute bars are obtained (e.g. how does one get from the actual high-frequency market, with various clocks and delays, to aggregated OHLCV minute bars). Is this available anywhere in the Quantopian support documentation? The reason I'm asking is that for https://www.quantopian.com/posts/infographics-challenge-economic-implications-of-covid-19 , I decided to start playing around with minute bar data, but now I'm wondering the extent to which the data represents the actual market.

Hi Dan -

Any progress on this issue? What has your data vendor said about the change you observed, starting in mid December 2019?

Hi Dan -

Just checking back again. I figure it would be something novel at least to continue dinking around with minute data. Status?

Thanks,

Grant