[¡Archivo!] Cualquier pregunta de novato, para no saturar el foro. Profesionales, no lo dejéis pasar. No podría ir a ningún sitio sin ti - 2. - página 222

 
ramirez17:

Por favor, indique un error.


división por 0 - debe haber una división por cero en el cuaderno de bitácora

en la primera pasada

i+Sell_bars-1
está fuera del tamaño permitido de las barras
 
ramirez17, es más fácil encontrar los máximos/mínimos en la estocástica y sustituir la fórmula estocástica por su relación
 
maxstah:

Hola, podríais decirme dónde encontrar un indicador que vuelva a dibujar las barras diarias para que empiecen a una hora diferente.

Por ejemplo: La hora del terminal es 00:00. En los parámetros de entrada del indicador ponemos: +4. Ahora las barras diarias comienzan a las 4:00.

Gracias de antemano.

MT4 tiene un convertidor incorporado. Servicio -> Archivo de cotizaciones.
 

Hola.

Tengo una pregunta como principiante:

cómo obtener los datos de los beneficios actuales para las posiciones abiertas; cómo obtener los datos del saldo actual.

 
Roger:
Como si el nuevo Pinocho buscara un Campo de las Maravillas fiable. No seas ridículo).

Como, petrosian inteligente quiere hacer una broma...))
 

Chicos, donde está el error.... ya lo he tratado... aquí está el código...

Al operar en termenal con spread flotante(un dígito más añadido) el asesor escribe un error, lote erróneo... y con spread fijo, todo está bien y se negocia...

 GBPUSD,H1: OrderSend error 131

pero aquí está el código mismo.... ¿dónde está el error?

 if(ExistPositions() > 0)   {
   for(cnt=0;cnt<OrdersTotal();cnt++)  { 
   OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC && OrderType()==OP_BUY)  {
         if(Ask-OrderOpenPrice() > (TrailingStop * Point))  { 
            if(OrderStopLoss() < (Ask - TrailingStop * Point)) { 
               OrderModify(OrderTicket(),
                           OrderOpenPrice(),
                           Ask - TrailingStop * Point,
                           Ask + sTakeProfit * Point,0,Aqua);
            return(0);  } // close for if(OrderStopLoss() < (Ask - TrailingStop * Point))
                        } // close for if(Ask-OrderOpenPrice() > (TrailingStop * Point))
                } // close for if(OrderSymbol()==Symbol() && OrderType()==OP_BUY)
      if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC && OrderType()==OP_SELL) {
                        if(OrderOpenPrice() - Bid > (TrailingStop * Point))   { 
                                if(OrderStopLoss() > (Bid + TrailingStop * Point))   { 
                           OrderModify(OrderTicket(),
                                       OrderOpenPrice(),
                                       Bid + TrailingStop * Point,
                                       Bid - sTakeProfit * Point,0,Magenta);
            return(0);  } 
                        } // close for if(OrderOpenPrice() - Bid > (TrailingStop * Point))
                 } // close for if(OrderSymbol()==Symbol() && OrderType()==OP_SELL)
          } // close for for(cnt=0;cnt<total;cnt++)
   } // close for if(TradesThisSymbol > 0)
}

bool ExistPositions() {
        for (int i=0; i<OrdersTotal(); i++) {
                if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
                        if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) {
                                return(True);
                        }
                } 
        } 
        return(false);
}



void OpenBuy() { 
   double ldLot, ldStop, ldTake; 
   string lsComm; 
   ldLot = GetSizeLot(); 
   ldStop = GetStopLossBuy(); 
   ldTake = GetTakeProfitBuy(); 
   lsComm = GetCommentForOrder(); 
   OrderSend(Symbol(),OP_BUY,ldLot,Ask,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenBuy); 
   if (UseSound) PlaySound(NameFileSound); 
} 
void OpenSell() { 
   double ldLot, ldStop, ldTake; 
   string lsComm; 

   ldLot = GetSizeLot(); 
   ldStop = GetStopLossSell(); 
   ldTake = GetTakeProfitSell(); 
   lsComm = GetCommentForOrder(); 
   OrderSend(Symbol(),OP_SELL,ldLot,Bid,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenSell); 
   if (UseSound) PlaySound(NameFileSound); 
} 
string GetCommentForOrder() {   return(Name_Expert); } 
double GetSizeLot() {   return(Lots); } 
double GetStopLossBuy() {       return (Bid-sStopLoss*Point);} 
double GetStopLossSell() {      return(Ask+sStopLoss*Point); } 
double GetTakeProfitSell() {    return(Bid-sTakeProfit*Point); } 
double GetTakeProfitBuy() {     return(Bid+sTakeProfit*Point); } 

return(0);

//+------------------------------------------------------------------+
 
Vovo4ka:

Como, petrosian inteligente quiere hacer una broma...))

www.dukascopy.com mt4 y tecnología java, el depósito mínimo es de 1000 billetes verdes, descubierto recientemente por mí mismo.
 
todem:

www.dukascopy.com mt4 y la tecnología java, mínimo dept 1000 verde, descubierto por mí mismo recientemente.

Muchas gracias.
 
Si el indicador está en un bucle infinito con sleep, entonces necesitas insertar una función como if(!deinit)?
 
Vovo4ka:

Chicos donde está el error.... ya abordado...aquí está el código...

al operar en térmicas con spread flotante (un dígito más añadido) el asesor escribe un error, lote equivocado...

pero aquí está el código mismo.... ¿dónde está el error?


hacer la normalización del lote

double GetSizeLot() {   return(NormalizeDouble(Lots,2)); }