Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 446

 
Artyom Trishkin:

I still don't understand: what do you want to find and display? Simply in words - without code.

So you are writing:

The question is: Why are you looking for it on the tenth bar?


On the tenth bar, I took it as an example.

I need to set points after 10 or "N" bars after the arrow of the called indicator appears.

as if I only needed to place the points on the tenth bar, I would do it this way

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

        }

Artyom Trishkin:

And attach the entire indicator, not OnCalculate()

This is the first option

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

Globally, I want to compare the low of the first bar with the "n" upper fractal behind the first arrow of the called indicator (first buffer).

And find out the maximal price between the first bar and the bar of the found fractal.

The condition is as follows: if the low (+-10 points) of the first bar is equal to the price (let it be the first) of the fractal behind the indicator arrow and the maximum price between the fractal bar and the first bar minus the price of the fractal found is greater than 50 points, then put the arrow.

Actually, in order to find the fractal, I need the number of the bar where the arrow is. I want to look through the fractals starting from this bar and go further into history.

Maybe I started from the wrong place and you can give me another solution.

 
mila.com:

Globally, I want to compare the low of the first bar with the "n" upper fractal behind the first arrow of the called indicator (first buffer).

And find out the maximal price between the first bar and the bar of the found fractal.

The condition is as follows: if the low (+-10 points) of the first bar is equal to the price (let it be the first) of the fractal behind the indicator arrow and the maximum price between the fractal bar and the first bar minus the price of the fractal found is greater than 50 points, then put the arrow.

Actually, in order to find the fractal, I need the number of the bar where the arrow is. I want to look through the fractals starting from this bar and then back to the history.

Maybe I started from the wrong place and you can suggest another way of solving it.

This one should simply put points through the history on the distance in bars which you set in the settings.

I.e., if you set 10 bars, then in case there is a signal from the custom indicator to the left of the cycle index for 10 bars, it will set a point on the current bar (index i) of the cycle

//+------------------------------------------------------------------+
//|                                                      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);
  }
//+------------------------------------------------------------------+
However, "must" doesn't mean I have to. I dumbly drew it on my knees while I was sleeping. I can't check it, I don't have a custom one. You know...
 
Greetings. Really need some help. Does anyone know any script or method to highlight trades in the deal history and then save these selections in the history, for example: https://yadi.sk/d/7aHIs_vh3RxLvW or here:
https://yadi.sk/i/Ft8yNn1e3RxMEH - thank you in advance
Files:
2.jpg  481 kb
3.jpg  708 kb
 
civic111:
Greetings. Really need some help. Does anyone know any script or method to highlight trades in the deal history and then have these selections saved in the history, like https://yadi.sk/d/7aHIs_vh3RxLvW or here:
https://yadi.sk/i/Ft8yNn1e3RxMEH - thanks in advance

Is this the way


to put the pictures in?

 
civic111:
Greetings. Really need some help. Maybe someone knows some script or method, how can I select some deals in the deal history and then these selections will be saved in the history, for example: https://yadi.sk/d/7aHIs_vh3RxLvW or here:
https://yadi.sk/i/Ft8yNn1e3RxMEH - thanks in advance

In the standard panel - no way.

But CodeBase or (maybe) Market should have tools for working with order history. Or, as an alternative, you can do it yourself or request a freelance "alternative order history panel with blackjack and devs" :-)

Or quite simply, export to CSV and then use Excel to analyze the history in it.

 

please close job

I need free slot

 
Developer Hooshang Nosratpanah has confirmed step "Work Acceptance"
 
اه مو مشكلة
يعني ممكن صفقة شرا لم تحق هدفها فلذلك مكن تعزيزها بصفقة اخرى شراء اذاا اعطى الاكسبيرت اشارة بذلك
 
انا اعتقد ان كل مسافه معينه افضل
لان ممكن نفتح شرا و السعر ينزل ويجيب اشاره بيع
ويفضل علي البيع كتير وينزلجامد واتحين كل دا صفق واحده بس شرا ومنتظرين اشاره شرا تانيه عشان ندخل بلوت اكبر