[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 517

 
No, why?
 
StrToDouble
 
There are 2 pending orders, one of them triggered, how do I delete the second one?
 
You ask the same question more than once. Write down exactly what you need and I will prescribe it for you.
 
zhuki >>:
Вы не однократно задаёте один и тот же вопрос. Пишите точно, что надо я вам пропишу.

There are 2 pending orders, one of them triggered, how do I delete the second one?

 
                  for(int i=OrdersTotal()-1;i>=0;i--)
                   {
                  if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) continue;
                  if (OrderSymbol()==Symbol())
                  if (OrderType()>1)   OrderDelete(OrderTicket());
                  }
So there are two of them or is there already one. This piece will delete all the pending orders. Right?
 
was writing one system. came across a problem.
there is an expert
#include <H1.mqh>

void init(){}
void deinit(){}
void start(){Print(f1());}
there is mqh
#import "B1.ex4"
#import "B2.ex4"

string f1();
string f2();
and two libraries, first B1
#property library
#property stacksize  8192

#include <H1.mqh>
/*
#import "B2.ex4"
   string f2();
#import*/

string f1(){return(StringConcatenate("Апчхи! ", f2()));}
now and B2
#property library
#property stacksize  8192

string f2(){return(" Будь здоров!");}

I need an Expert Advisor to be able to call the function from the first library without problems, and the function from B1 uses the function from B2,
but the terminal writes that
2010.04.13 20:25:03 B2 EURUSD,M30: function 'f1' is not found
How do I fix it? Is it even possible to have functions from one library call functions from another library?
 
I do this at the beginning of the EA determining what is on the tic's arrival. For example.
int BL=0,SL=0,B=0,S=0,BS=0,SS=0;
//-------------- Определим что имеем --------------------------------------------      
          for(int r=0;r<OrdersTotal();r++) //  
      {
      if(OrderSelect(r,SELECT_BY_POS,MODE_TRADES)==false)    continue;
      if(OrderSymbol()==Symbol())
      {
      if (OrderType()==OP_BUY )         B++;
      if (OrderType()==OP_SELL )        S++;
      if (OrderType()==OP_BUYLIMIT )   BL++;
      if (OrderType()==OP_SELLLIMIT)   SL++;
      if (OrderType()==OP_BUYSTOP )    BS++;
      if (OrderType()==OP_SELLSTOP)    SS++;
      }}
Further, you need to define the number of orders you can operate with. For example, how many pending orders BL+SL+BS+SS and so on.
Do you need it?
 
I can't understand it that way, put it in my personal message, I'll fix it.
 
vlandex >>:

Есть 2 отложенных ордера, один из них сработал, как удалить второй?

Deletes all remaining pending orders.

And if you want a substantive answer, then part of the algorithm in the studio.

//В конец кода отдельной функцией
//жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж
int OrdersDelete(int MagicNumber) //magic 
{
   for(int i = 0; i < OrdersTotal(); i++)
   {
      // already closed
      if(OrderSelect(i, SELECT_BY_POS,MODE_TRADES ) == false) continue;
      // not current symbol
      if(OrderSymbol() != Symbol()) continue;
      // order was opened in another way
      if(OrderMagicNumber() != MagicNumber) continue;
        if(OrderType() >1)
        OrderDelete(OrderTicket());
   }
  return(0); 
}
//жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж

int start()
{
 OrdersDelete(STUPID);//STUPID это мажик номер Вашего советчика
 трали вали ...
Reason: