[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 513

 

Hello!

Why does it only delete BUYSTOP but not SELLLIMIT? Even though I have two open orders!

if (Hour()==19 && Minute()==00 && Кризис_1989==true)
            {
             for( int i=1; i<=OrdersTotal(); i++)          
      {
             if(OrderSelect(i-1,SELECT_BY_POS)==true) 
               {                                       
                if(OrderType()==OP_SELLLIMIT  && OrderSymbol()==Symbol())
                  {
                  OrderDelete(OrderTicket()); 
                  }//if
  
                if(OrderType()==OP_BUYSTOP && OrderSymbol()==Symbol())
                  {
                  OrderDelete(OrderTicket()); 
                  }//if
               }//if
            return(0);
            }
          }     
 
Zhunko:
Yes, it can. But then you should not forget to resize it.

doesn't work


If you declare it like this:

double DayHigh[], DayLow[];

then when I assign certain values to elements of the array, only "0" is saved

 
Can you tell me why EAs can be greyed out in the list?
 
sss2019:
Can you tell me why EAs can be greyed out in the list?

because the same folder with the Expert Advisor does not contain its source in .mq4 format
 

advise an EA in codebase in which the lot size in a new order depends on the result of a previous trade (how to determine the result of the last trade?)

i will use it as a template for my own EA

 
dva1986:

doesn't work


If you declare it like this:

double DayHigh[], DayLow[];

then when I assign certain values to elements of the array, only "0" is retained

Read my previous post. There is only one sentence in it.
 
YOUNGA:

advise an EA in codebase where the lot size in a new order depends on the result of a previous trade (how to determine the result of the last trade?)

I will use it as an example for my EA


STORM https://www.mql5.com/ru/code/10557
 

Hello all!

I can't place an order if I specify a stop loss:

OrderSend(Symbol(),OP_BUY,BaseLot,Ask,3,Bid-25*Point,Ask+25*Point, "My order #",16384,0,Green);

And this is how it is set:

OrderSend(Symbol(),OP_BUY,BaseLot,Ask,3,NULL,NULL, "My order #",16384,0,Green);

Error 130 wrong stops.

And we cannot modify an order to set a stop loss either.

 
a.DarkAngel:

Hello!

Why does it only delete BUYSTOP but not SELLLIMIT? Even though I have two open orders!


for( int i=0; i<=OrdersTotal(); i++)
 
Andreyu:

Hello all!

An order is not being placed if I specify a stop loss:

OrderSend(Symbol(),OP_BUY,BaseLot,Ask,3,Bid-25*Point,Ask+25*Point, "My order #",16384,0,Green)
;

Error 130 Wrong stops.

Print("Стоповые ордера можно выставлять на расстоянии не менее ", MarketInfo(Symbol(), MODE_STOPLEVEL), " пипсов от текущей цены"); 
Reason: