Errores, fallos, preguntas - página 2853

 

Buenas tardes a todos. Por favor, ayúdenme a resolver el siguiente problema.

Hay dos terminales MT5 en la máquina virtual. Uno está trabajando con el broker A, el otro con el broker B. El mismo bot está funcionando en ambos terminales. Todo iba bien hasta que ayer actualicé a la versión 2615.

El terminal que trabaja con el broker A funcionaba y sigue funcionando, pero el terminal con el broker B se cuelga. Es decir, después de la puesta en marcha funciona durante algún tiempo normalmente, luego se cuelga. En los registros después del cuelgue el siguiente registro:

PJ      1       11:18:36.886    Network '67003410': connection to RoboForex-ECN lost
MP      0       11:18:37.656    Network '67003410': authorized on RoboForex-ECN through Europe #2 (ping: 98.08 ms, build 2560)
RN      0       11:18:37.656    Network '67003410': previous successful authorization performed from 91.217.110.2 on 2020.09.22 07:16:34
DR      0       11:18:37.768    Network '67003410': terminal synchronized with RoboMarkets Ltd: 2 positions, 0 orders, 121 symbols, 0 spreads
IM      0       11:18:37.768    Network '67003410': trading has been enabled - hedging mode
EK      1       11:20:38.099    Network '67003410': connection to RoboForex-ECN lost
ES      0       11:20:38.674    Network '67003410': authorized on RoboForex-ECN through Europe #2 (ping: 98.08 ms, build 2560)
FQ      0       11:20:38.674    Network '67003410': previous successful authorization performed from 91.217.110.2 on 2020.09.22 07:18:36
FM      0       11:20:38.784    Network '67003410': terminal synchronized with RoboMarkets Ltd: 2 positions, 0 orders, 121 symbols, 0 spreads
GR      0       11:20:38.784    Network '67003410': trading has been enabled - hedging mode
OH      1       11:22:39.328    Network '67003410': connection to RoboForex-ECN lost
CR      3       11:22:55.243    NetDispatcher   thread timeout reached possible deadlock [15]


 

¿por qué se produce un error de compilación?

int j = 1 e3;         // OK
if(j % 1000 == 0);   // OK
if(j % 1 e3 == 0);    // '%' - illegal operation use
 
Igor Makanu:

¿Por qué se produce un error de compilación?

doble

 
Vladimir Simakov:

doble

Bien. Gracias.

Comprobado, lo es.

Print(typename(1 e3)); //        double
 
Liberada la beta 2617 con correcciones experimentales del trabajo con el historial de gráficos en MQL5.
 
Los PMs en el sitio web no están funcionando de nuevo.
 

Dime, ¿los desarrolladores de Metatrader 5 han roto los buffers de los indicadores en la última actualización? ¿O es que me pasa algo en la cabeza?

La cuestión es que todos los indicadores de flecha que no tienen recálculo completo en una nueva barra han empezado a producir el mismo fallo. Las flechas comienzan a multiplicarse como conejos en las barras adyacentes de la nueva barra. Ejemplo adjunto.

Sólo ayuda el recálculo completo del indicador en una nueva barra.


//+------------------------------------------------------------------+
//|                                                   test_arrow.mq5 |
//|                                               Efremov Konstantin |
//|                          https://www.mql5.com/ru/users/leonardo4 |
//+------------------------------------------------------------------+
#property copyright "Efremov Konstantin"
#property link      "https://www.mql5.com/ru/users/leonardo4"
#property version   "1.00"
#property indicator_chart_window
//--- init indicator buffers
#property indicator_buffers 1
#property indicator_plots   1

#property indicator_label1  "Arrows"
#property indicator_type1   DRAW_ARROW
#property indicator_color1  clrLawnGreen
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1

input int      History  = 10;             // История, дней  

double   Arrows[];
int      cnt_bars;
int      HistoryCandle;
bool     FirstStartFlag;
int bar, limit;
datetime counted_bar;


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer       (0,Arrows,INDICATOR_DATA);
   ArraySetAsSeries     (Arrows,true);
   PlotIndexSetInteger  (0,PLOT_DRAW_TYPE,DRAW_ARROW);
   PlotIndexSetInteger  (0,PLOT_LINE_COLOR,clrDodgerBlue);
   PlotIndexSetString   (0,PLOT_LABEL,"Arrows");
   PlotIndexSetInteger  (0,PLOT_ARROW,233);
   
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);

//--- Рассчитываем количество свечей истории текущего таймфрейма от настройки "дней"
   HistoryCandle           = History*24*60*60/PeriodSeconds(PERIOD_CURRENT);
   cnt_bars                = HistoryCandle;  // Кол-во баров для подсчета сигналов
   FirstStartFlag          = true;
   
//---
   return(INIT_SUCCEEDED);
  }
 
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   ChartRedraw(0);
  }
  
//+------------------------------------------------------------------+
//| 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[])
  {
//---

      ArraySetAsSeries(close,true);
      ArraySetAsSeries(open,true);
      ArraySetAsSeries(low,true);
      
     if(HistoryCandle>=rates_total) cnt_bars=rates_total-1;
     else cnt_bars=HistoryCandle;
     
//----+ проверка количества баров на достаточность для корректного расчёта индикатора
      if(rates_total<=cnt_bars)
         {
            Print("Недостаточно истории. Есть "+IntegerToString(rates_total-1)+" надо "+IntegerToString(cnt_bars));                                                                                                                                                                                                                                                                                                              
            return(0);
         }
         
//--- инициализация индикаторного буфера  
     if(FirstStartFlag) 
      {
//--- обнулим все буферы стрелок и времени от мусора                                                             
         for(int x=cnt_bars; x>=0 && !IsStopped(); x--) Arrows[x] = EMPTY_VALUE;
         FirstStartFlag = false;
         ChartRedraw(0);
      }
      
   if(prev_calculated>rates_total || prev_calculated<=0) // проверка на первый старт расчёта индикатора
      {
         limit=cnt_bars-1; // стартовый номер для расчёта всех баров
      }
   else limit=rates_total-prev_calculated; // стартовый номер для расчёта новых баров
   
   if(rates_total != prev_calculated) Arrows[0] = EMPTY_VALUE;
   

   
   for(bar=limit; bar>=0 && !IsStopped(); bar--)
      {
         if(close[bar+1]>open[bar]+5*_Point)  {Arrows[bar]=NormalizeDouble(low[bar]-5*_Point,_Digits);}
      }
      
   MqlRates rates[];
   MqlTick tick;
   SymbolInfoTick(Symbol(),tick);
   CopyRates(Symbol(),PERIOD_CURRENT,0,1,rates);
   double i;
   long m,s;
   m=rates[0].time+GetMinute()*60-tick.time;
   i=m/60.0;
   s=m%60;
   m=(m-m%60)/60;
            
   Comment(" Candle: "+IntegerToString(m,0,' ')+" m "+IntegerToString(s,0,' ')+" s left");
   
   if(iTime( _Symbol, PERIOD_M1, 0 ) > counted_bar ) 
      {
         counted_bar = iTime( _Symbol, PERIOD_M1, 0 );
         ChartRedraw(0);
      }
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

int GetMinute()
  {
   switch(Period())
     {
      case PERIOD_M1: return(1);
      case PERIOD_M2: return(2);
      case PERIOD_M3: return(3);
      case PERIOD_M4: return(4);
      case PERIOD_M5: return(5);
      case PERIOD_M6: return(6);
      case PERIOD_M10: return(10);
      case PERIOD_M12: return(12);
      case PERIOD_M15: return(15);
      case PERIOD_M20: return(20);
      case PERIOD_M30: return(30);
      case PERIOD_H1: return(60);
      case PERIOD_H2: return(120);
      case PERIOD_H3: return(180);
      case PERIOD_H4: return(240);
      case PERIOD_H6: return(360);
      case PERIOD_H8: return(480);
      case PERIOD_H12: return(720);
      case PERIOD_D1: return(1440);
      case PERIOD_W1: return(10080);
      case PERIOD_MN1: return(43200);
     }
   return(1);
  }
Archivos adjuntos:
test_arrow.mq5  12 kb
 
Konstantin Efremov:

Dime, ¿los desarrolladores de Metatrader 5 han roto los buffers de los indicadores en la última actualización? ¿O es que me pasa algo en la cabeza?

La cuestión es que todos los indicadores de flecha que no tienen recálculo completo en una nueva barra han empezado a producir el mismo fallo. Las flechas comienzan a multiplicarse como conejos en las barras adyacentes de la nueva barra. Ejemplo adjunto.

Sólo ayuda el recálculo completo del indicador en una nueva barra.


Sustituir esta tontería

//--- инициализация индикаторного буфера  
     if(FirstStartFlag) 
      {
//--- обнулим все буферы стрелок и времени от мусора                                                             
         for(int x=cnt_bars; x>=0 && !IsStopped(); x--) Arrows[x] = EMPTY_VALUE;
         FirstStartFlag = false;
         ChartRedraw(0);
      }

con esta tontería.

  if(prev_calculated == 0)
    ArrayInitialize(Arrows, 0.0);
 

>>Hay dos terminales MT5 enla máquina virtual.Uno está trabajando con el broker A, el otro con el broker B. Ambos terminales están ejecutando >>el mismo bot. Todo iba bien hasta ayer, hasta que actualicé a la versión 2615.


Volví a la versión 2560, todo funciona bien, sin cuelgues ni bloqueos.

¿Los desarrolladores responden a los mensajes?

Виртуальный хостинг для MetaTrader 5
Виртуальный хостинг для MetaTrader 5
  • www.mql5.com
Виртуальный хостинг для MetaTrader 4/5 является лучшим VPS-решением для Форекса. Оно не требует настройки, дает минимальные задержки до сервера и отличается низкими ценами. Всего за 15 USD в месяц вы получите виртуальную платформу, которая работает круглые сутки, экономит вашу прибыль и даже окупает себя. Создать удаленную копию приложения...
 
elavr:

>>Hay dos terminales MT5 enla máquina virtual.Uno está trabajando con el broker A, el otro con el broker B. Ambos terminales están ejecutando >>el mismo bot. Todo iba bien hasta ayer, hasta que actualicé a la versión 2615.


Volví a la versión 2560, todo funciona bien, sin congelaciones ni bloqueos.

¿Los desarrolladores responden a los mensajes?

¿Ha informado de algún detalle técnico para entender o reproducir?

Las preguntas sin detalles casi siempre se quedan sin nuestra atención.