Questions: what is an error 129?!

 

I've been programming using MT4 now for about a year - watching tic-by-tic and I've finally got a winner. My first attempt out wasn't so successful -- but, it worked; ie., when I bought it bought and when I took profit it took profit - Now, after downloading the latest revision of MT4, my trades work in the strategy tester -- but, when I put my final product on line with a real account -- positions were opened but I continued to get numerous errors when attemping to close the trade. This has never happened on a live account before now -- and, my profit taking code hasn't changed one bit. Here's the snippet:

//+------------------------------------------------------------------+
//| CloseOrder - closes orders by ticket no. |
//+------------------------------------------------------------------+
int CloseOrder(int Ticket, double Price)
{
bool success;

OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES);
success=OrderClose(Ticket,OrderLots(),Price,10,Red);

if (!success)
Print("Error closing order (", OpCode(OrderType()),": ",OrderTicket(),"; Error(", GetLastError(),")");
}

So, what's causing the error 129 and why won't it close any of my orders? Good thing, when I went live - the market kept heading my way for a very, very long run ;-) but, I can't deploy this software if it'll never take profit/close orders. Please help!

00:01:28 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:28 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:30 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:41 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:42 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:44 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:45 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:50 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:50 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:55 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:58 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:02:04 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:02:04 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:02:05 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:02:09 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:02:11 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)

 
DennisJorgenson wrote >>

I've been programming using MT4 now for about a year - watching tic-by-tic and I've finally got a winner. My first attempt out wasn't so successful -- but, it worked; ie., when I bought it bought and when I took profit it took profit - Now, after downloading the latest revision of MT4, my trades work in the strategy tester -- but, when I put my final product on line with a real account -- positions were opened but I continued to get numerous errors when attemping to close the trade. This has never happened on a live account before now -- and, my profit taking code hasn't changed one bit. Here's the snippet:

//+------------------------------------------------------------------+
//| CloseOrder - closes orders by ticket no. |
//+------------------------------------------------------------------+
int CloseOrder(int Ticket, double Price)
{
bool success;

OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES);
success=OrderClose(Ticket,OrderLots(),Price,10,Red);

if (!success)
Print("Error closing order (", OpCode(OrderType()),": ",OrderTicket(),"; Error(", GetLastError(),")");
}

So, what's causing the error 129 and why won't it close any of my orders? Good thing, when I went live - the market kept heading my way for a very, very long run ;-) but, I can't deploy this software if it'll never take profit/close orders. Please help!

00:01:28 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:28 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:30 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:41 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:42 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:44 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:45 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:50 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:50 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:55 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:01:58 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:02:04 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:02:04 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:02:05 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:02:09 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)
00:02:11 IQI-v2 USDJPYm,H1: Error closing order (Sell: 33674776; Error(129)

for your reference: https://docs.mql4.com/constants/errors

 
brother3th wrote >>

for your reference: https://docs.mql4.com/constants/errors

Thanks - but, not the issue. A 129 shows an 'Invalid Price' -- but, this is not the case -- I use Bid for buy exits and Ask for short exits -- with a 10p slippage. Although I didn't print the price in the error message ... this procedure has worked from day one. Oh, and it only started occurring with build 223 (recently)...

 
DennisJorgenson wrote >>

Thanks - but, not the issue. A 129 shows an 'Invalid Price' -- but, this is not the case -- I use Bid for buy exits and Ask for short exits -- with a 10p slippage. Although I didn't print the price in the error message ... this procedure has worked from day one.

What can I say? I think there is something you should wondering and considering about your broker. This may only happened with some broker like yours. You know what I mean.

 

Hello Dennis Jorgenson,


Try to use "OrderClosePrice ()" function instead of "Price" variable.


Best regards,
Airat Safin