Jump to content

"Unknown ticket for OrderModify"


Recommended Posts

I have an EA here http://www.4shared.com/file/I2hrq0BW/EA_online.html

It produces sometimes the failure "Unknown ticket for OrderModify" when trading live and blows the logfile in a few seconds to a huge size of 2GB.

 

This does not happen using the same live account for backtesting.

Maybe someone can help and correct it, that this "Unknown ticket for OrderModify" will no longer show up.

Edited by newbee
Link to comment
Share on other sites

I have an EA here http://www.4shared.com/file/I2hrq0BW/EA_online.html

It produces sometimes the failure "Unknown ticket for OrderModify" when trading live and blows the logfile in a few seconds to a huge size of 2GB.

 

This does not happen using the same live account for backtesting.

Maybe someone can help and correct it, that this "Unknown ticket for OrderModify" will no longer show up.

 

I tried. No error message but no trades also. What timeframe and currency?

 

OK, I did a bit of backtesting longer on M1 EURUSD. For me it gave the error 130 which means that stop orders wanted to be put too close to market price. will check later this week. It didnt even trade.

Edited by konorti
Link to comment
Share on other sites

I tried. No error message but no trades also. What timeframe and currency?

 

OK, I did a bit of backtesting longer on M1 EURUSD. For me it gave the error 130 which means that stop orders wanted to be put too close to market price. will check later this week. It didnt even trade.

 

For error 130 you have to check your brokers Stops level and then enter the value at StopLevel like "StopLevel = 2.0" (which means Stops level is 20)

Sometimes you have to set it 0.1 higher when it still shows error 130, but only on backtest.

Edited by newbee
Link to comment
Share on other sites

Ok thanks I will check it. StopLevel can be taken easily from broker, then just you should have the possibility to change extra level for safety.

For error 130 you have to check your brokers Stops level and then enter the value at StopLevel like "StopLevel = 2.0" (which means Stops level is 20)

Sometimes you have to set it 0.1 higher when it still shows error 130, but only on backtest.

Link to comment
Share on other sites

Should be OK now:

http://j.mp/ScalperEA

 

Problem does still exist.

EA opened one pending order today.

After this order has turned into a trade and was closed, the EA tried to modify the pending order again, which did not exist any longer.

And it was amazing that in a few seconds it produced another huge logfile of 21 GB.

Edited by newbee
Link to comment
Share on other sites

For me the problem existed while backtesting as well. After checking the code it turned out that it tries to modify the sell and buy orders without setting the Openprice. I fiexed that. I changed the code and for me didnt show that ordermodify error when I backtested again (tester/log folder is the place for logs when backtesting).

There is one orderdelete I will check this weekend what does it do, and what might cause the problem. For first sight it seems that an order which is sell or buy should't reach the Orderdelete as the loop is broken earlier with switching by ordertype. I didnt run it live, so if you still have that part of the log file when started to log the ordedelete error with the preceding part of putting the stop order and when the order went live that would help me a lot.

Link to comment
Share on other sites

Hi konorti,

 

that is what I could copy from the experts/log/

 

13:32:46 Scalper 5M EURUSDf,M5: unknown ticket 1781540 for OrderModify function

13:32:46 Scalper 5M EURUSDf,M5: unknown ticket 1781540 for OrderModify function

13:32:46 Scalper 5M EURUSDf,M5: unknown ticket 1781540 for OrderModify function

13:32:46 Scalper 5M EURUSDf,M5: unknown ticket 1781540 for OrderModify function

13:32:46 Scalper 5M EURUSDf,M5: unknown ticket 1781540 for OrderModify function

13:32:46 Scalper 5M EURUSDf,M5: unknown ticket 1781540 for OrderModify function

13:32:46 Scalper 5M EURUSDf,M5: unknown ticket 1781540 for OrderModify function

13:32:46 Scalper 5M EURUSDf,M5: unknown ticket 1781540 for OrderModify function

 

And this all continues until you are able to deactivate the EA or you close MT4.

 

hope you can fix this ;-)

have a nice weekend!

Edited by newbee
Link to comment
Share on other sites

Forget about my last post because this was from the experts/logfile a while ago, which is already deleted and I do not have the journal anymore.

 

But here is something I have found in the journal logfile from 11th April. The experts logfile can not be opened because of the size of 21 GB.

 

The trade #2118511 was closed at 11:35:31

So everthing after this time caused the problem to build this huge logfile.

 

============================================================================================

11:35:22 '3125': modify order #2118511 buy 0.07 EURUSDf at 1.30942 sl: 1.30903 tp: 1.30986 -> sl: 1.30917 tp: 1.31002

11:35:22 '3125': request was accepted by server

11:35:22 '3125': request in process

11:35:23 '3125': order #2118511 buy 0.07 EURUSDf at 1.30942 was modified -> sl: 1.30917 tp: 1.31002

11:35:31 '3125': modify order #2118511 buy 0.07 EURUSDf at 1.30942 sl: 1.30917 tp: 1.31002 -> sl: 1.30951 tp: 1.31031

11:35:32 '3125': modification of order #2181511 buy 0.07 EURUSDf at 1.30942 sl: 1.30917 tp: 1.31002 -> sl: 1.30951 tp: 1.31031 failed [invalid parameters]

11:35:32 '3125': modify order #2118511 buy 0.07 EURUSDf at 1.30942 sl: 1.30917 tp: 1.31002 -> sl: 1.30951 tp: 1.31031

11:35:32 '3125': modification of order #2181511 buy 0.07 EURUSDf at 1.30942 sl: 1.30917 tp: 1.31002 -> sl: 1.30951 tp: 1.31031 failed [invalid parameters]

11:35:32 '3125': modify order #0 buy 0.00 at 0 sl: 0 tp: 0 -> sl: 1 tp: 1

11:35:32 '3125': modification of invalid order #2118511

============================================================================================

Edited by newbee
Link to comment
Share on other sites

I modified, same link above. the problem that without info it is hard to identify the problem. I recoded the suspicious part, but theoretically there was no problem in it, I just coded it again in a different way. If it happens again please install total commander and use the lister (F3) to view the big log file. and copy the mentioned part as it would help a lot. Edited by konorti
Link to comment
Share on other sites

I modified, same link above. the problem that without info it is hard to identify the problem. I recoded the suspicious part, but theoretically there was no problem in it, I just coded it again in a different way. Please install total commander and use the lister (F3) to view the big log file. and copy the mentioned part as it would help a lot.

 

Hi konorti,

the problem is, that my VPS only has a disc space of 50GB and 1GB RAM, so I had to delete the file, to be able to use the VPS again.

sorry :-(

Edited by newbee
Link to comment
Share on other sites

I had a short look at the code the other day, but it's unreadable because of the formatting (missing linebreaks)

what I would do is:

- check whether the modify is neccesary at all (different SL/TP than already set in the trade)

- check whether SL/TP are inline with the StopLevel for the pair

- make sure there is only a limited number of attempts to modify an order

- analyse the returnvalue of OrderModify and if an error occured analyse the errnumber

- if it's an invalid ticket one could look into the trade history for a ticket with such number

and always give it some time between the modification calls (Sleep) and always reselect the order with OrderSelect (and check wheter it could be selected)...means don't rely on a previous selection before modifying again

There may be some lagging between the close of a trade and it's listing in the trade history

Link to comment
Share on other sites

hi iwjw,

 

I partly edited the code with external editor, bad idea. You can see the original code uploaded by Newbee. If I have time will modify the old code again in metaeditor. I changed 2 parts. I duplicated the original ordermodify custom function for live orders with openprice sent, not just zero. This helped for the backtesting log file enlargement, what i had during backtesting as wellnot just as Newbee wrote in first post. As you recommend also actually the ordermodify is called after reselecting the trade in original code as well, and there is a return if select is not successful. It would be good to see exact message how the EA fails as no errors while backtesting. So what I did I changed the statement to opposite to try to modify the order in the case if select is successful. We will see, I dont run this EA live, bactesting seems fine with it.

Edited by konorti
Link to comment
Share on other sites

I got a huge log file while backtesting with the next error:

10:22:31 2012.03.13 19:29 EA p2 EURUSD,M5: OrderModify error 130

this means it tries to modify the TP and SL within the allowed brokers stop level. I will recode to make sure it doesnt try to modify without checking it. I think i will have time till Sunday...

 

Until I upload a version which has a 500ms sleep in the loop while trying to modify the order (the file will not get so big too soon)

http://www.4shared.com/file/Amlsjcjo/EA_p2_3.html

Edited by konorti
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...