Coding help - page 792

 

My account was in Netting, I updated it to Hedging and everything looks good now !


RT_31 #:

Hello,

I'm looking for help and hope I'm at the right place in the forum.


I'm trying to modify a deal (#2 here below, volume 0.12) with PositionModify function of CTrade class :

trade.PositionModify(Ticket, newStopLoss, PositionGetDouble(POSITION_TP))

but I don't know why, the server is modifying all open positions (volume 0.3) and not only the 'ticketed' one.

The "bug" does not seem to be in the Trade.mqh because when I force the m_request.volume to 0.12, it does not help.

It looks like the bug is in the server side or in the configuration of the server...

Any help would be appreciated.

Thanks,


Rose


2025.03.08 20:22:20.696 2022.03.09 06:00:00   market buy 0.12 EURJPY sl: 125.848 tp: 129.248 (126.438 / 126.448 / 126.438)

2025.03.08 20:22:20.696 2022.03.09 06:00:00   deal #2 buy 0.12 EURJPY at 126.448 done (based on order #2)

2025.03.08 20:22:20.697 2022.03.09 06:00:00   deal performed [#2 buy 0.12 EURJPY at 126.448]

2025.03.08 20:22:20.697 2022.03.09 06:00:00   order performed buy 0.12 at 126.448 [#2 buy 0.12 EURJPY at 126.448]

2025.03.08 20:22:20.704 2022.03.09 06:00:00   CTrade::OrderSend: market buy 0.12 EURJPY sl: 125.848 tp: 129.248 [done at 126.448]

2025.03.08 20:22:20.704 2022.03.09 06:00:00   Open MagicNumber : 20250201

2025.03.08 20:22:20.704 2022.03.09 06:00:00   market buy 0.18 EURJPY sl: 125.948 tp: 130.548 (126.438 / 126.448 / 126.438)

2025.03.08 20:22:20.704 2022.03.09 06:00:00   deal #3 buy 0.18 EURJPY at 126.448 done (based on order #3)

2025.03.08 20:22:20.704 2022.03.09 06:00:00   deal performed [#3 buy 0.18 EURJPY at 126.448]

2025.03.08 20:22:20.704 2022.03.09 06:00:00   order performed buy 0.18 at 126.448 [#3 buy 0.18 EURJPY at 126.448]

2025.03.08 20:22:20.707 2022.03.09 06:00:00   CTrade::OrderSend: market buy 0.18 EURJPY sl: 125.948 tp: 130.548 [done at 126.448]

2025.03.08 20:22:20.707 2022.03.09 06:00:00   Open MagicNumber : 20250301

2025.03.08 20:22:20.709 2022.03.09 12:00:00   position modified [#2 buy 0.3 EURJPY 126.448 sl: 125.951 tp: 130.548]

2025.03.08 20:22:20.712 2022.03.09 12:00:00   CTrade::OrderSend: modify EURJPY (sl: 125.951, tp: 130.548) [done]