I tried the data.current method with 'last_traded' field, but always got an error:
TypeError: unsupported operand type(s) for *=: 'Timestamp' and 'float'
Total code of my test algorithm as below:
def initialize(context):
context.sid1 = symbol('AAPL')
def before_trading_start(context, data):
last = data.current(context.sid1, ['price', 'volume', 'open', 'close', 'high'])
print('last: ', last)
last_traded1 = data.current(context.sid1, 'last_traded')
And this post is created by Dan Dunn's advice. From the old one:
https://www.quantopian.com/posts/getting-an-error-i-wasnt-expecting#59df8a675fa7b4424c4afd98
Thanks for your support.