Preguntas de los principiantes MQL4 MT4 MetaTrader 4 - página 12

 

Por favor, avise a quien sepa cómo enlazar con la hora del sistema del ordenador en el terminal MT4:

- tablas

- pedidos abiertos

- historial de acuerdos

- Registros

- Registros

La cuestión es que la hora no está sincronizada.

¿Cuál puede ser el problema?

 

¡Buenas tardes!

Tomé uno delos indicadores de volumen como base, lo rehice para que se ajustara a mis parámetros, dejé sólo lo necesario, ahora muestra sólo las flechas que se necesitan.

No consigo adjuntar la ALERTA para que cuando se encienda la flecha verde o roja aparezca el mensaje.

¡Por favor, ayuda!

Z.U. Mirado en diferentes tutoriales cómo hacer algo no funciona.

 
Refresh052:

¡Buenas tardes!

Tomé uno delos indicadores de volumen como base, lo rehice para que se ajustara a mis parámetros, dejé sólo lo necesario, ahora muestra sólo las flechas que se necesitan.

No consigo adjuntar la ALERTA para que cuando se encienda la flecha verde o roja aparezca el mensaje.

¡Por favor, ayuda!

Z.U. Mirado en diferentes tutoriales cómo hacer algo no funciona.

Vamos, pon todo el código del indicador aquí
 
Stanislav Aksenov:
Adelante, pon todo el código del indicador aquí

#propiedad estricta

#propiedad ventana_del_gráfica_del_indicador


#propiedad indicador_mínimo 0

#property indicator_buffers 2

#property indicator_color1 Rojo

#property indicator_color2 Lime




#property indicator_width1 4

#property indicator_width2 4


extern ENUM_APPLIED_PRICE precio = PRICE_CLOSE;

extern double Sobrecompra = 80;

extern double Sobreventa = 20;

extern int NúmeroDeBarras = 500;

extern string Nota = "0 significa Mostrar todas las barras";

extern int MAPeriod = 100;

extern int LookBack = 20;

extern bool Alert=True;

doble rojo[],lima[];

//+------------------------------------------------------------------+

//| Función de inicialización de indicadores personalizada |

//+------------------------------------------------------------------+

int init()

{

//---- indicadores

SetIndexBuffer(0,red);

SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3);

SetIndexArrow(0,234);

SetIndexLabel(0, "Climax High ");

SetIndexBuffer(1,lime);

SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3);

SetIndexArrow(1,233);

SetIndexLabel(1, "Climax Low ");

SetIndexEmptyValue(0,0.0);

SetIndexEmptyValue(1,0.0);

SetIndexDrawBegin(0,0);

SetIndexDrawBegin(1,0);

IndicatorShortName("MKSP_Volume" );


//----

return(0);

}

//+------------------------------------------------------------------+

//| Función de desinicialización de indicadores personalizada |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| Función de iteración de indicadores personalizada |

//+------------------------------------------------------------------+

int inicio()

{


double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3,tempv2,tempv3

int límite;

int barras_contadas=IndicadorContado();

//---- la última barra contada se volverá a contar

if(counted_bars>0) counted_bars--;

if ( NumberOfBars == 0 )

NúmeroDeBarras = Barras_contabilizadas;

limit=NúmeroDeBarras; //Barras_contabilizadas;

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

{

rojo[i] = 0; lima[i] = 0;

Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0;

VolLowest = Volumen[iLowest(NULL,0,MODE_VOLUME,20,i)];

if (Volumen[i] == VolLowest)

{

}

Rango = (Alto[i]-Bajo[i]);

Valor2 = Volumen[i]*Rango;

si ( Rango != 0 )

Valor3 = Volumen[i]/Rango;

for ( int n=i;n<i+MAPeriod;n++ )

{

tempv= Volumen[n] + tempv;

}

for ( int n=i;n<i+LookBack;n++)

{

tempv2 = Volumen[n]*((Alto[n]-Bajo[n]));

si ( tempv2 >= HiValue2 )

HiValue2 = tempv2;

si ( Volumen[n]*((Alto[n]-Bajo[n])) != 0 )

{

tempv3 = Volumen[n] / ((Alto[n]-Bajo[n]);

si ( tempv3 > HiValue3 )

HiValue3 = tempv3;

if ( tempv3 < LoValue3 )

LoValue3 = tempv3;

}

}

if ( Valor2 = HiValue2 && Close[i] > (High[i] + Low[i]) / 2 )

{

rojo[i] = Alto[i]+10*Punto;

}

si ( Valor3 == HiValue3 )

{

NormalizarDoble(Volumen[i],0);

rojo[i]=0;

}

if ( Value2 == HiValue2 && Value3 == HiValue3 )

{

NormalizarDoble(Volumen[i],0);

rojo[i]=0;

}

if ( Valor2 = HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 )

{

cal[i] = Baja[i]-10*Punto;

}

}

//----

//----

return(0);

}

//+------------------------------------------------------------------+

Y una captura de pantalla

Archivos adjuntos:
 
Stanislav Aksenov:
Vamos, pon todo el código del indicador aquí.
No entiendo dónde poner Alerta
 
Refresh052:


Y una captura de pantalla

if ( Value2 == HiValue2  && Close[i] > (High[i] + Low[i]) / 2 )

            {

               red[i] = High[i]+10*Point;

             Alert("===================");  

            }  

            

          if ( Value3 == HiValue3 )

            {

               NormalizeDouble(Volume[i],0);                

               red[i]=0;

            }

          if ( Value2 == HiValue2 && Value3 == HiValue3 )

            {

               NormalizeDouble(Volume[i],0);

               red[i]=0;

              

            }

         if ( Value2 == HiValue2  && Close[i] <= (High[i] + Low[i]) / 2 )

            {

               lime[i] = Low[i]-10*Point;

               Alert("===================");            

              }
 
Alekseu Fedotov:
if ( Value2 == HiValue2  && Close[i] > (High[i] + Low[i]) / 2 )

            {

               red[i] = High[i]+10*Point;

             Alert("===================");  

            }  

            

          if ( Value3 == HiValue3 )

            {

               NormalizeDouble(Volume[i],0);                

               red[i]=0;

            }

          if ( Value2 == HiValue2 && Value3 == HiValue3 )

            {

               NormalizeDouble(Volume[i],0);

               red[i]=0;

              

            }

         if ( Value2 == HiValue2  && Close[i] <= (High[i] + Low[i]) / 2 )

            {

               lime[i] = Low[i]-10*Point;

               Alert("===================");            

              }
cada vela señala con mayor precisión cada segundo
 

#property strict
#property indicator_chart_window
#property indicator_minimum 0
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Lime
#property indicator_width1 4
#property indicator_width2 4

extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;
extern double Overbought = 80;
extern double Oversold   = 20;
extern int     NumberOfBars = 500;
extern string  Note = "0 means Display all bars";
extern int     MAPeriod = 100;
extern int     LookBack = 20;
extern bool Alert=True;
double red[],lime[];
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
      SetIndexBuffer(0,red);
      SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3);
      SetIndexArrow (0,234);
      SetIndexLabel(0,"Climax High ");
      SetIndexBuffer(1,lime);
      SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3);
      SetIndexArrow (1,233);
      SetIndexLabel(1,"Climax Low ");
      SetIndexEmptyValue(0,0.0);
      SetIndexEmptyValue(1,0.0);
      SetIndexDrawBegin(0,0);
      SetIndexDrawBegin(1,0);
      IndicatorShortName("MKSP_Volume" );
   return(0);
  }
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
int start()
{
   double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3,tempv2,tempv3,tempv;
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   if ( NumberOfBars == 0 ) NumberOfBars = Bars-counted_bars;
   limit=NumberOfBars; //Bars-counted_bars;

   for(int i=0; i<limit; i++)  
      {
         red[i] = 0; lime[i] = 0;
         Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0;
         VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)];
         if (Volume[i] == VolLowest)
            {
                           }

         Range = (High[i]-Low[i]);
         Value2 = Volume[i]*Range;

         if (  Range != 0 ) Value3 = Volume[i]/Range;

         for ( int n=i;n<i+MAPeriod;n++ )
            {
               tempv= Volume[n] + tempv;
            }

          for( int n=i;n<i+LookBack;n++)
            {
               tempv2 = Volume[n]*((High[n]-Low[n]));
               if ( tempv2 >= HiValue2 )
                  HiValue2 = tempv2;

               if ( Volume[n]*((High[n]-Low[n])) != 0 )
                  {          
                     tempv3 = Volume[n] / ((High[n]-Low[n]));
                     if ( tempv3 > HiValue3 )  HiValue3 = tempv3;
                     if ( tempv3 < LoValue3 ) LoValue3 = tempv3;
                  }
            }
          if ( Value2 == HiValue2  && Close[i] > (High[i] + Low[i]) / 2 )
            {
               red[i] = High[i]+10*Point;

if(i==0) Alert("Вроде бы красная стрелка"); 

            }  

          if ( Value3 == HiValue3 )
            {
               NormalizeDouble(Volume[i],0);                
               red[i]=0;
            }
          if ( Value2 == HiValue2 && Value3 == HiValue3 )
            {
               NormalizeDouble(Volume[i],0);
               red[i]=0;
            }
         if ( Value2 == HiValue2  && Close[i] <= (High[i] + Low[i]) / 2 )
            {
               lime[i] = Low[i]-10*Point;

if(i==0) Alert("Вроде бы зеленая стрелка");  

              }
      }
   return(0);
  }

No pongas el código en texto plano, utiliza un diseño especial para ello.

Realmente no lo entendí,

Por regla general, se emite una alerta si hay una señal en la última barra (cero)

 
Stanislav Aksenov:

#property strict
#property indicator_chart_window
#property indicator_minimum 0
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Lime
#property indicator_width1 4
#property indicator_width2 4

extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;
extern double Overbought = 80;
extern double Oversold   = 20;
extern int     NumberOfBars = 500;
extern string  Note = "0 means Display all bars";
extern int     MAPeriod = 100;
extern int     LookBack = 20;
extern bool Alert=True;
double red[],lime[];
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
      SetIndexBuffer(0,red);
      SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3);
      SetIndexArrow (0,234);
      SetIndexLabel(0,"Climax High ");
      SetIndexBuffer(1,lime);
      SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3);
      SetIndexArrow (1,233);
      SetIndexLabel(1,"Climax Low ");
      SetIndexEmptyValue(0,0.0);
      SetIndexEmptyValue(1,0.0);
      SetIndexDrawBegin(0,0);
      SetIndexDrawBegin(1,0);
      IndicatorShortName("MKSP_Volume" );
   return(0);
  }
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
int start()
{
   double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3,tempv2,tempv3,tempv;
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   if ( NumberOfBars == 0 ) NumberOfBars = Bars-counted_bars;
   limit=NumberOfBars; //Bars-counted_bars;

   for(int i=0; i<limit; i++)  
      {
         red[i] = 0; lime[i] = 0;
         Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0;
         VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)];
         if (Volume[i] == VolLowest)
            {
                           }

         Range = (High[i]-Low[i]);
         Value2 = Volume[i]*Range;

         if (  Range != 0 ) Value3 = Volume[i]/Range;

         for ( int n=i;n<i+MAPeriod;n++ )
            {
               tempv= Volume[n] + tempv;
            }

          for( int n=i;n<i+LookBack;n++)
            {
               tempv2 = Volume[n]*((High[n]-Low[n]));
               if ( tempv2 >= HiValue2 )
                  HiValue2 = tempv2;

               if ( Volume[n]*((High[n]-Low[n])) != 0 )
                  {          
                     tempv3 = Volume[n] / ((High[n]-Low[n]));
                     if ( tempv3 > HiValue3 )  HiValue3 = tempv3;
                     if ( tempv3 < LoValue3 ) LoValue3 = tempv3;
                  }
            }
          if ( Value2 == HiValue2  && Close[i] > (High[i] + Low[i]) / 2 )
            {
               red[i] = High[i]+10*Point;

if(i==0) Alert("Вроде бы красная стрелка"); 

            }  

          if ( Value3 == HiValue3 )
            {
               NormalizeDouble(Volume[i],0);                
               red[i]=0;
            }
          if ( Value2 == HiValue2 && Value3 == HiValue3 )
            {
               NormalizeDouble(Volume[i],0);
               red[i]=0;
            }
         if ( Value2 == HiValue2  && Close[i] <= (High[i] + Low[i]) / 2 )
            {
               lime[i] = Low[i]-10*Point;

if(i==0) Alert("Вроде бы зеленая стрелка");  

              }
      }
   return(0);
  }

No pongas el código en texto plano en tus mensajes, utiliza el diseño del código.

Realmente no lo he descubierto,

Por regla general, se emite una alerta si hay una señal en la última barra, creo que la puse en los lugares correctos...

Ok gracias, lo intentaré, también una lección aparte))))
 
Stanislav Aksenov:

#property strict
#property indicator_chart_window
#property indicator_minimum 0
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Lime
#property indicator_width1 4
#property indicator_width2 4

extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;
extern double Overbought = 80;
extern double Oversold   = 20;
extern int     NumberOfBars = 500;
extern string  Note = "0 means Display all bars";
extern int     MAPeriod = 100;
extern int     LookBack = 20;
extern bool Alert=True;
double red[],lime[];
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
      SetIndexBuffer(0,red);
      SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3);
      SetIndexArrow (0,234);
      SetIndexLabel(0,"Climax High ");
      SetIndexBuffer(1,lime);
      SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3);
      SetIndexArrow (1,233);
      SetIndexLabel(1,"Climax Low ");
      SetIndexEmptyValue(0,0.0);
      SetIndexEmptyValue(1,0.0);
      SetIndexDrawBegin(0,0);
      SetIndexDrawBegin(1,0);
      IndicatorShortName("MKSP_Volume" );
   return(0);
  }
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
int start()
{
   double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3,tempv2,tempv3,tempv;
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   if ( NumberOfBars == 0 ) NumberOfBars = Bars-counted_bars;
   limit=NumberOfBars; //Bars-counted_bars;

   for(int i=0; i<limit; i++)  
      {
         red[i] = 0; lime[i] = 0;
         Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0;
         VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)];
         if (Volume[i] == VolLowest)
            {
                           }

         Range = (High[i]-Low[i]);
         Value2 = Volume[i]*Range;

         if (  Range != 0 ) Value3 = Volume[i]/Range;

         for ( int n=i;n<i+MAPeriod;n++ )
            {
               tempv= Volume[n] + tempv;
            }

          for( int n=i;n<i+LookBack;n++)
            {
               tempv2 = Volume[n]*((High[n]-Low[n]));
               if ( tempv2 >= HiValue2 )
                  HiValue2 = tempv2;

               if ( Volume[n]*((High[n]-Low[n])) != 0 )
                  {          
                     tempv3 = Volume[n] / ((High[n]-Low[n]));
                     if ( tempv3 > HiValue3 )  HiValue3 = tempv3;
                     if ( tempv3 < LoValue3 ) LoValue3 = tempv3;
                  }
            }
          if ( Value2 == HiValue2  && Close[i] > (High[i] + Low[i]) / 2 )
            {
               red[i] = High[i]+10*Point;

if(i==0) Alert("Вроде бы красная стрелка"); 

            }  

          if ( Value3 == HiValue3 )
            {
               NormalizeDouble(Volume[i],0);                
               red[i]=0;
            }
          if ( Value2 == HiValue2 && Value3 == HiValue3 )
            {
               NormalizeDouble(Volume[i],0);
               red[i]=0;
            }
         if ( Value2 == HiValue2  && Close[i] <= (High[i] + Low[i]) / 2 )
            {
               lime[i] = Low[i]-10*Point;

if(i==0) Alert("Вроде бы зеленая стрелка");  

              }
      }
   return(0);
  }

No pongas el código en texto plano, utiliza un diseño especial para ello.

Realmente no lo entendí,

Por regla general, se emite una alerta si hay una señal en la última barra (cero)

Cada segundo se dispara una alerta