Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
What's wrong with my bar data values?

Hi guys,

I trade stocks intra day using 15 minutes bars and fibo extensions. In trying to build an algo for this, I noticed some weirdness in my data.
For example here are my log files:

Here are log values for July 24 on AAPL
2015-07-24handle_data:27INFOtime 09:31:00 open 125.33 high 125.43 low 125.01
2015-07-24handle_data:27INFOtime 09:32:00 open 125.02 high 125.32 low 124.6
2015-07-24handle_data:27INFOtime 09:33:00 open 124.86 high 124.86 low 124.6
2015-07-24handle_data:27INFOtime 09:34:00 open 124.73 high 124.91 low 124.67
2015-07-24handle_data:27INFOtime 09:35:00 open 124.77 high 124.94 low 124.68

When I look at other data bases (stockcharts/ tradingview) I get the first two bars as:

                              open       high          low       close  

aapl 9:30. 125.32 125.43 125.01 125.02 stockcharts
aapl 9:31. 125.02 125.09 124.60 124.85 stockcharts
aapl 9:32 124.85 124.86 124.61 124.62 stockcharts

aapl 9:30 125.33 125.40 125.02 125.04 tradingview
aapl 9:31 125.01 125.07 124.62 124.83 tradingview
aapl 9:32 124.85 124.85 124.62 124.73 tradingview

So what this tells me is that there's is no such thing as a given price at a give time, it's in the eye of the beholder. Check out how tradingview has the close
10 cents above stockcharts. Which is right?

But my real question is . Can I even get the price at 9:30 as opposed to 9:31?
Also, how does Q compute their minute data. I have one algo that uses increasingly tight stops as the wave runs out of steam, and when I try to use the
minute bar high or low plus 10 basis points as my close I get some really funky readings.

Thanks
Serge

3 responses

Check out how tradingview has the close 10 cents above stockcharts. Which is right?

They could well be both right depending on their definition of a close price, how a bar is calculated and what data they use. May sound paranoid, but don't trust anybody when it comes to data.

Alexis.

You're right. Being paranoid is the only safe solution. Meanwhile, I saw that it is not possible to get the first minute's data currently.Fortunately, for my strategy, that is not as critical. But getting accurate ranges thereafter is. Let me plunge into my log files and look for more clues...

Hi Serge,

You have a few questions in here, let me try to unpackage them.

So what this tells me is that there's is no such thing as a given price at a give time, it's in the eye of the beholder.

Take a look at the data section of our FAQ: Quantopian uses the last traded price as the close price for the security. Depending on the data source, others may use end-of-day (EOD) prices. For example, Yahoo is an EOD datasource. Yahoo and other EOD data providers get their price and volume data from the official exchange record. Quantopian's data is generated by the actual trades, regardless of what exchange the trade was made on. The EOD sources rarely exactly match data derived from intraday data. For instance, the official close for a NYSE stock is the last trade of the day for the stock on NYSE. But if the stock also trades on Chicago, Pacific or another regional exchange, the last trade on one of those exchanges could be our close.

Can I even get the price at 9:30 as opposed to 9:31?

The first price available is at 9:31AM, so the order is submitted in this bar and the order is filled at 9:32AM (subject to the slippage model).

how does Q compute their minute data

Quantopian is only reporting on trades that happens during market hours - no pre-market or after-hours crossing session data. The data is aggregated across all exchanges and packaged into bars.

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.