unknown ticket for OrderModify function - page 2

 
rezk allah said fellah:

 Ordermodify UN-successful, error: 1 ,,, this issue start the moment the 5 order appear

Maybe because of orders[number%4] ? So that number 5 gets the ticket of number 1, which already has been modified. Error 1 is

ERR_NO_RESULT

No error returned, but the result is unknown

For what do you need this modulo? %4

 
lippmaje:

Maybe because of orders[number%4] ? So that number 5 gets the ticket of number 1, which already has been modified. Error 1 is

ERR_NO_RESULT

No error returned, but the result is unknown

For what do you need this modulo? %4

no it's not ,, the problem that i have is in the OrderModify of sell order ,,
 

Again.. I say.. this will not work 

if(OrderSelect(oredrs[number%4],SELECT_BY_TICKET,MODE_TRADES)
//try
//if(OrderSelect(number,SELECT_BY_POSITION,MODE_TRADES)

If you are going to select by ticket then send the ticket number... not the index number.(oredrs[number%4]

If you are going to use the index number then use SELECT_BY_POSITION.

When you call the change function with the parameter i you are sending the index number.. not the ticket number... 

I do not see any code where this oredrs[] array is populated with anything and see no reason for it.


Pip Pip

 
James Hodges:

Again.. I say.. this will not work 

If you are going to select by ticket then send the ticket number... not the index number.(oredrs[number%4]

If you are going to use the index number then use SELECT_BY_POSITION.

When you call the change function with the parameter i you are sending the index number.. not the ticket number... 

I do not see any code where this oredrs[] array is populated with anything and see no reason for it.


Pip Pip

Presumably OP is using a global variable (oredrs) to store ticket numbers and is in fact sending the ticket number by accessing the array by index. In theory, this would work assuming the code is correct upstream. Although, as we can assuredly agree, this is very poor form and a code-smell prone to errors. OP you should stop abusing global variables and pass the ticket array as an arg or better yet rewrite the function entirely to properly recover as others have mentioned. 

Reason: