[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 524

 
Does anyone know if there is a Printable Version of the MQL4 Tutorial and Documentation on this forum?
 
Dimka-novitsek
Sorry if I'm being obtuse, I'm back with my...
A muffled shot rang out from somewhere very far away. It was Roger who shot himself...
 
Roger:


You have already been told ten times that there is no order with the number OrdersTotal(), but each time you come up with the same errors. Replace it with

for ( i=OrdersTotal()-1;i>=0;i--)


Thanks, in general, but that's not the point. See, I also put minus one in the orderselect, it still counts orders from zero. In fact, thank you very much for explaining to me in this thread that orders are counted from zero.
 
Dimka-novitsek:

Thanks, in general, but that's not the point. I put minus one in the orderselect, but it still counts orders from zero. In fact, thank you very much for explaining to me in this thread that orders are counted from zero.
 OrderDelete(OrderTicket( )) ; Alert ("OrderDelete-vse",  GetLastError( ) );  OrderClose( OrderTicket( ), OrderLots( ), OrderClosePrice( ) , 0, CLR_NONE);Alert ("OrderClose-vse",  GetLastError( ) ); C=0; }}}}     

1. try to put into words what you are doing here

2. I would like each command to be written as a separate line, I do not want to scroll the screen and a half.

 

Yes, yes, of course. In that line, I just clear all the orders cleanly. All of them.

In general, as soon as I find at least one order closed at Take Profit, I immediately remove all orders. The orders are found very well reporting to the Alert log ("found MODE_HISTORY");

I can not delete them correctly!

Then pasledny cycle, it deletes all pending and all the orders, logging Alert ("pasledny cycle",i), and then do not decides! It won't delete it, motherfucker!

 
Dimka-novitsek:

In the above line, I just clear all orders cleanly.All-in-all.

This is what you want to do =)

Actually there is a wild mix of delete + close orders without any check of their types and price at which they are supposed to do so

 
Yes, let him delete everything at once and close it up!
 
Yes, I put the functions OrderTicket( ), OrderLots( ), OrderClosePrice( ) in there, and they, of course, correctly determine the ticket number, number of lots and closing price.
 
Dimka-novitsek:
Yes, let them delete everything and close it down straight away!

It's quite possible to get banned from trading because of frequent requests

Why don't you want to do it right away?

 
Dimka-novitsek:
Yes, I inserted functions OrderTicket( ), OrderLots( ), OrderClosePrice( ), and they, of course, correctly determine the ticket number, number of lots, closing price.
only at this point, it may be a remote pending order and the result will be unusual ;)
Reason: