Errores, fallos, preguntas - página 1921

 

Error de compilación

template<typename T1, typename T2>
void f( T2 t )
{
        Print( typename( T1 ), ":", typename( T2 ), ":", t );
}
void OnStart()
{
        char ch = 5;
        f<int>( ch ); //(1) //error: 'f' - wrong template parameters count
}

Se recopila un registro

         f<int,char>( ch ); //(2)
que contiene información redundante y además ambigua si ch no es char. Además, en las macros la información sobre el tipo de ch no suele estar disponible (depende del contexto)
 
A100:

Error durante la compilación

¿Es posible hacer esto en los profesionales?

 
Комбинатор:

¿Los profesionales pueden hacer eso?

C++ compila ambas variantes, pero (1) parece más correcta e intuitiva. En (2), tenemos que tener en cuenta también los tipos, lo cual es un inconveniente y en lugar de simplificar obtenemos una excesiva complicación, que se ve claramente si <> tiene varios typename
 

no desaparecen las alertas, lo he intentado todo, he leído todo, no hay alertas en μl sitio web sólo en el terminal...


 
Vladimir Pastushak:

Las alertas no desaparecen, lo he intentado todo, he leído de todo, no hay alertas en la web μl, sólo en el terminal....

Esto ha sido así desde el principio.

Hubo un hilo aquí en el que se averiguó qué archivo hay que borrar para que marque como leído. Pero los "fantasmas" siguen apareciendo.

 
Hola. ¿Pueden decirme por qué las cotizaciones del oro en la demo desaparecen cada vez más?
 

Los archivos .log %AppData%\MetaQuotes\Terminal...\MQL5\Logs\YYYMMDD.log no se actualizan puntualmente

La actualización sólo se produce: después de reiniciar el terminal o seleccionar el menú Ver. Si no se reinicia o se hace clic en Vista previa, el archivo correspondiente estará vacío.

Antes todo funcionaba (incluso el archivo YYYYMMDD.log abierto en el MetaEditor se actualizaba en pocos segundos después de mostrar las filas en la pestaña Expertos) y no había que realizar ninguna acción extra no evidente

 

¡Buenas noches! ¡Mi Asesor Experto tiene RSI y STO, pero no puedo hacer que una señal de compra o venta se abra en una nueva vela, y no en la actual!

el código es así:

void OnTick(){

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

if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
if (OrderSymbol()==Symbol() && Magic==OrderMagicNumber())
volver;

double RSI0 = iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, 0);
double RSI1 = iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, 1);

double STO0=iStochastic(NULL, 0, KPeriod, DPeriod, Slowing, MODE_SMA, STO_LOWHIGH, MODE_MAIN, 0);
double STO1=iStochastic(NULL, 0, KPeriod, DPeriod, Slowing, MODE_SMA, STO_LOWHIGH, MODE_MAIN, 1);

double STO2 = iStochastic(NULL, 0, KPeriod, DPeriod, Slowing, MODE_SMA, STO_LOWHIGH, MODE_SIGNAL, 0);
double STO3 = iStochastic(NULL, 0, KPeriod, DPeriod, Slowing, MODE_SMA, STO_LOWHIGH, MODE_SIGNAL, 1);

doble SL=0,TP=0;

si (RSI1 < RSIDownLevel && RSIDownLevel < RSI0 && STO2 < STO0){

if (takeprofit!=0) TP = NormalizeDouble(Ask + takeprofit*Point,Digits);
if (stoploss!=0) SL = NormalizeDouble(Ask - stoploss* Point,Digits);
if (OrderSend(Symbol(),OP_BUY, Lot,NormalizeDouble(Ask,Digits),slippage,SL,TP,NUL L,Magic)==-1) Print(GetLastError())
}

si (RSI1 > RSIUpLevel && RSIUpLevel > RSI0 && STO3 > STO1){

if (takeprofit!=0) TP = NormalizeDouble(Bid - takeprofit*Point,Digits);
if (stoploss!=0) SL = NormalizeDouble(Bid + stoploss* Point,Digits);
if (OrderSend(Symbol(),OP_SELL,Lot,NormalizeDouble(Bi d,Digits),slippage,SL,TP,NULL,Magic)==-1) Print(GetLastError())
}

return(0);
}


De nuevo, tengo que repetir que mi orden se activa al abrirse en la vela actual, y necesito que la orden se abra en la siguiente. ¡¡¡Por favor, ayúdenme!!!

 
sviter-pro:

¡Buenas noches! Mi Asesor Experto tiene RSI y STO, pero no puedo hacer que se abra en una nueva vela cuando se activa una señal de compra o venta, y no en la actual.

¡¡¡Una vez más, mi orden se activa por la vela actual, pero necesito que la orden se abra en la siguiente vela!!! ¡¡¡Ayuda por favor!!!


//+------------------------------------------------------------------+
void OnTick()
  {

   for(int i=0; i<OrdersTotal(); i++)
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol() && Magic==OrderMagicNumber())
            return;

   double RSI0 = iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, 0);
   double RSI1 = iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, 1);

   double STO0=iStochastic(NULL, 0, KPeriod, DPeriod, Slowing, MODE_SMA, STO_LOWHIGH, MODE_MAIN, 0);
   double STO1=iStochastic(NULL, 0, KPeriod, DPeriod, Slowing, MODE_SMA, STO_LOWHIGH, MODE_MAIN, 1);

   double STO2 = iStochastic(NULL, 0, KPeriod, DPeriod, Slowing, MODE_SMA, STO_LOWHIGH, MODE_SIGNAL, 0);
   double STO3 = iStochastic(NULL, 0, KPeriod, DPeriod, Slowing, MODE_SMA, STO_LOWHIGH, MODE_SIGNAL, 1);

   double SL=0,TP=0;
   
   if(NewBar())
     {
      if(RSI1<RSIDownLevel && RSIDownLevel<RSI0 && STO2<STO0)
        {

         if(takeprofit!=0) TP=NormalizeDouble(Ask+takeprofit*Point,Digits);
         if(stoploss!=0) SL=NormalizeDouble(Ask-stoploss *Point,Digits);
         if(OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),slippage,SL,TP,NUL L,Magic)==-1) Print(GetLastError());
        }

      if(RSI1>RSIUpLevel && RSIUpLevel>RSI0 && STO3>STO1)
        {

         if(takeprofit!=0) TP=NormalizeDouble(Bid-takeprofit*Point,Digits);
         if(stoploss!=0) SL=NormalizeDouble(Bid+stoploss *Point,Digits);
         if(OrderSend(Symbol(),OP_SELL,Lot,NormalizeDouble(Bi d,Digits),slippage,SL,TP,NULL,Magic)==-1) Print(GetLastError());
        }
     }

   return(0);
  }
//+------------------------------------------------------------------+
bool NewBar()
  {
   static datetime time=0;
   if(time==0)
     {
      time=Time[0];
      return false;
     }
   if(time!=Time[0])
     {
      time=Time[0];
      return true;
     }
   return false;
  }
//+------------------------------------------------------------------+
 
sviter-pro:

¡Buenas noches! Mi Asesor Experto tiene RSI y STO, pero no puedo hacer que cuando se active una señal de compra o venta, se abra en una nueva vela y no en la actual.

el código es así:

De nuevo, tengo que repetir que mi orden se activa al abrirse en la vela actual, y necesito que la orden se abra en la siguiente. ¡¡¡Por favor, ayúdenme!!!

Se toman los valores del indicador de las barras 0 y 1.

En lugar de 0 y 1 toma los valores de 1 y 2 respectivamente.

Razón de la queja: