Purchase date of a open position

Is there a way to get the date of purchase of a position, i want to check the date before i sell the position to avoid day trade

Currently the position entity does not have purchase date.

There doesn’t appear to be a built in method for finding the purchase date. One way would be to get your order list and check the fill date for your position.

Another method to avoid buying and selling on the same day could be to check if the position has an unrealized_intraday_pl and unrealized_pl that are not equal.

Thanks for the suggestion, but I think i can make use of daytrade_count in account entity

May be not

I finally did what u said

def todays_buy_fill_date(symbol):
orders=api.list_orders(status=‘closed’, limit=500, after=midnight, until=None, direction=‘desc’)
for order in orders:
if order.symbol==symbol:
return order.filled_at.astimezone(local_timezone)