Average Fill Price different than price purchased

In the morning on 12/29 I traded shares of MARA and closed all positions before noon both long and short. In the afternoon I purchased 50 shares at 23.41 average price. However, the average fill price on the positions tab doesn’t reflect the 23.41 price I purchased the shares for. It uses the average price of all shares I bought over the entire day.

I’m confused as to what the cost value is of the 50 shares I purchased for 23.41. I’m showing a negative profit even though the shares I hold were purchase at a price lower than the current market value…

Anyone experience this?

@Adam_Kurylowicz Check out the docs here for an explanation of how Alpaca calculates cost basis. Basically, for intraday trades, the cost basis is the weighted average of all the opening trades. The cost basis is not simply the last paid price. This is a bit better refection on how one has done overall during the day and not simply a snapshot of the most recent purchase.