mtapi icon indicating copy to clipboard operation
mtapi copied to clipboard

OrderModify failed with PendingOrders.

Open Perens28 opened this issue 7 years ago • 6 comments

Hi,

I have issues with OrderModify when I want modify Pending orders.

For example I want change SellStop on GOLD.

apiclient.OrderModify(order.Ticket, 1300, 0, 0, DateTime.MaxValue);

And I get error 130. What I do wrong?

Thanks

Perens28 avatar Apr 08 '18 12:04 Perens28

Hello Perens, look at this page and understud what is error 130. https://book.mql4.com/trading/ordermodify image

I think your new price is to close or against the order direction. Use RefreshRates bevore modify.

Change the price and see what happens

KptKuck avatar Apr 08 '18 17:04 KptKuck

In time when I try it, was GOLD about 1330. I try it manually as you can see in first topic and its return error. I solved it by delete order and make new one. But its not comfortable... Thanks for advice

Perens28 avatar Apr 11 '18 18:04 Perens28

Did you modify the correct order ?

KptKuck avatar Apr 12 '18 07:04 KptKuck

Enable debug mode in mtapi5.mql5 and send the log output .

KptKuck avatar Apr 12 '18 07:04 KptKuck

Yes I modify correct order. This working for you? Mofidy pending orders? If I try modify SL or TP for BUY/SELL its ok. But pending orders not...

Perens28 avatar Apr 26 '18 04:04 Perens28

Iam not the devoloper of this API but i can help you to solve this problem.

Sorry i see that you use mtapi not mtapi5.

Enable debug mode in mtapi.mq4 like this //#define DEBUG_LOG old #define DEBUG_LOG new compile and run see output and post ist after OrderModify Error

greets

KptKuck avatar Apr 26 '18 07:04 KptKuck