[ARCHIVO] Cualquier pregunta de novato, para no saturar el foro. Profesionales, no pasen de largo. En ninguna parte sin ti - 3. - página 638

 
aumentar el límite de la franja horaria privada superior/actual +1.
 
Así que mi hermano ha jugado unas cuantas partidas en tanques hasta ahora. Los pedidos no se quitan, al menos mejoró un poco. Ahora el código es, a saber, me dabbed ambos, y he añadido i=OrdersTotal()-1; esta línea en el bucle, en teoría, debe obispechit su continuación hasta que todo no se mata, pero esto no ha sucedido. Aquí:
if(Summaprofita()>=Profit_v_balans )
        {
         for(int i=OrdersTotal()-1;i>=0;i--)
           {
              bool error=true;
            OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
            
            if( magic==OrderMagicNumber( ) && OrderSymbol()==Symbol())
              {
              
                 OrderClose( OrderTicket( ), OrderLots( ), OrderClosePrice( ) , 0, CLR_NONE); error=false;
                           Sleep(1000);
             OrderDelete(OrderTicket());error=false;
             
              if(OrderType()==OP_BUY)
              {
               OrderClose(OrderTicket(),OrderLots(),Bid,3,CLR_NONE);
               
              }
            if(OrderType()==OP_SELL)
              {
               OrderClose(OrderTicket(),OrderLots(),Ask,3,CLR_NONE);
               
              }
              i=OrdersTotal()-1;
            Sleep(1000);
         } } }
        
¡¡¡NO EL ORDEN ELIMINADO NO DEJA QUE EL NUEVO ORDEN SEA!!! ¡¡Ayuda!!
 
//+------------------------------------------------------------------+
//|  Удаляет рыночные и отложенные ордера.                           |
//|  Как отдельные по тикету, так и по фильтру в цикле поиска        |
//|  Фильтры по магику,типу,символу. Если вызвать с символом "All" - |
//|  То удалит все, подобно функции DeleteAll()                      |
//+------------------------------------------------------------------+
bool OrdClose(int magik  = -1,
              int type   = -1,//=10 удаление всех рыночных; =11 удаление всех отложенных 
              int ticket = -1,
           string symb   = "",
           double cLot   = -1      
              ){int   digit = MarketInfo(Symbol(),MODE_DIGITS);double lot;
//+------------------------------------------------------------------+
   if(cLot==0){return;}
   if(symb==""){symb=Symbol();}
   int slip = MarketInfo(symb,MODE_SPREAD);
   double ltstp = MarketInfo(Symbol(),MODE_LOTSTEP);
   if(ltstp == 0.1){int ltdg = 1;}
   if(ltstp == 0.01){   ltdg = 2;} 
   if(ticket>0){
      GetLastError();
      RefreshRates();
      if(OrderSelect(ticket,SELECT_BY_TICKET)){
         if(OrderCloseTime()!=0){return;}
         if(OrderType()<2){
                lot = OrderLots();
                if(cLot>0){
                        lot = NormalizeDouble(cLot,ltdg);
                        if(lot>OrderLots()){lot=OrderLots();}
                        if(lot<MarketInfo(Symbol(),MODE_MINLOT)){lot=MarketInfo(Symbol(),MODE_MINLOT);}
                }
            if(!OrderClose(OrderTicket(),
                                     lot,
       NormalizeDouble(OrderClosePrice(),MarketInfo(symb,MODE_DIGITS)),
                                    slip,
                                   Green
                          )
            ){
               Print(GetLastError());
               return(false);              
            }else{
               Print("Order "+GetNameOP(OrderType())+" closed");
               return(true);
            }                          
         }else{
            if(!OrderDelete(OrderTicket(),GetOrdCl(type))){
               Print(GetLastError());
               return(false);              
            }else{
               Print("Order "+GetNameOP(OrderType())+" closed");
               return(true);
            }
         }
      }
   }else{
//+------------------------------------------------------------------+
   for(int i=OrdersTotal()-1;i>=0;i--){
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
         if(OrderCloseTime()!=0){continue;}
         if(symb!="All"){
            if(OrderSymbol()!=symb){continue;}
            if(type>=0&&type<6){if(OrderType()!=type){continue;}}
            if(type==10){if(OrderType()>1){continue;}}
            if(type==11){if(OrderType()<2){continue;}}
            if(magik>0){if(OrderMagicNumber()!=magik){continue;}}
         }
         if(OrderType()<2){
                lot = OrderLots();
                if(cLot>0){
                        lot = NormalizeDouble(cLot,ltdg);
                        if(lot>OrderLots()){lot=OrderLots();}
                        if(lot<MarketInfo(Symbol(),MODE_MINLOT)){lot=MarketInfo(Symbol(),MODE_MINLOT);}
                }
                Print("Close ",type,"  ",OrderType());
            if(!OrderClose(OrderTicket(),
                                     lot,
       NormalizeDouble(OrderClosePrice(),MarketInfo(symb,MODE_DIGITS)),
                                    slip,
                                   Green
                          )
            ){
               Print(GetLastError());
               return(false);              
            }else{
               Print("Order "+GetNameOP(OrderType())+" closed");
            }                          
         }else{
            if(!OrderDelete(OrderTicket(),GetOrdCl(type))){
               Print(GetLastError());
               return(false);              
            }else{
               Print("Order "+GetNameOP(OrderType())+" closed");
            }
         }
      }
   }          
//-----+
}   
return(true);}
 
Descripción de los equipos :https://www.mql5.com/ru/forum/137651/page3
 
¡Vaya, cuántas líneas! ¡¡¡¡Gracias!!!!
 
Señores expertos, por favor, aconsejen cómo cargar un buen historial de cotizaciones en el terminal. Para la prueba de mi primer robot es necesario. Las cotizaciones del EUR-USD son de 4 dígitos.
 
Sancho77:

Lo he probado de las dos maneras:

Todavía no hay reacción.




Funciona);
int start()
  {
//----
     Comment("Signal = ",Signal());       
//----
   return(0);
  }
//+------------------------------------------------------------------+

  int Signal()
  {
  double dn_stop_1 = iCustom(NULL,0,"NRTR_ATR_STOP",ATR,Coeficient,0,1); // синий, снизу
  double up_stop_1 = iCustom(NULL,0,"NRTR_ATR_STOP",ATR,Coeficient,1,1); // красный, сверху
              
   if (dn_stop_1!=0.0) return(1);
   if (up_stop_1!=0.0) return(-1);
   
   return(0);
   } 
 
Myth63:
Señores expertos, por favor, aconsejen cómo cargar un buen historial de cotizaciones en el terminal. Para la prueba de mi primer robot es necesario. Las cotizaciones del EUR-USD son de 4 dígitos.
Si quieres jugar en el probador, descarga el historial de MetaQuotes a través de F2. Para que las operaciones en tiempo real tengan éxito, es necesario que las cotizaciones provengan del servidor de su empresa de corretaje. Si su empresa de corretaje no dispone de este servicio "Archivo de cotizaciones" (puede estar en las páginas web de algunas empresas de corretaje), el historial debe recogerse en tiempo real: es una información estratégica. Se trata de una herramienta automática para recopilar cotizaciones.
 

¡Buenos días a todos!

Pregunta sobre la función iMAOnArray(array[], total, period, ma_shift, ma_method, shift)

¿Puedes decirme si array[] debe ser un array de buffer o puede ser cualquiera? El problema es que cuando

Creo e inicializo un array en un programa, esta función no funciona. Pero cuando enlazo medianteSetIndexBuffer

... todo funciona como debería.

 
r772ra:

Funciona));
¡Muchas gracias! Realmente funcionó, pero fue extraño, siempre estaba probando en M15, pero luego decidí probarlo en H1 y la señal apareció. Entonces volví a M15 - funcionó)))