Back to Community
High Low Daily data wrong ?!

I understand that the close price of the stocks is not the official close of the market and it is fine but I see errors even in the high low of the day !
Example:
IBM on 2016-01-07(verified with print and debug)
High=134.1800
Low=133.4600
Close=134.1800
So the close should be (one of )the highest point of the day which is completely wrong as you can see in any intraday chart.
(IBM was going down that day) How is it possible ??????
Data from Yahoo is consistent with the intraday chart: High=135.0200 Low=132.4300 Close=132.8600

To retrieve the data I simply wrote:
closes = data.history(context.security_list, 'close', 2, '1d')
highs = data.history(context.security_list, 'high', 2, '1d')
lows = data.history(context.security_list, 'low', 2, '1d')
then got the right symbol...

4 responses

no comments ? is it possible that years after launch Q has such errors ?!

Using http://www.nasdaq.com/symbol/ibm/historical, I get daily OHLC values of:

01/07/2016 133.7 135.02 132.43 132.86

And from the attached backtest, I obtain:

01/07/2016 133.7 135.02 132.43 132.769

So, aside from the close, the values are dead on.

Clone Algorithm
3
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 57404280f2885c0f89250274
There was a runtime error.

Thank you Grant you're very helpful.
Upon further investigations the problem lies in the fact that I am retrieving the data in a function scheduled at the first minute of the day.
It's not a shift of the data by one day it's really a wrong value !
It's odd it doesn't return an error instead of wrong data...
Sorry I had to include the code. Thank you again...

See the help on the '1d' data returned by history. You were probably getting exactly what is specified in the help.