Buy stop and sell stop do not take action at the right time

Hi guys, I am very new to trading so this probably is a stupid question but…

I am trading a demo account with XM.com. So far I have set up 2 trades but they did not execute at the right price.

My first trade was set up like this:


As you can see the price reached TP level but the trade kept going till it hit SL and I lost 10 pips.

2nd trade went like this:


This time the trade was executed before the price reached my buy stop level and ended up losing around 10 pips.

Both trades were set up in the evening and checked later in the morning so I was not looking at them when they happened.

Did i make some kind of a mistake or this tend to happen? If so - why?

Is there a way to go around it?

Do different brokers have different rules about it?

I think this could become very frustrating if the system follows very specif SL and TP.

More info:

Both pictures are in 15M TF.

When I traded the default MT4 demo server this did not happened.

Thank you

Have you taken the spread into account?

Like eddie said, did you consider the spread before you made the trade?
Perhaps your stop is also a bit too tight in comparison with the length of the bars. In this situation you can either widen your stop, or keep it as it is, but then you need high frequency trades, (not just 2 per day) in order to make that 1 or few profitable trade(s) (TP in this case has to be trailing in line with the duration of the trend - whenever the trend shifts)

Eddie and Oceanmen are both right, needless to say: this is about the spread.

The TP and SL levels you’re choosing are “[U]mid[/U]-prices” between the bid and the ask.

With your TP, depending on the size of the spread, the mid-price (as represented by the candles/bar-formations) will have to go a pip or two [I]beyond[/I] it, to trigger it; with your SL, the price can trigger it even without apparently quite reaching that level on the live chart.

It’s easy to underestimate the significance of this. If you’re trading something with a 4-pip spread, for example, each of those two discrepancies can be as wide as two pips.