buy position but getting negative profits

 

Hi,

 I am new to mql4 coding. I coded an EA to do some back-testing.

  

As shown from the above picture, I had a buy position at a lower price where it loses money at a higher price.

Can anyone give me a brief explanation of the possible cause?

Thanks 

 
"Close at stop" means the tester closed the open order at the end of the test at the SL.
 

I understand that part. The part that I am not clear with is the price I entered buy was 1370.2 and the close at stop is at 1422.4. Since I am in a buy position, should it not trigger a stop with a negative profit?

Or does that column not display the current price.

Thanks again for the reply 

 
valliant88:

I understand that part. The part that I am not clear with is the price I entered buy was 1370.2 and the close at stop is at 1422.4. Since I am in a buy position, should it not trigger a stop with a negative profit?

Or does that column not display the current price.

Thanks again for the reply 

 


Do you also understand that at stop the trade was open for almost 2 years and 2 months

and that a part of the profit is OrderSwap() and OrderCommission() ???

 
Ah, didn't take that into account, thanks
Reason: