Does selling shares increase avg $ per share?

Hello,

Was underwater for a little bit on this stock but sold some shares once I was in green but was going to buy back more because I figured it would go back down again. My logic through this was that if I sell some at a gain, then buy more once I go under again, it would help decrease my avg cost per share. But I saw as soon as I sold, My avg cost per share increased, even way more than my sell price. Could someone explain this to me?

?2021-04-05T17:18:51Z

No, selling cannot increase the actual avg cost per share but the figure displayed may increase after a sale if your entire position was constructed by buying in incrementally at different prices.