[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 267

 
Dimka-novitsek:
Deleted! Just deleted.
That's it!!! Now wait for the collection team from DC to come to your house. Don't open the door for anyone. If anything, I'll give you a parabellum... :))))))
 

"...Could you please tell me if there is any way to close all open orders at once? Not one by one manually...".

int CloseAll()
{
    int   iCheck = 1 ;
    bool  bResponse  ; 
 
    int   N = OrdersTotal () - 1    ;
    for ( int i = N ; i >= 0 ; i -- )
        {
          OrderSelect ( i , SELECT_BY_POS , MODE_TRADES ) ;
      
          if      ( ( OrderType () == OP_BUY  ) || ( OrderType () == OP_SELL ) )
                    {
                      bResponse  = OrderClose ( OrderTicket () , OrderLots () , OrderClosePrice () , 0 , White ) ;
                    }
  
          else if ( ( OrderType () == OP_SELLLIMIT )
                 || ( OrderType () == OP_SELLSTOP  )
                 || ( OrderType () == OP_BUYLIMIT  )
                 || ( OrderType () == OP_BUYSTOP   ) )
                    {
                      bResponse  = OrderDelete ( OrderTicket () ) ;
                    }
 
          if        ( bResponse == false )
                      iCheck     = -1    ;
 
        } // for
 
    return ( iCheck ) ;
}
 
 

 
andrius:

zdrastvujte,mozet kto znajet pocemu sovetnik netorgujet,uze vtaroj den s nim vozus i nekak nezapuskajetsa?

spasibo

 
Ais:

"Can you please tell me if there is any way to close all open orders at once? Not one by one manually".


I'll give you my five cents

void CloseAll()
  {
  while(OrdersTotal>0)
    {
    RefreshRates();
    OrderSelect(0,SELECT_BY_POS);
    if(OrderType()<2) OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),0,White);
    else OrderDelete(OrderTicket());
    }
  return;  
  }
 

1252
artmedia70 21.03.2011 21:25
andrius:

zdrastvujte,mozet kto znajet pocemu sovetnik netorgujet, uze vtaroj den s nim vozus i nekak nezapuskajetsa?

spasibo


This advisor starts trading from the third day.....))


 
artmedia70:


eto to ponetno,but pocemu zaprescena,ili on privezan konkretnu sciotu?

I tried it on a drug sciote, but toze samoje.na demo.

 
andrius:


eto to ponetno,but pocemu zaprescena,or on privezan konkretnu sciotu?

I tried it on a drug sciote, but toze samoje.na demo.

This is a protection against use on an account other than a specific one. You have to pay the developer... That's how he makes his money... :)))
 
artmedia70:
This is protection against use on an account other than the one in question. You have to pay the developer a lot of money... That's how he makes his money... :)))

Spasibo za konrentij otvet.jescio vopros, aeto otkliucit kakto mozno?
 
andrius:

Spasibo za konrentij otvet.jescio vopros,a eto otkliucit kakto mozno?

You can, but not on this forum. Programmers' work is respected here.
 
Roger:

You can, but not on this forum. Programmers' work is respected here.

Ponetna spasibo.
Reason: