初学者的问题 MQL4 MT4 MetaTrader 4 - 页 12

 

请告知谁知道如何在MT4终端中链接到计算机的 系统时间

- 图表

- 公开订单

-交易历史

- 原木

- 原木

问题是,时间并不同步。

可能是什么问题?

 

下午好!

我以其中一个成交量指标 为基础,根据我的参数重新制作,只留下需要的部分,现在它只显示需要的箭头。

我不能让它附加警报,以便当绿色或红色箭头亮起时,信息会弹出。

请帮助我们!

Z.U.看了不同的教程,怎么做都不行。

 
Refresh052:

下午好!

我以其中一个成交量指标 为基础,根据我的参数重新制作,只留下需要的部分,现在它只显示需要的箭头。

我不能让它附加警报,以便当绿色或红色箭头亮起时,信息会弹出。

请帮助我们!

Z.U.看了不同的教程,怎么做都不行。

来吧,把指标的所有代码放在这里
 
Stanislav Aksenov:
继续,把指标的所有代码放在这里

#属性严格

#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


外部ENUM_APPLIED_PRICE price = PRICE_CLOSE;

外部双倍超买=80。

外来的双数Oversold = 20。

外置 int NumberOfBars = 500;

外部字符串Note = "0表示显示所有条形"。

外来的int MAPeriod = 100。

外置 int LookBack = 20;

外部的bool Alert=True。

double red[],lime[];

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

//|自定义指标初始化功能

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

int init()

{

//---- 指标

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

int限制。

int counted_bars=IndicatorCounted()。

//----,最后计数的条形图将被重新计算。

如果(counted_bars>0) counted_bars--。

如果 ( 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) ] 。

如果(Volume[i] == VolLowest)

{

}

范围=(High[i]-Low[i])。

Value2 = Volume[i]*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]))。

如果 ( tempv2 >= HiValue2 )

HiValue2 = tempv2;

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

{

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

如果 ( tempv3 > HiValue3 )

HiValue3 = tempv3;

如果 ( tempv3 < LoValue3 )

LoValue3 = tempv3;

}

}

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

{

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

}

如果 ( Value3 == HiValue3 )

{

NormalizeDouble(Volume[i],0)。

red[i]=0。

}

如果 ( Value2 == HiValue2 && Value3 == HiValue3 )

{

NormalizeDouble(Volume[i],0)。

red[i]=0。

}

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

{

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

}

}

//----

//----

return(0);

}

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

还有一张截图

附加的文件:
 
Stanislav Aksenov:
来吧,把指标的所有代码放在这里。
我不知道该把 "警报 "放在哪里
 
Refresh052:


还有一张截图

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

              }
每根蜡烛的信号更精确的是每一秒钟
 

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

不要把代码放在纯文本中,要用特殊的布局来处理。

我没有真正理解它。

通常情况下,如果在最后一格(零)有信号,就会发出警报。

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

不要把代码放在 你的信息中的纯文本中,使用代码布局。

我还没有真正搞清楚。

按照惯例,如果在最后一栏有信号,就会发出警报,我想我把它放在了正确的地方......

好的,谢谢,我会尝试,也是一个单独的课程))))。
 
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);
  }

不要把代码放在纯文本中,要用特殊的布局来处理。

我没有真正理解它。

通常情况下,如果在最后一格(零)有信号,就会发出警报。

每一秒钟都有警报响起