新人对MQL4和MQL5的任何问题,对算法和代码的帮助和讨论 - 页 446

 
Artyom Trishkin:

我还是不明白:你想找到并显示什么?简单地用文字表达 - 没有代码。

所以你在写。

问题是:你为什么要在第十条上寻找它?


在第十条上,我把它作为一个例子。

我需要在被调用指标的箭头出现后的10个或 "N "个柱子后设置点。

如果我只需要将点放在第10条上,我会这样做的

 if(NormalizeDouble(iCustom(NULL,0,"Arrow v.3",1,i+10),Digits)!=EMPTY_VALUE
        {
         BufferDN[i+1]=high[i+1]+distance*MyPoint;

        }

阿尔乔姆-特里什金

并附上整个指标,而不是OnCalculate()。

这是第一个选项

#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots   2
//--- plot UP
#property indicator_label1  "UP"
#property indicator_type1   DRAW_ARROW
#property indicator_color1  clrLawnGreen
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- plot DN
#property indicator_label2  "DN"
#property indicator_type2   DRAW_ARROW
#property indicator_color2  clrDeepPink
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1

//--- indicator buffers
double         BufferUP[];
double         BufferDN[];

int distance=5;
double MyPoint;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,BufferUP);
   SetIndexBuffer(1,BufferDN);
//--- setting a code from the Wingdings charset as the property of PLOT_ARROW
   SetIndexArrow(0,233);
   SetIndexArrow(1,234);

//---
   if(Digits()==5 || Digits()==3){MyPoint=Point*10;} else{MyPoint=Point;}
  
   return(INIT_SUCCEEDED);
  }
   // int ila;
int    vspread,num_buy=0,num_sell=0;
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   if(rates_total<2) return(0);
   int limit=rates_total-prev_calculated;
   if(limit>1) 
     {
      limit=rates_total-2;
      ArrayInitialize(BufferUP,EMPTY_VALUE);
      ArrayInitialize(BufferDN,EMPTY_VALUE);
     }
   for(int i=limit; i>=0; i--) 
     {
     for(int il=i+1;il<=i+300;il++)
        {
         if(NormalizeDouble(iCustom(NULL,0,"Arrow v.3",0,il),Digits)!=EMPTY_VALUE
            )
           {
            num_buy=il;
            //Print()
           // break;
           }
        }
//
      if(num_buy==60)
        {
         BufferUP[i+1]=low[i+1]-distance*MyPoint;
         
        }
    
     for(int ila=i+1;ila<=i+300;ila++)
        {
         if(NormalizeDouble(iCustom(NULL,0,"Arrow v.3",1,ila),Digits)!=EMPTY_VALUE
            )
           {
            num_sell=ila;
           // break;
           }
        }
      if(num_sell==10)
        {
         BufferDN[i+1]=high[i+1]+distance*MyPoint;

        }
     
      Comment(num_buy,"num_sell",num_sell);
     }
//--- return value of prev_calculated for next call

   return(rates_total);
  }
//
.
 

在全球范围内,我想将第一根柱子的低点与被称为指标(第一个缓冲区)的第一个箭头后面的"n"上分形进行比较。

并找出第一个条形和找到的分形的条形之间的最大价格

条件如下:如果第一个条形的低点(+-10点)等于指标箭头后面的分形的价格(让它成为第一个),并且分形条和第一个条形之间的最高价格减去发现的分形的价格大于50点,那么就把箭头。

实际上,为了找到分形,我需要箭头所在的柱子的编号。我想从这个酒吧开始看一下分形,并进一步深入到历史。

也许我的出发点是错误的,你可以给我另一个解决方案。

 
mila.com:

在全球范围内,我想将第一根柱子的低点与被称为指标(第一个缓冲区)的第一个箭头后面的"n"上分形进行比较。

并找出第一个条形和找到的分形的条形之间的最大价格

条件如下:如果第一个条形的低点(+-10点)等于指标箭头后面的分形的价格(让它成为第一个),并且分形条和第一个条形之间的最大价格减去发现的分形的价格大于50点,那么就把箭头。

实际上,为了找到分形,我需要箭头所在的柱子的编号。我想从这根柱子开始看分形,然后再回到历史。

也许我的出发点是错误的,你可以提出另一种解决方法。

这个人应该简单地把点放在你在设置中设定的条形距离上的历史上。

也就是说,如果你设置了10个柱子,那么万一有一个来自周期指数左边的10个柱子的自定义指标信号,它将在周期的当前柱子(指数i)上设置一个点

//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2012, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots   2
//--- plot UP
#property indicator_label1  "UP"
#property indicator_type1   DRAW_ARROW
#property indicator_color1  clrLawnGreen
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- plot DN
#property indicator_label2  "DN"
#property indicator_type2   DRAW_ARROW
#property indicator_color2  clrDeepPink
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1
//--- input parameters
input uint     InpNumberOfBars   =  10;   // Количество баров отступа
input int      InpDistance       =  5;    // Отступ в пунктах
//--- indicator buffers
double         BufferUP[];
double         BufferDN[];
//---
int            num_bars;
double         distance;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,BufferUP);
   SetIndexBuffer(1,BufferDN);
//--- setting a code from the Wingdings charset as the property of PLOT_ARROW
   SetIndexArrow(0,233);
   SetIndexArrow(1,234);
//--- setting variables
   num_bars=(int)InpNumberOfBars+1;
   distance=InpDistance*Point();
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   if(rates_total<num_bars) return(0);
   int limit=rates_total-prev_calculated;
   if(limit>1)
     {
      limit=rates_total-num_bars-1;
      ArrayInitialize(BufferUP,EMPTY_VALUE);
      ArrayInitialize(BufferDN,EMPTY_VALUE);
     }
   for(int i=limit; i>=0; i--)   // 1000 - 11 - 1 = 999-11 = 988
     {
      double val_0=iCustom(NULL,0,"Arrow v.3",0,i+num_bars);   // rates_total=1000, i=988, val from 988+11=999
      double val_1=iCustom(NULL,0,"Arrow v.3",1,i+num_bars);   // rates_total=1000, i=988, val from 988+11=999
      if(val_0>0 && val_0<EMPTY_VALUE)
         BufferDN[i]=low[i]-distance;  // BufferDN[988]=val
      if(val_1>0 && val_1<EMPTY_VALUE)
         BufferUP[i]=high[i]+distance;
     }
//--- return value of prev_calculated for next call

   return(rates_total);
  }
//+------------------------------------------------------------------+
然而,"必须 "并不意味着我必须这样做。我在睡觉时呆呆地在膝盖上画了它。我不能检查它,我没有一个定制的。你知道...
 
问候。真的需要一些帮助。有谁知道有什么脚本或方法可以在交易历史 中突出显示交易,然后在历史中保存这些选择,例如:https://yadi.sk/d/7aHIs_vh3RxLvW 或这里。
https://yadi.sk/i/Ft8yNn1e3RxMEH - 预先感谢你
附加的文件:
2.jpg  481 kb
3.jpg  708 kb
 
civic111:
问候。真的需要一些帮助。有谁知道有什么脚本或方法可以在交易历史 中突出显示交易,然后让这些选择保存在历史中,就像https://yadi.sk/d/7aHIs_vh3RxLvW 或这里。
https://yadi.sk/i/Ft8yNn1e3RxMEH - 预先感谢

这是否是一种方式


把照片放进去?

 
civic111:
问候。真的需要一些帮助。也许有人知道一些脚本或方法,我如何能在交易历史 中选择一些交易,然后这些选择将被保存在历史中,例如:https://yadi.sk/d/7aHIs_vh3RxLvW 或这里。
https://yadi.sk/i/Ft8yNn1e3RxMEH - 预先感谢

在标准面板中--不可能。

但CodeBase或(也许)Market应该有处理订单历史的工具。或者,作为一种选择,你可以自己做,或者要求一个自由职业者 "与21点和开发人员的替代订单历史面板":-)

或者很简单,导出到CSV,然后用Excel来分析其中的历史。

 

请关闭工作

我需要免费插槽

 
开发商Hooshang Nosratpanah 已确认步骤 "工作接受"
 
اهمو مشكلة
يعني ممكن صفقة شرا لم تحق هدفها فلذلك مكن تعزيزها بصفقة اخرى شراء اذاا اعطى الاكسبيرت اشارة بذلك
 
انا اعتقد ان كل مسافه معينه افضل
لان ممكن نفتح شرا و السعر ينزل ويجيب اشاره بيع
وريضل علي البيع كتير وينزلجامد واتحين كل دا صفق واحده بس شرا ومنتظرين اشاره شرا تانيه عشان ندخل بلوت اكبر
原因: