There is bid price and ask price. When you buy, you buy at the higher (ask) price when you close that position, you sell it at the lower (bid) price.
The default line you see on platform is the average of these 2 lines. Which is why it actually have to go slightly lower than this line for your Take Profit to trigger. While your stop loss got triggered before that line even touches