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

 
So didn't want to do it all again, well, okay! Thank you!
 
the indicators in the visualisation window are no longer visible for some reason....
 

Good afternoon!!! The robot is hanging up the terminal. Last entry in the log - one deleted position, only one. Then everything hangs - no tpu, no nu...

Orders from the chart hang in a moment and disappear in the next moments, while I have rebooted the terminal about ten times.

The robot has a delete function. It deleted all the orders one by one. I redid the loop inside brackets for it... It deleted them anyway, but in a few ticks. And then...

void Udalenie()
{
int Error; string errorcomment="";
for( int i=OrdersTotal()-1;i>=0;i++){OrderSelect (i, SELECT_BY_POS  ) ;
int nt=0,type=0;nt=OrderTicket( );type = OrderType();
if (type==0){
    for(int  A=25;A>=0;A--){Sleep(2000); RefreshRates();if(nt==0)break ;
  OrderClose(  nt, OrderLots( ) , Bid, 5, 0) ; Error=GetLastError(); 
  if (Error==0) break ; 
  else {errorcomment = "Ошибка удаления  ордера BUY  "  + " " + Symbol() +  " " + ErrorDescript(Error);
  Print (errorcomment);  } } }
 if (type==1){ 
    for(  A=25;A>=0;A--){Sleep(2000); RefreshRates();if(nt==0)break ;
  OrderClose(  nt, OrderLots( ) , Ask, 5, 0) ; Error=GetLastError();
  if (Error==0) break ; 
  else {errorcomment = "Ошибка удаления  ордера SELL  "  + " " + Symbol() +  " " + ErrorDescript(Error);
  Print (errorcomment);   }}}
 if (type>=2){   
  for(  A=25;A>=0;A--){Sleep(2000); RefreshRates();if(nt==0)break ;
   OrderDelete(nt);Error=GetLastError();
  if (Error==0) break ; 
  else {errorcomment = "Ошибка удаления  ордера отложенного ордера  "  + " " + Symbol() +  " " + ErrorDescript(Error);
  Print (errorcomment);   }}}}
  
          
}
 
Dimka-novitsek:

Good afternoon!!! The robot is hanging up the terminal. Last entry in the log - one deleted position, only one. Then everything hangs - no tpu, no nu...

Orders from the chart hang in a moment and disappear in the next moments, while I have rebooted the terminal about ten times.

The robot has a delete function. It deleted all the orders one by one. I redid the loop inside brackets for it... It deleted them anyway, but in a few ticks. And then...


Error in the loop

You've got...

for( int i=OrdersTotal()-1;i>=0;i++)
Нужно
for( int i=OrdersTotal()-1;i>=0;i--)
 
Dimka-novitsek:

Good afternoon!!! The robot is hanging up the terminal. Last entry in the log - one deleted position, only one. Then everything hangs - no tpu, no nu...

My orders hover in a chart and vanish in next moments. I have already reloaded the terminal about ten times.

The robot has a delete function. It deleted all the orders one by one. I redid the loop inside brackets for it... It deleted them anyway, but in a few ticks. And then...

Your code is impossible to read. Fix it here for starters:

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

P.S. One of the main components to success is order.

 

Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!! I had no idea... Yeah, I see it's there, I'll try it now.

I've already downloaded a second terminal!

 
What's the best way to spell the ArrayInitialize function in this case?
double Orderasthitaem[6][2];ArrayInitialize(Orderasthitaem, 0.0);
for ArrayInitialize function must be array
 
Compiled asArrayInitialize(Orderasthitaem[6][2], 0.0);
 
Dimka-novitsek:
Compiled as ArrayInitialize(Orderasthitaem[6][2], 0.0);

Check the result. Print() to print all the values of the array; it is desirable to assign them (array members) some value before initialization
 

No, and so, in the log there is a lot of cursing - the array is not passed to the function, or rather it's not the array that is passed...

What the hell does he want? I've done all kinds of brackets - empty, full...