Hi,
I am very new to programming. This is my 1st time of doing. So, looking assistance from others to solve the discrepancies.
Checking the functionality of my code and realised that prices extracted from my code are not coherent with prices from Yahoo Finance. Pls input.
Below is my code:
def initialize(context):
set_universe(universe.DollarVolumeUniverse(floor_percentile=99.9,ceiling_percentile=100.0))
context.notional_limit=100000
def handle_data(context, data):
for stock in data:
log.info(str(stock)) # this will print out all the securities in the universe
context.cl_price_history = history (bar_count=2, frequency='1d',field='close_price')
print(context.cl_price_history)
Prices from Q:
Security(39840 [TSLA])
2014-03-31 20:00:00+00:00 208.4201
2014-04-01 13:31:00+00:00 210.3400
Prices from Yahoo Finance
Date Open High Low Close Volume Adj Close*
Apr 1, 2014 209.02 218.16 208.58 216.97 7,371,400 216.97
Mar 31, 2014 216.50 216.75 206.39 208.45 8,380,000 208.45
Thank you.