Cualquier pregunta de los recién llegados sobre MQL4 y MQL5, ayuda y discusión sobre algoritmos y códigos - página 1606

 
Alexey Viktorov #:

Lee las reglas. El EA debe funcionar sin restricciones tanto en los instrumentos como en los TFs.

Gracias. Hubo muchos otros errores en el proceso)

 
La pregunta es si se pueden inicializar matrices multidimensionales con la función

ArrayInitialize(array,EMPTY_VALUE);
Así double msArr[10][4][500];
O puede hacerse sólo en bucle en MKL4
.

 
Valeriy Yastremskiy las matrices multidimensionales se pueden inicializar con la función

ArrayInitialize(array,EMPTY_VALUE);
Así double msArr[10][4][500];
O sólo se puede hacer en bucle en MKL4
.

También están ArrayFill y ZeroMemory

Los arrays multidimensionales cuando se procesan con ArrayFill() aparecen como unidimensionales, por ejemplo, array[2][4] se procesa como array[8], así que cuando se trabaja con este array es aceptable especificar el índice del elemento inicial igual a 5. Por lo tanto, llamar a ArrayFill(array, 5, 2, 3.14) para array[2][4] llenará array[1][1] y array[1][2] con el valor 3.14.

 
Taras Slobodyanik #:

también hay ArrayFill y ZeroMemory

Gracias
 
MakarFX #:

¡Por aquí!

Y tú eres un bromista. Y el problema realmente es, y hay temas sobre que el comando Imprimir imprime dos veces en la pestaña Expertos y Allert también viene dos veces, sólo que no hay respuesta por desgracia cómo solucionarlo. Y para el futuro, si no se sabe, se puede guardar silencio y pasar de largo, pero para ganar calificación a sí mismos respuestas no profesionales es estúpido. Sí, por cierto, sus respuestas son realmente muy débiles.

 
Manter84 #:

Eres un bromista. Pero el problema es real, y hay temas sobre que el comando Imprimir imprime dos veces en la pestaña Expertos y Allert también viene dos veces, sólo que no hay respuesta por desgracia cómo solucionarlo. Y para el futuro, si no se sabe, se puede guardar silencio y pasar de largo, pero para ganar calificación a sí mismos respuestas no profesionales es estúpido. Sí, por cierto, sus respuestas son realmente muy débiles.

No has entendido mi enlace...

Imprimir no imprime más de una vez, si lo hace, hay un error en el código... por eso te he mandado a los telépatas, ya que no has publicado el código)

 

¡Buenas noches!

Estimados usuarios del foro, necesito ayuda. He escrito un script en MQL4 que dibuja una línea mediante una fórmula a partir de tres puntos dados en un gráfico. Ocupa 130 líneas, incluyendo sangrías y espacios. Recientemente he decidido portarlo a MQL5 y me he dado cuenta de que mis escasos conocimientos en programación no me van a ayudar, tengo que volver a aprender.

Estaré agradecido si alguien está dispuesto a portar el script a MQL5. Estaría encantado si alguien quisiera portar este script a MQL5.

 
Андрей no dudes en mandarme un mensaje en persona.

Me encantaría que alguien lo hiciera gratis (con).

 
 #property copyright "ExpoMe"
 #property link      "http://www.metaquotes.net"

 #property indicator_chart_window
 #property indicator_buffers 1
 #property  indicator_color1 Blue
 #property  indicator_width1 2
 #property  indicator_style1 0
 double     Buffer1[];
 //+------------------------------------------------------------------+
 //| Объявляем внешние переменные                                     |
 //+------------------------------------------------------------------+
 datetime point_1;
 datetime point_2;
 datetime point_3;
 datetime LastBarTime;
 string line_name[10];
 int gg=1;
 int x1;
 int x2;
 int x3;
 int xx1; // В эту переменную сохраняется значение номера бара вершины перед прогоном при появлении нового бара.
 int xx2; // Если линии стоят, значит при поялвении нового бара номер бара вершины должен увеличиться на 1.
 int xx3; // Если этого не произошло и xx1=x1 после прогона, значит увеличиваем вручную.
 int max;
 int maxx;
 double y1;
 double y2;
 double y3;
 double y11;
 double y22;
 double y33;
 double x11;
 double x22;
 double x33;
 double y;
 double a1;
 double a2;
 double a3;

 //+------------------------------------------------------------------+
 //| Custom indicator initialization function                         |
 //+------------------------------------------------------------------+
 int init()
   {SetIndexBuffer(0,Buffer1);
   SetIndexStyle(0,DRAW_LINE);
 //---- indicators
 //----
    return(0);
   }
  
 int start()
   {
   // Пересчитываем инликатор только при появлении нового бара
   if(LastBarTime == iTime(Symbol(), 0, 0))
      return(0);
    LastBarTime = iTime(Symbol(), 0, 0);
   
   
 // Присваиваем значения переменных времени


 int obj_total=ObjectsTotal();

   for(int ii=0;ii<100;ii++)
     {string name = ObjectName(ii);
       if(ObjectType(name)!=OBJ_VLINE)
       continue;
       line_name[gg] = ObjectName(ii);
       gg=gg+1;
     
     }
    
   
    point_1=ObjectGet(line_name[1], OBJPROP_TIME1);
    point_2=ObjectGet(line_name[2], OBJPROP_TIME1);
    point_3=ObjectGet(line_name[3], OBJPROP_TIME1);
   
 // Запоминаем текущий номер бара вершины

 xx1=x1; 
    
 //Определяем номера баров ключевых точек
   for (int j=0;j<Bars; j++)
   { if (Time[j]==point_1) x1=j;}
  
  
   // Если после прогона сдвиг по вершине не произошел, значит линий нет, добавляем +1 вручную.
 if (x1==xx1) x1=x1+1;
  
  
 xx2=x2;
  
   for (int k=0;k<Bars; k++)
   {if (Time[k]==point_2) x2=k;  }
  
 if (x2==xx2) x2=x2+1;
  
 xx3=x3;

   for (int l=0;l<Bars; l++)
   {if (Time[l]==point_3) x3=l; }
  
 if (x3==xx3) x3=x3+1;

 // Comment ("n1=", j," n2=", k, " n3=", l);
 //Находим "высоту" вершин
   {
   y1=High[x1];
   y2=High[x2];
   y3=High[x3];
   //Comment ("y1=", y1," x1=", x1, " y2=", y2, "x2=", x2," y3=", y3, " x3=", x3);
   //Принимаем первую из них за начало координат
  
 a1=(y3-(x3*(y2-y1)+x2*y1-x1*y2)/(x2-x1))/(x3*(x3-x1-x2)+x1*x2);
 a2=((y2-y1)/(x2-x1))-a1*(x1+x2);
 a3=((x2*y1-x1*y2)/(x2-x1))+a1*x1*x2;

 max=MathMax(x1,x2);
 maxx=MathMax(max,x3);
  
  
   for (int i=maxx; i>=0; i--)
  
   { y=a1*i*i+a2*i+a3;
   Buffer1[i]=y;}
  

    return(0);
   }} 

MetaQuotes — разработчик торговых платформ для брокеров, банков, бирж и хедж-фондов
MetaQuotes — разработчик торговых платформ для брокеров, банков, бирж и хедж-фондов
  • www.metaquotes.net
Торговая платформа MetaTrader 5 - это бесплатный инструмент трейдера, позволяющий торговать на форексе и фондовых биржах
 
Vitaly Muzichenko #:

Lanza el código aquí, tal vez alguien hará un pro bono(c), hay tal cosa

Si alguien ayuda, le debo un whisky de todos modos)