Errores, fallos, preguntas - página 991

 
costy_:

Cuando lo llamo me sale

2013.05.31 13:08:41 temp (AUDUSD,M5) TERMINAL_COMPANY = MetaQuotes Software Corp.

Debe ser diferente corredor, o algo está mal, gracias.

 AccountInfoString(ACCOUNT_SERVER)

terminal pertenece a MetaQuotes Software Corp.

brokerAccountInfoString(ACCOUNT_SERVER)

 
pako:

terminal pertenece a MetaQuotes Software Corp.

brokerAccountInfoString(ACCOUNT_SERVER)

Gracias, después de todo lo perdí.
 

¡Buenas tardes!

Estoy escribiendo un indicador multidivisa. Cuando vuelvo a cambiar el código, compila bien, pero cuando intento poner un indicador en un gráfico, me sale "archivo ex5 no válido". Intenté volver a guardarlo con otro nombre y lo mismo. Resulta que el problema está en el código, pero la compilación está bien.

//+------------------------------------------------------------------+
//|                                                      Therm02.mq5 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+

#include <ST_ServicesAndAbstracts.mqh>

#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 120
#property indicator_buffers 1
#property indicator_plots   2
//--- plot Label1
#property  indicator_label1  "Label1"
#property  indicator_type1   DRAW_LINE
#property  indicator_color1  clrBlack
#property  indicator_style1  STYLE_SOLID
#property  indicator_width1  1
//--- indicator buffers
double         gThermB[];

double         gEURThermB[];
double         gCHFThermB[];

CRangeManager  *gEURRM, *gCHFRM;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,gEURThermB,INDICATOR_DATA);
   SetIndexBuffer(0,gCHFThermB,INDICATOR_DATA);
   gEURRM = new CRangeManager(1,0.2,20,"EURUSD");
   gCHFRM = new CRangeManager(1,0.2,20,"USDCHF");
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate (const int rates_total,      // size of input time series
                 const int prev_calculated,  // bars handled in previous call
                 const datetime& time[],     // Time
                 const double& open[],       // Open
                 const double& high[],       // High
                 const double& low[],        // Low
                 const double& close[],      // Close
                 const long& tick_volume[],  // Tick Volume
                 const long& volume[],       // Real Volume
                 const int& spread[]         // Spread
   )

  {
//---
   double lEUR[], lCHF[];
   int copied;
   copied=CopyClose("EURUSD",PERIOD_CURRENT,0,5000,lEUR); 
   if (copied==-1){Print("Ждите...EUR");return(0);}
   copied=CopyClose("USDCHF",PERIOD_CURRENT,0,5000,lCHF); 
   if (copied==-1){Print("Ждите...CHF");return(0);}


   sThermometer lT;
   for(int i=prev_calculated;i<rates_total;i++)
      {
         lT = gEURRM.getState(lEUR[i]);
         gEURThermB[i] = lT.currentT; 
         
         lT = gEURRM.getState(lCHF[i]);
         gEURThermB[i] = lT.currentT; 
      }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| TradeTransaction function                                        |
//+------------------------------------------------------------------+
void OnTradeTransaction(const MqlTradeTransaction& trans,
                        const MqlTradeRequest& request,
                        const MqlTradeResult& result)
  {
//---
   
  }
//+------------------------------------------------------------------+

¿Cómo puedo ayudar?

Gracias.

 
ns_k:

¡Buenas tardes!

Estoy escribiendo un indicador multidivisa. Cuando vuelvo a cambiar el código, compila bien, pero cuando intento poner un indicador en un gráfico, me sale "archivo ex5 no válido". Intenté volver a guardarlo con otro nombre y lo mismo. Resulta que el problema está en el código, pero la compilación está bien.

¿Cómo puedo ayudar?

Gracias.

¿La compilación se realiza sin errores ni advertencias? ¿Es preciso?
 
tol64:
¿La compilación se realiza sin errores ni advertencias? ¿Está seguro?
No hay errores, hay advertencias, en su mayoría inofensivas como los valores no utilizados. Pero existe este indicador de que la cantidad de búferes es menor que la necesaria. Voy a tratar de cavar aquí

 
ns_k:
No hay errores, hay advertencias, en su mayoría inocuas como los valores no utilizados. Sin embargo, existe este indicador de que la cantidad de búferes es inferior a la necesaria. Intentaré indagar aquí.

Sí, eso es exactamente. Ahí es donde está el error:

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,gEURThermB,INDICATOR_DATA);
   SetIndexBuffer(0,gCHFThermB,INDICATOR_DATA);
   gEURRM = new CRangeManager(1,0.2,20,"EURUSD");
   gCHFRM = new CRangeManager(1,0.2,20,"USDCHF");
//---
   return(INIT_SUCCEEDED);
  }
Resaltado en rojo. Sustitúyelo por el 1.
 
#property indicator_buffers 1
#property indicator_plots   2
El número de topes no puede ser inferior al número de parcelas. Esto es lo que te dice el compilador en el mensaje.
 
tol64:

Sí, eso es exactamente. Eso es lo que está mal:

Resaltado en rojo. Sustitúyelo por el 1.
#property indicator_buffers 1
#property indicator_plots   2
Спасибо всем!
 
ns_k:

MT4 Built 500. Pongo la alerta a un nivel determinado, se dispara y todo va bien. Si desactivo la alerta (espacio), aparece como suspendida. Entonces el instrumento alcanza el umbral y se activa la alerta. ¿Es así como debería ser?

ps. Sí, una nota al margen. Primero resalté todas las alertas con mi ratón (6 de ellas) y presioné la barra espaciadora, todas se suspendieron. Después de disparar uno, ya lo he apagado con la barra espaciadora solamente y sigue disparando

 

Voy a espolvorear un poco más.

//+------------------------------------------------------------------+
//|                                                      Therm02.mq5 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+

//#include <ST_ServicesAndAbstracts.mqh>

#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 120
#property indicator_buffers 2
#property indicator_plots   2
//--- plot Label1
#property  indicator_label1  "Label1"

#property  indicator_type1   DRAW_LINE
#property  indicator_color1  clrBlack
#property  indicator_style1  STYLE_SOLID
#property  indicator_width1  1
//--- indicator buffers
double         gThermB[];

double         gEURThermB[];
double         gCHFThermB[];

//CRangeManager  *gEURRM, *gCHFRM;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,gEURThermB,INDICATOR_DATA);
   SetIndexBuffer(1,gCHFThermB,INDICATOR_DATA);
   //gEURRM = new CRangeManager(1,0.2,20,"EURUSD");
   //gCHFRM = new CRangeManager(1,0.2,20,"USDCHF");
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate (const int rates_total,      // size of input time series
                 const int prev_calculated,  // bars handled in previous call
                 const datetime& time[],     // Time
                 const double& open[],       // Open
                 const double& high[],       // High
                 const double& low[],        // Low
                 const double& close[],      // Close
                 const long& tick_volume[],  // Tick Volume
                 const long& volume[],       // Real Volume
                 const int& spread[]         // Spread
   )

  {
//---
   double lEUR[], lCHF[];
   int copied;
  // copied=CopyClose("EURUSD",PERIOD_CURRENT,0,5000,lEUR); 
   if (copied==-1){Print("Ждите...EUR");return(0);}
  // copied=CopyClose("USDCHF",PERIOD_CURRENT,0,5000,lCHF); 
   if (copied==-1){Print("Ждите...CHF");return(0);}


   //sThermometer lT;
   for(int i=prev_calculated;i<5000;i++)
      {
         //lT = gEURRM.getState(lEUR[i]);
       //  gEURThermB[i] = lT.currentT; 
         
     //    lT = gCHFRM.getState(lCHF[i]);
     //    gCHFThermB[i] = lT.currentT; 
      }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| TradeTransaction function                                        |
//+------------------------------------------------------------------+
void OnTradeTransaction(const MqlTradeTransaction& trans,
                        const MqlTradeRequest& request,
                        const MqlTradeResult& result)
  {
//---
   
  }
//+------------------------------------------------------------------+

Al iniciarse, el terminal jura que el símbolo especificado no está seleccionado. Lo he arrastrado a otra MT5 a través de la nube - funciona, y con cadenas comentadas usando tickers.

Intentaría encontrar la razón, pero no sé por dónde empezar a buscar un error tan desviado. ¿Tal vez deba reinstalar el terminal de una vez?