error 4108

Back to topics list To post a new topic, please log in or register
avatar
7
gotcha7 2009.08.24 12:51
 

hi, folks

I'm really impressed with the deep knowledge expressed in the forum

my qustion is about error 4108 that kills my trade.

i get the order ticket by orderslect and then issue the ordererdelete function

to kill a pending sellstop order. most of the times i get the 4108 error, now is this ea system

a proffesional tool or just a nice marketing gimic, for tyoing and hvaing fun. ??!!

thank you.

 
avatar
1331
jjc 2009.08.24 13:19 #
 
yoserian:

my qustion is about error 4108 that kills my trade.

i get the order ticket by orderslect and then issue the ordererdelete function

You can get error 4108 for a number of reasons, including an attempt to delete an order which you have already successfully deleted. For example, if you call OrderDelete() twice with the same ticket number, the second call will fail. In essence, error 4108 seems to mean "either the ticket number is simply not valid, or the order is not valid for the action you are trying to perform on it".


now is this ea system a proffesional tool or just a nice marketing gimic, for tyoing and hvaing fun. ??!!

Both.


avatar
87
avatar
1391
cloudbreaker 2009.08.24 19:13 #
 

Post your code if you will.

However, I've seen this being caused by the loop you use to cycle through orders incrementing rather than decrementing.

It can cause the behaviour jjc mentions above.

Look for something like i++ to indicate that this is your problem. In that case you'll need to turn your loop around to start counting downwards using the following as your index -> (total number of orders -1) to 0 inclusive.


CB

 
avatar
1
stevenNJUKI 2010.03.19 22:22 #
 
Hey man your answers are always on point. They just keep getting me back on track. Thanks a bunch.
 
avatar
1
rc1200pips 2014.05.05 06:49 #
 
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false)
break;
if((OrderSymbol()==Symbol()) && (OrderOpenPrice() == priceEnter))

I added some additional filters in my EA to get rid of that. but what cloudbreaker said was spot on.. its your loop


avatar
13006
WHRoeder 2014.05.05 13:36 #
 
avatar
8
manuel_campelo 2015.04.30 12:59 #
 

 I have the same Issue but I'm not doing any loop over open open trades. I have an array of orders to close and I send a ticcket to Close Function.

I Attach an image where you can see the code, the values of the variables involved and the terminal info of the trades after trying to close an order with error 4108.

As you can see (sorry for the picture) ticket, Price, Lots, etc were alright. Does anyone know what happened?


avatar
13006
WHRoeder 2015.04.30 16:13 #
 
  1. You are calling OrderClose for a pending order. OrderClose closes open orders. OrderDelete deletes pending orders.
  2. Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrong
avatar
8
manuel_campelo 2015.05.01 10:55 #
 
Thanks WHRoeder, you always state things clear. And thanks for the links (I didn't find gthen cause I was looking for error 4108).
Back to topics list  

To add comments, please log in or register