Domande dai principianti MQL4 MT4 MetaTrader 4 - pagina 12

 

Si prega di consigliare chi sa come collegare l'ora di sistema del computer nel terminale MT4:

- Carte di lavoro

- ordini aperti

- storia dell'affare

- ceppi

- ceppi

Il fatto è che il tempo non è sincronizzato.

Quale potrebbe essere il problema?

 

Buon pomeriggio!

Ho preso uno degliindicatori di volume come base, l'ho rifatto per adattarlo ai miei parametri, lasciando solo ciò che è necessario, ora mostra solo le frecce che sono necessarie.

Non riesco a fargli attaccare l'ALERT in modo che quando la freccia verde o rossa si accende, il messaggio appare.

Per favore, aiutatemi!

Z.U. Guardato diversi tutorial come fare qualcosa non funziona.

 
Refresh052:

Buon pomeriggio!

Ho preso uno degliindicatori di volume come base, l'ho rifatto per adattarlo ai miei parametri, lasciando solo ciò che è necessario, ora mostra solo le frecce che sono necessarie.

Non riesco a fargli attaccare l'ALERT in modo che quando la freccia verde o rossa si accende, il messaggio appare.

Per favore, aiutatemi!

Z.U. Guardato diversi tutorial come fare qualcosa non funziona.

Dai, metti tutto il codice dell'indicatore qui
 
Stanislav Aksenov:
Vai avanti, metti tutto il codice dell'indicatore qui

#proprietà rigorosa

#proprietà indicator_chart_window


#proprietà indicatore_minimo 0

#proprietà indicator_buffers 2

#property indicator_color1 Red

#proprietà indicator_color2 Lime




#proprietà indicator_width1 4

#proprietà indicator_width2 4


extern ENUM_APPLIED_PRICE prezzo = PRICE_CLOSE;

extern double Overbought = 80;

extern double Oversold = 20;

extern int NumberOfBars = 500;

extern string Note = "0 significa Visualizza tutte le barre";

extern int MAPeriod = 100;

extern int LookBack = 20;

extern bool Alert=True;

doppio rosso[],lime[];

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

//| funzione di inizializzazione dell'indicatore personalizzato

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

int init()

{

//---- indicatori

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);

IndicatoreNomeCorto("MKSP_Volume" );


//----

ritorno(0);

}

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

//| funzione di deinizializzazione dell'indicatore personalizzata

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

int deinit()

{

//----

//----

ritorno(0);

}

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

//| funzione di iterazione dell'indicatore personalizzata

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

int start()

{


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

limite int;

int counted_bars=IndicatorCounted();

//---- ultima barra contata sarà ricontata

if(counted_bars>0) counted_bars--;

se ( 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)];

se (Volume[i] == VolLowest)

{

}

Range = (High[i]-Low[i]);

Value2 = Volume[i]*Range;

se ( 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]*((Alto[n]-Basso[n]));

se ( tempv2 >= HiValue2 )

HiValue2 = tempv2;

se ( Volume[n]*((Alto[n]-Basso[n])) != 0 )

{

tempv3 = Volume[n] / ((Alto[n]-Basso[n]);

se ( tempv3 > HiValue3 )

HiValue3 = tempv3;

se ( tempv3 < LoValue3 )

LoValue3 = tempv3;

}

}

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

{

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

}

se ( Valore3 == HiValue3 )

{

NormalizeDouble(Volume[i],0);

rosso[i]=0;

}

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

{

NormalizeDouble(Volume[i],0);

rosso[i]=0;

}

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

{

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

}

}

//----

//----

ritorno(0);

}

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

E uno screenshot

File:
 
Stanislav Aksenov:
Dai, metti tutto il codice dell'indicatore qui.
Non capisco dove mettere Alert
 
Refresh052:


E uno screenshot

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("===================");            

              }
ogni candela segnala più precisamente ogni secondo
 

#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);
  }

Non mettere il codice in testo semplice, usa un layout speciale per esso.

Non l'ho capito bene,

Di regola un allarme viene emesso se c'è un segnale sull'ultima barra (zero)

 
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);
  }

Non mettete il codice in chiaro nei vostri messaggi, usate il layout del codice.

Non l'ho davvero capito,

Di regola viene emesso un allarme se c'è un segnale sull'ultima barra, penso di averlo messo nei posti giusti...

Ok grazie, ci proverò, anche una lezione separata))))
 
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);
  }

Non mettere il codice in testo semplice, usa un layout speciale per esso.

Non l'ho capito bene,

Di regola un allarme viene emesso se c'è un segnale sull'ultima barra (zero)

Ogni secondo scatta un allarme
Motivazione: