I want to get the current price of a stock, and I want to make sure it is higher than yesterday's close before buying it. Can anyone verify that I am using the appropriate syntax?
current_price = data.current(security, "price")
last_close_price = data.history(security, "close", 2, "1d")[0]
if current_price > last_close_price:
order_target_percent...