Hi, I tried to see how 'History' function works and found that QC's 'History' function does not include current data. It's OK with it. However, I found something else. Please see my code as below:
# My security list
self.security_list = ["AAPL", "AMZN", "UPS"]
# History (2 min.)
history_min = self.History(self.security_list, 2, Resolution.Minute)
curr_price_history = history_min['close'].unstack(level=0)
# Current Prices of the security list
aapl_price = self.Securities["AAPL"].Price
amzn_price = self.Securities["AMZN"].Price
ups_price = self.Securities["UPS"].Price
# Logs
self.Log('\n' + str(curr_price_history) + '\n')
self.Log('AAPL Price : ' + str(aapl_price))
self.Log('AMZN Price : ' + str(amzn_price))
self.Log('UPS Price : ' + str(ups_price))
At 10:30am, the 'History' function (for the past 2 minutes) showed:
2017-07-03 10:30:00
symbol AAPL AMZN UPS
time
2017-07-03 10:28:00 143.655999 968.07 110.150708
2017-07-03 10:29:00 143.576312 967.88 110.190413
At 10:30am, current 'Price' of each stock showed:
2017-07-03 10:30:00 AAPL Price : 143.57631170200
2017-07-03 10:30:00 AMZN Price : 967.88000000000
2017-07-03 10:30:00 UPS Price : 110.19041317000
As you can see in the logs above, the current prices of each security are same as the ones of 1 min. ago. What is happening here? Can anyone explain about this? I want current prices! Thanks :)