FORTALEZAS Por favor, ayuda

 

¡Buenas tardes!

De nuevo el servodex no puede reproducir el error.

Por favor, componga este código y "lance" el indicador en el símbolo MIX-6.15

( no del MetaEditor )

//+------------------------------------------------------------------+
//|                                                         Test.mq5 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
//
bool is_failed = false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
  
  SymbolSelect( "RTS-6.15", true );
  SymbolSelect( "Si-6.15", true );
//---  
  ResetLastError();
//---
  if ( SymbolSelect( "MIX-6.15", true ) )
  {
    long total_bars = long( SeriesInfoInteger( "MIX-6.15", PERIOD_M1, SERIES_BARS_COUNT ) );
    if ( total_bars > 0 )
    {
      if ( SymbolSelect( "RTS-6.15", true ) )
      {
        total_bars = long( SeriesInfoInteger( "RTS-6.15", PERIOD_M1, SERIES_BARS_COUNT ) );
        if ( total_bars > 0 )
        {
          if ( SymbolSelect( "Si-6.15", true ) )
          {
            total_bars = long( SeriesInfoInteger( "Si-6.15", PERIOD_M1, SERIES_BARS_COUNT ) );
            if ( total_bars > 0 )
            {
              Print( "Init OK." );
            }
            else
            {
              is_failed = true;
              Print( "Get Bars failed RTS-6.15 Last error = ", string(GetLastError() ) );
            }    
          }
          else
          {
            is_failed = true;
            Print( "Symbol Si-6.15 not selected" );
          }
        }
        else
        {
          is_failed = true;
          Print( "Get Bars failed RTS-6.15 Last error = ", string(GetLastError() ) );
        }
      } 
      else
      {
        is_failed = true;
        Print( "Symbol RTS-6.15 not selected" );
      }
    }
    else
    {
      is_failed = true;
      Print( "Get Bars failed MIX-6.15 Last error = ", string(GetLastError() ) );
    }
  } 
  else
  {
    is_failed = true;
    Print( "Symbol MIX-6.15 not selected" );
  } 
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   if ( is_failed )
   {
     Print( "Sorry! Get Bars failed." );
   }
   else Print( "Bingo! We done.");
//--- return value of prev_calculated for next call
   return(rates_total);

Por favor, publique aquí los resultados (que se mostrarán en la ficha de los expertos).

 
2015.03.26 11:44:13.934	test (MIX-6.15,H1)	Bingo! We done.
2015.03.26 11:44:13.934	test (MIX-6.15,H1)	Init OK.

todos los instrumentos disponibles se incluyen en la revisión del mercado.

Rehecho la prueba. lanzado exactamente en MIX con todos los otros instrumentos incluidos.

Todo bien.

 

La cuenta es real en Otkritie. Los gráficos Ri y Si también están abiertos.

 
2015.03.26 13:56:05.487 Prueba (MIX-6.15,M1) ¡Bingo! Lo hemos hecho.
2015.03.26 13:56:05.020 Prueba (MIX-6.15,M1) ¡Bingo! Lo hemos hecho.
2015.03.26 13:56:02.566 Prueba (MIX-6.15,M1) ¡Bingo! Lo hemos hecho.
2015.03.26 13:56:02.566 Prueba (MIX-6.15,M1) ¡Bingo! Lo hemos hecho.
2015.03.26 13:56:02.560 Prueba (MIX-6.15,M1) ¡Bingo! Lo hemos hecho.
2015.03.26 13:56:01.232 Prueba (MIX-6.15,M1) ¡Bingo! Lo hemos hecho.
2015.03.26 13:56:01.232 Prueba (MIX-6.15,M1) ¡Bingo! Lo hemos hecho.
2015.03.26 13:56:01.144 Prueba (MIX-6.15,M1) ¡Bingo! Lo hemos hecho.
2015.03.26 13:56:01.024 Prueba (MIX-6.15,M1) ¡Bingo! Lo hemos hecho.

2015.03.26 13:56:01.024 Prueba (MIX-6.15,M1) Init OK.

real Opening win7 x64 C:\N-Archivos de Programa\N-Abrir Broker\Nterminal64.exe build 1085


 

Gracias.

Lo he hecho:

Win7/64 Ultimate MT5 build 1085

2015.03.26 15:30:37.229 Test (MIX-6.15,M1)      Sorry! Get Bars failed.
2015.03.26 15:30:37.229 Test (MIX-6.15,M1)      Get Bars failed RTS-6.15 Last error = 4401
 

Tengo MIX-6.15 cayendo, WIN 7-64 home premium MT5 build 1085:

2015.03.26 15:44:27.729 Test (MIX-6.15,H1)      Get Bars failed MIX-6.15 Last error = 4401
2015.03.26 15:44:27.729 Test (MIX-6.15,H1)      Sorry! Get Bars failed.
 

¡Usuarios de FORTS!

Por favor, tómese 3 minutos de su tiempo.

Para arreglar el error "flotante" - necesita

¡MÁS estadísticas!

 
Mikalas:

¡Usuarios de FORTS!

Por favor, tómese 3 minutos de su tiempo.

Para arreglar el error "flotante" - necesitas

¡MÁS estadísticas!

Pasar 3 min))

Michael, no se puede hacer eso - con una sola solicitud en el inite. No hay garantía de que todos los datos estén listos.

Así es como se hace: con sentido, por supuesto.

#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
//
bool is_failed = false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
  SymbolSelect( "MIX-6.15", true );
  SymbolSelect( "RTS-6.15", true );
  SymbolSelect( "Si-6.15", true );
//---  
  ResetLastError();
//---  
  int total_bars = Bars( "MIX-6.15", PERIOD_M1 );
  if ( total_bars > 0 )
  {
    total_bars = Bars( "RTS-6.15", PERIOD_M1 );
    if ( total_bars > 0 )
    {
      total_bars = Bars( "Si-6.15", PERIOD_M1 );
      {
        if ( total_bars > 0 )
        {
          Print( "Init OK." );
        }
        else
        {
          is_failed = true;
          Print( "Get Bars failed Si-6.15 Last error = ", string(GetLastError() ) );
        }
      }
    }
    else
    {
      is_failed = true;
      Print( "Get Bars failed RTS-6.15 Last error = ", string(GetLastError() ) );
    }
  }
  else
  {
    is_failed = true;
    Print( "Get Bars failed MIX-6.15 Last error = ", string(GetLastError() ) );
  } 
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
  ResetLastError();
//---  
  int total_bars = Bars( "MIX-6.15", PERIOD_M1 );
  if ( total_bars > 0 )
  {
    total_bars = Bars( "RTS-6.15", PERIOD_M1 );
    if ( total_bars > 0 )
    {
      total_bars = Bars( "Si-6.15", PERIOD_M1 );
      {
        if ( total_bars > 0 )
        {
          Print( "Init OK." );
        }
        else
        {
          is_failed = true;
          Print( "Get Bars failed Si-6.15 Last error = ", string(GetLastError() ) );
        }
      }
    }
    else
    {
      is_failed = true;
      Print( "Get Bars failed RTS-6.15 Last error = ", string(GetLastError() ) );
    }
  }
  else
  {
    is_failed = true;
    Print( "Get Bars failed MIX-6.15 Last error = ", string(GetLastError() ) );
  } 
//---
   if ( is_failed )
   {
     Print( "Sorry! Get Bars failed." );
   }
   else Print( "Bingo! We done.");
//--- return value of prev_calculated for next call
   return(rates_total);
  }
 

Un indicador multidivisa no es tan sencillo.

En primer lugar, compruebe la disponibilidad de los instrumentos:

bool CorrectSymbol( string symbol )
{
        ResetLastError();
        if ( SymbolInfoDouble( symbol, SYMBOL_BID ) > DBL_EPSILON ) return(true);

        // символ не выбран в "Обзоре рынка" (нет в списке доступных)
        if ( GetLastError() == 4302 )
        {
                if ( SymbolSelect( symbol, true ) && SymbolInfoInteger( symbol, SYMBOL_SELECT ) ) return(true);
        }

        return(false);
}

A continuación, abra los gráficos de todos los instrumentos utilizados (basta con un objeto gráfico invisible) para que el historial se cargue normalmente.

Y sólo entonces tratar de cargar la historia utilizando CheckLoadHistory.

Pero esto tampoco puede ser suficiente.

 
Dima_S:

Pasar 3 minutos))

Michael, no se puede hacer eso - con una solicitud única al Inite. No hay garantía de que todos los datos estén ya listos.

Así es como se hace: con sentido, por supuesto.

Estoy de acuerdo, está un poco mal, reescribí el código (ver el código fuente), ¡PERO el resultado es el mismo!

2015.03.26 16:20:55.564 Test (MIX-6.15,M1)      Sorry! Get Bars failed.
2015.03.26 16:20:55.564 Test (MIX-6.15,M1)      Get Bars failed Si-6.15 Last error = 4401
 
Mikalas:

De acuerdo, un poco incorrecto, reescribí el código, ¡PERO el resultado es el mismo!

¿Has probado el mío?