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

 
Artyom Trishkin:
Where exactly are you running the indicator from in the terminal?
If you mean mine, thenC:\Users\AppData\Roaming\MetaQuotes\Terminal\CE01488447B8E5332C971089AB90, if you mean BB, I honestly do not know where it runs from, but I used to print the problem (I found out if the BB itself gives more than 4 digits) and I also took BB from this folder.
 
Павел Козлов:
I kind of went into the code to look at this stuff.

I don't know about everyone, but I have two places where indices and experts are located, it is C:\Program Files (x86)\ MT4\MQL4\indicators and C:\Users\AppData\Roaming\MetaQuotes\Terminal\CE01488447B8E5332C971089AB90 (this folder opens from terminal File-Open data directory) in both places I looked for code and it is identical.I may have missed the point again, can you clarify it for someone who doesn't know. What is the difference between custom and standard and where to find both?

The standard one is called BollingerBands and the customized one is Bands and located in different places.


 
Artyom Trishkin:
Where exactly do you run the indicator from in the terminal?

I doubt it is familiar with /portable mode

 
Alexey Viktorov:

The standard one is called BollingerBands and the custom one is called Bands and is located in different places.


Thank you. I cannot explain to His Majesty from my mobile phone where and what is located.
That's why I was trying to say that it launches one thing, but the code looks at another.
 
Alexey Viktorov:

I doubt he is familiar with /portable mode

I'm really not familiar with this mode and in my thread which I created separately on this problem I revealed my level of knowledge, please forgive the stupidity still, but it was not as easy as you might have thought for me. Still you showed me the problem, now I will try to figure out how to solve it. Thank you for your advice and Artem's advice.
 
Павел Козлов:
I'm really not familiar with this mode and in my thread which I created separately on this problem I revealed my level of knowledge, please forgive the stupidity still, but it wasn't as easy as you might have thought for me. Still you showed me the problem, now I will try to figure out how to solve it. Thank you for your advice and Artem's advice.

I didn't mean in any way to catch you off guard with ignorance. It was a dialogue with Artem, a simple clarification that he is asking about what you don't know, from my point of view. Not knowing is not shameful and quite normal.

 
What am I doing wrong now, mastered the iCustom function. Made the code (took the top line as an example). But it still gives out 4 characters. DoubleToString outputs 5, but bullshit, not real data.
double BUp = iCustom(NULL,0, "Bands",20,0,2,1,1);
Please help, help in code. Not in the printer, just write data from Bands.ex4 indicator to my indicator variable, for example the upper line. Preferably using numeric values, not replacing them with variables.
 
Павел Козлов:
Well what am I doing wrong now, mastered the iCustom function. Made the code (took the top line as an example). But it still gives out 4 characters. DoubleToString gives out 5, but it's bullshit, not real data. Not in the printer, just write the data from the Bands.ex4 indicator into the variable in my indicator, for example the upper line. It is desirable to use numeric values and not replace them with variables.

The code is placed in OnInit(), because OnTick() will not work today.


Hmmm: I didn't read it carefully. Didn't notice that phrase.

It is desirable to use numeric values and not replace them with variables.


But it doesn't depend on whether you put a number or a variable in the iCustom.

Files:
 
Павел Козлов:
What am I doing wrong now, mastered the iCustom function. Made the code (took the top line as an example). But it still gives out 4 characters. DoubleToString gives out 5, but it's bullshit, not real data. Not in the printer, just write the data from the Bands.ex4 indicator into the variable in my indicator, for example the upper line. Preferably use numeric values and not replace them with variables.
You are checking incorrectly. iCustom, iBands do not round the return value.
   double   BUp = iCustom(NULL,0,"Bands",20,0,2.0,1,1);
   Print(DoubleToString(BUp,16));
 

Help me figure out why the indicator isn't rendering. I want to eventually create something like ZigZag.

//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2012, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
#property link      ""
#property version   "1.00"
#property strict
#property indicator_chart_window
//--------------------------------
#property indicator_buffers 1       // Количество буферов
#property indicator_color1 Blue     // Цвет линии 0 буфера
double Buf_0[];
double Max_B=0,
Min_B=10000;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexBuffer(0,Buf_0);                  //Назначение массива буфера
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1); //стильлинии
   return(0);
  }
//------------------------------
int start()
  {
   int i;
   int n,
   step=10;
   int Counted_bars;
   double Max_A,
   Min_A;
   Counted_bars=IndicatorCounted();
   i=Bars-Counted_bars-1;
//--------------------------------------------------------------------------------------------------------------+
   while(i>=0) //цикл, который считает просчитывает значение на i-ом баре               
     {
      Max_A=High[i];                         //присвоили максимальное значение i-ого бара переменной Max_A            
      Min_A=Low[i];                          //присвоили минимальное значение i-ого бара переменной Min_A
      if(Max_A>Max_B)
         Max_B=Max_A;
      if(Min_A<Min_B)
         Min_B=Min_A;
      //------------------------------------------------------------------------------------------------------------- 
      if(i>=step)
        {
         for(n=0;n<step;n++) //цикл, который будет сравнивать значения баров на определённом интервале        
           {
            if(High[i+n]>Max_A)
              {
               Max_A=High[i+n];
              }
            else
              {
               if(High[i+n]<Min_A)
                  Min_A=High[i+n];
              }
           }
        }
      if(i<step)
        {
         for(n=step;n>0;n--) //цикл, который будет сравнивать значения баров на определённом интервале        
           {
            if(High[i-n]>Max_A)
              {
               Max_A=High[i-n];
              }
            else
              {
               if(High[i-n]<Min_A)
                  Min_A=High[i-n];
              }
           }
        }
      if(Max_A>Max_B)
        {
         Buf_0[i]=Max_A;
        }
      else
        {
         if(Min_A<Min_B)
            Buf_0[i]=Min_A;
        }
      i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+
Reason: