Problem to reverse position

 

Hi Guys,

I have an EA that on certain conditions, it should reverse the current position. This level, of course, is the same SL for the position.

 

I am doing the following.

Modifying position to set new SL (working ok according to the backtest journal)

Placing new Buy/Sell Stop with price at the same level than position SL (also working according to journal)

When price reachs that level, sometimes it works to reverse position but most of then, MT5 seems to understand that my buy Stop Order simply closes the position and doesn't trigger the Position SL.

 

Have anyone ever seen this problem?

 

I wouldn't like to simply delete the position SL and place a double order since if the SL level is not triggered and prices continues to the original trade direction, this reversal order this order is deleted. 

 

Rgds

 

Flavio 

 

Here is the Journal log

QG 0 09:08:45.959 Trade 2015.09.09 10:30:00   sell stop 10.00K VALE5 at 15.87 sl: 15.94 tp: 15.27 (15.90 / 15.91 / 15.90)

CF 0 09:08:45.959 FFFD (VALE5,M5) 2015.09.09 10:30:00   CTrade::OrderSend: sell stop 10000.00 VALE5 at 15.87 sl: 15.94 tp: 15.27 [done]

FG 0 09:08:48.554 Trade 2015.09.09 10:31:32   order [#2 sell stop 10.00K VALE5 at 15.87] triggered

GG 0 09:08:48.554 Trades 2015.09.09 10:31:32   deal #2 sell 10.00K VALE5 at 15.87 done (based on order #2)

FJ 0 09:08:48.554 Trade 2015.09.09 10:31:32   deal performed [#2 sell 10.00K VALE5 at 15.87]

FO 0 09:08:48.554 Trade 2015.09.09 10:31:32   order performed sell 10.00K at 15.87 [#2 sell stop 10.00K VALE5 at 15.87]

OM 0 09:10:24.528 Trade 2015.09.09 12:05:00   position modified [sell 10.00K VALE5 15.87 sl: 15.53 tp: 15.27]

JS 0 09:10:24.528 FFFD (VALE5,M5) 2015.09.09 12:05:00   CTrade::OrderSend: modify VALE5 (sl: 15.53, tp: 15.27) [done]

EL 0 09:10:24.528 Trade 2015.09.09 12:05:00   buy stop 10.00K VALE5 at 15.53 sl: 15.45 tp: 16.13 (15.49 / 15.50 / 15.49)

LO 0 09:10:24.528 FFFD (VALE5,M5) 2015.09.09 12:05:00   CTrade::OrderSend: buy stop 10000.00 VALE5 at 15.53 sl: 15.45 tp: 16.13 [done]

CN 0 09:10:33.656 Trade 2015.09.09 12:12:20   order [#3 buy stop 10.00K VALE5 at 15.53] triggered

DF 0 09:10:33.656 Trades 2015.09.09 12:12:20   deal #3 buy 10.00K VALE5 at 15.53 done (based on order #3)

OF 0 09:10:33.656 Trade 2015.09.09 12:12:20   deal performed [#3 buy 10.00K VALE5 at 15.53]

QR 0 09:10:33.656 Trade 2015.09.09 12:12:20   order performed buy 10.00K at 15.53 [#3 buy stop 10.00K VALE5 at 15.53]

DM 3 09:11:09.908 Tester stopped by user