Questions des débutants MQL4 MT4 MetaTrader 4 - page 12

 

Veuillez indiquer qui sait comment faire le lien avec l'heure du système de l'ordinateur dans le terminal MT4 :

- graphiques

- commandes en cours

- historique des transactions

- journaux

- journaux

Le problème est que le temps n'est pas synchronisé.

Quel pourrait être le problème ?

 

Bonjour !

J'ai pris l'un desindicateurs de volume comme base, je l'ai remodelé pour qu'il corresponde à mes paramètres, je n'ai laissé que ce qui était nécessaire, maintenant il ne montre que les flèches nécessaires.

Je n'arrive pas à attacher l'ALERTE de sorte que lorsque la flèche verte ou rouge s'allume, le message s'affiche.

Aidez-moi !

Z.U. a regardé différents tutoriels sur la façon de faire quelque chose qui ne fonctionne pas.

 
Refresh052:

Bonjour !

J'ai pris l'un desindicateurs de volume comme base, je l'ai remodelé pour qu'il corresponde à mes paramètres, je n'ai laissé que ce qui était nécessaire, maintenant il ne montre que les flèches nécessaires.

Je n'arrive pas à attacher l'ALERTE de sorte que lorsque la flèche verte ou rouge s'allume, le message s'affiche.

Aidez-moi !

Z.U. a regardé différents tutoriels sur la façon de faire quelque chose qui ne fonctionne pas.

Allez, mettez tout le code de l'indicateur ici.
 
Stanislav Aksenov:
Allez-y, mettez tout le code de l'indicateur ici

#propriété stricte

#property indicator_chart_window


#property indicator_minimum 0

#property indicator_buffers 2

#property indicator_color1 Red

#propriété indicateur_color2 Lime




#propriété indicator_width1 4

#propriété 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 signifie Afficher toutes les barres" ;

extern int MAPeriod = 100 ;

extern int LookBack = 20 ;

extern bool Alert=True ;

double red[],lime[] ;

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

//| Fonction d'initialisation de l'indicateur personnalisé |

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

int init()

{

//---- indicateurs

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

IndicateurShortName("MKSP_Volume" ) ;


//----

retour(0) ;

}

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

//| Fonction de désinitialisation de l'indicateur personnalisé |

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

int deinit()

{

//----

//----

retour(0) ;

}

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

//| Fonction d'itération de l'indicateur personnalisé |

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

int start()

{


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

int limite ;

int counted_bars=IndicatorCounted() ;

//---- dernière barre comptée sera recomptée

si(counted_bars>0) counted_bars-- ;

si ( NumberOfBars == 0 )

NumberOfBars = Bars-counted_bars ;

limit=NumberOfBars ; //Bars-counted_bars ;

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

{

rouge[i] = 0 ; chaux[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)] ;

si (Volume[i] == VolLowest)

{

}

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

Valeur2 = Volume[i]*Range ;

si ( Range != 0 )

Valeur3 = 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])) ;

si ( tempv2 >= HiValue2 )

HiValue2 = tempv2 ;

si ( Volume[n]*((High[n]-Low[n])) != 0 )

{

tempv3 = Volume[n] / ((High[n]-Low[n]) ;

si ( tempv3 > HiValue3 )

HiValue3 = tempv3 ;

si ( tempv3 < LoValue3 )

LoValue3 = tempv3 ;

}

}

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

{

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

}

si ( Value3 == HiValue3 )

{

NormaliserDouble(Volume[i],0) ;

rouge[i]=0 ;

}

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

{

NormaliserDouble(Volume[i],0) ;

rouge[i]=0 ;

}

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

{

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

}

}

//----

//----

retour(0) ;

}

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

Et une capture d'écran

Dossiers :
 
Stanislav Aksenov:
Allez, mettez tout le code de l'indicateur ici.
Je ne comprends pas où mettre Alerte
 
Refresh052:


Et une capture d'écran

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

              }
chaque bougie signale plus précisément chaque seconde
 

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

Ne mettez pas le code en texte brut, utilisez une mise en page spéciale pour celui-ci.

Je ne l'ai pas vraiment compris,

En règle générale, une alerte est émise s'il y a un signal sur la dernière barre (zéro).

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

Ne mettez pas le code en texte brut dans vos messages, utilisez la mise en page du code.

Je ne l'ai pas vraiment compris,

En règle générale, une alerte est émise s'il y a un signal sur la dernière barre, je pense l'avoir mis aux bons endroits...

Ok merci, je vais essayer, également une leçon séparée))))
 
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);
  }

Ne mettez pas le code en texte brut, utilisez une mise en page spéciale pour celui-ci.

Je ne l'ai pas vraiment compris,

En règle générale, une alerte est émise s'il y a un signal sur la dernière barre (zéro).

Chaque seconde, une alerte se déclenche
Raison: