Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How do I undeprecate this datetime code?

data[stock].datetime < get_datetime()

I cannot seem to plug in data.current(stock, 'volume').datetime

I need to check and see if a stock traded at the get_datetime()

1 response

To check if a stock traded at the current simulation time maybe consider using the data.is_stale(assets) method https://www.quantopian.com/help#api-data-is_stale

if not data.is_stale(assets):  
    # Stock or stocks traded during last minute  
    do_something()

Maybe something like above will work for you?