Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1109

 

When I start the installer, a window appears showing a file download indicator.

Then another window appears

The installer requires me to specify proxy settings, which I don't have.

 
 
polpolpol:

When I start the installer, a window appears showing a file download indicator.

Then another window appears

The installer requires me to specify proxy settings, which I don't have.

I have to turn off the antivirus and reset it from the memory.
 

Hi. Will the following entry be correct? The function when called should delete all pending orders.

void DeletedOrders()
         {
         for (int i=0; i<=OrdersTotal(), i++)
             {
             if (OrderSelect(i,SELECT_BY_POS))
                type=OrderType();
             if (type==2 || type==3 || type==4 || type==5)
                OrderDelete(i,clrNONE);
             }
         return();
         }  
 
bobrush:

Hi. Will the following entry be correct? The function should delete all pending orders when called.

No, of course it doesn't. We should specify the ticket, not the order number in the loop:OrderDelete(OrderTicket(),clrNONE);

And the condition is quite enough:if(type>1).

I also recommend that you print the error code more often - it helps.

Oh, yes, functions of "void" type must not return anything, we don't need return() in normal execution, only when premature function exit is provided by any condition.

 
bobrush:

Hi. Will the following entry be correct? The function when called should delete all pending orders.

Keep in mind that there are still undocumented order types with type=6 and with type=7 respectively for operations over balance and over account credit.

Instead of i<=OrdersTotal(), i<OrdersTotal() would be better, without calling OrderSelect unnecessarily

And the loop must be passed from the end to the beginning, otherwise, if the order array has time to be updated after the i-th element in it has been removed, the former i+1th element in the i-th place will be skipped. It is better to start from the end.

If we consider that the developers do not guarantee any orderliness in the orders array, we can't actually guarantee that the order order order sequence in their array will remain the same after deleting one of them. This would be quite reliable. We loop through the loop until the pending order is detected. The loop is terminated. Delete the order we have found. We wait for Sleep (100) to update the array of orders. Then we come back to the loop to find the pending order but with a new array of orders. We perform a full search, but not by resuming the previous loop. And we will do this in triplicate (loop to find, delete one order, wait for the array to be updated) until the pending order can no longer be found.

 
evillive:

No, of course not. The ticket must be specified, not the order number in the loop:OrderDelete(OrderTicket(),clrNONE);

And the condition is quite enough:if(type>1).

I also recommend that you print the error code more often - it helps.

Oh, yes, functions of "void" type must not return anything, we don't need return() in normal execution, only when premature function exit is provided by any condition.


Thanks!
 
Vlad143:

Note that there are still undocumented order types with type=6 and with type=7 respectively for transactions over balance and over account credit.

Instead of i<=OrdersTotal(), i<OrdersTotal() would be better, without calling OrderSelect unnecessarily

And the loop must be passed from the end to the beginning, otherwise, if the order array has time to be updated after the i-th element in it has been removed, the former i+1th element in the i-th place will be skipped. It is better to start from the end.

If we consider that the developers do not guarantee any orderliness in the orders array, we can't actually guarantee that the order order order sequence in their array will remain the same after deleting one of them. This would be quite reliable. We loop through the loop until the pending order is detected. The loop is terminated. Delete the order we have found. We wait for Sleep (100) to update the array of orders. Then we come back to the loop to find the pending order but with a new array of orders. We perform a full search, but not by resuming the previous loop. The loop of three (the loop of search, deletion of one order, waiting for the array to be updated) until the pending order cannot be found.


I.e., for(OrdersTotal()-1,i=0,i--) and at the end of the loop, sleep and break?
 
Vlad143: We wait for Sleep (100) to refresh the array of orders.
IMHO, IMHO, my personal opinion instead of Sleep (100) it is better while(!RefreshRates()); semicolon at the end.
 
bobrush:

I.e. for(OrdersTotal()-1,i=0,i--) and at the end of the loop sleep and break?

The order is correct, slip and break are not needed, and if it misses an order, it will delete it on the next tick.
Reason: