I've just noticed that price data for symbol EEQ (SID 24073) is way off from the one I expected / shown online in other places. My algo was placing crazy large orders and I could not figure out why.
Q shows close prices for EEQ in 2015 like $0.30 while the actual price should be around $30. Volume is way off too - Q shows 3-4 million per day while I expect ~200k. The minimal example (I am not sure if I can share an algo which prints out quotes here):
def initialize(context):
context.stocks = symbols("EEQ")
schedule_function(rebalance, date_rules.every_day(), time_rules.market_open(hours = 1, minutes = 30))
def handle_data(context, data):
return
def rebalance(context,data):
closes = history(1, '1d', 'close_price') # 'price' has the same problem
volumes = history(1, '1d', 'volume')
for security in data:
if security.symbol != "EEQ": # (I know I don't need this)
continue
yesterday_volume = volumes[security].iloc[-1]
yesterday_close = closes[security].iloc[-1]
By doing binary search and debugging I found that the values come back to normal scale on 2015-11-04 (well, that's the log date, so it means that 2015-11-03 is the first valid data point). I did not go into the past, I only tested my algo since 1/1/2015 when I noticed the problem.
Yahoo finance shows EEQ split on 2015-11-04 = 10215/10000 and another one 2015-02-04 = 1015/1000. Does that mean that Q has some issues adjusting prices on splits?