False Indicator based entries

 

Hello folks,

as I have seen through the trade mt have made in the tester I found something I did not really understand:

   if(Close[1] > ma)


If this is the case a buy order should open and if Close[1] < Moving Average the Order should be closed.

But this happened: 

the Bar before Entry:
Close 87.530
High 87.550

MA 87.589 -------> order Opened and got closed a little later 

 

 
TheOneWhoKnocks: But this happened:
You buy at the Ask and closed at the Bid. Turn on the Ask line and you'll see the spread.
 
thanks! I thought the spread might be a factor here.