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

 
ponochka:
Hello! In the settings of the terminal Service-Settings-Advisors you can add a link to the trusted area in WebRequest..... can you remove it from there? It's just that even after editing it still works and it is not deleted from the terminal in any way...

Have you tried to press the "Delete" key on the keyboard?

 
Alexey Viktorov:

Have you tried pressing the "Delete" key on the keyboard?

Tried.... doesn't work...tried all the different ways
 
ponochka:
Tried.... doesn't work...tried all the different ways

And even before you hit "Delete" was the line highlighted? And is "Allow WebRequest for the following URLs" checked?

It deletes without any problems for me.

 
Does debugging work in MQL4, if yes, where can I read about it, or maybe watch a video? It's very difficult to use the Print() function to search for an error in three pines (sometimes I can't even find an error in three pines).
 
Alexey Viktorov:

And even before hitting "Delete" was the line highlighted? And is "Allow WebRequest for the following URLs" checked?

I get deleted without any problems.

Haven't tried it today, but tried it about half a year ago, but never deleted it, ended up with 2 URLs hanging around.

 
Vitaly Muzichenko:

Haven't tried it today, but tried it about half a year ago, but never deleted it and ended up with 2 URLs hanging around.

Weird. Here's the whole sequence of adding and removing in pictures.


Files:
00.png  33 kb
01.png  34 kb
02.png  33 kb
03.png  33 kb
 

Greetings.

Why do you use Bid analysis for both buying and selling to trade or analyse indicators etc. and not Ask analysis for selling and Bid analysis for buying? Because the charts, although similar, but the differences can be critical for the profitability of the strategy. Even more, I would suggest that this is why there is a significant difference in the profitability of some strategies when testing and trading.

 

Hello. I'm reading a textbook. There are some examples of how to write indicators. I have a question concerning the separatewindow.mq4 indicator. You can set the number of calculated bars there. What if you need to specify the calculation from the opening price of the day (or from zero) to the closing price of the day? How should I do it? I tried to search for a solution, but did not find it.

//--------------------------------------------------------------------
// separatewindow.mq4 
// Предназначен для использования в качестве примера в учебнике MQL4.
//--------------------------------------------------------------------
#property indicator_separate_window // Отображение в отдельном окне
#property indicator_buffers 1       // Количество буферов
#property indicator_color1 Blue     // Цвет первой линии
#property indicator_color2 Red      // Цвет второй линии
 
extern int History  =50;            // Колич.баров в расчётной истории
extern int Aver_Bars=5;             // Количество баров для расчёта
 
double Buf_0[];                     // Объявление индикаторного массива
//--------------------------------------------------------------------
int init()                          // Специальная функция init()
  {
   SetIndexBuffer(0,Buf_0);         // Назначение массива буферу
   SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,2);// Стиль линии
   return;                          // Выход из спец. ф-ии init()
  }
//--------------------------------------------------------------------
int start()                         // Специальная функция start()
  {
   int i,                           // Индекс бара
   n,                               // Формальный параметр
   Counted_bars;                    // Количество просчитанных баров 
   double
   Sum_H,                           // Сумма значений High за период
   Sum_L;                           // Сумма значений Low  за период
//--------------------------------------------------------------------
   Counted_bars=IndicatorCounted(); // Количество просчитанных баров 
   i=Bars-Counted_bars-1;           // Индекс первого непосчитанного
   if (i>History-1)                 // Если много баров то ..
      i=History-1;                  // ..рассчитывать заданное колич.
   while(i>=0)                      // Цикл по непосчитанным барам
     {
      Sum_H=0;                      // Обнуление в начале цикла
      Sum_L=0;                      // Обнуление в начале цикла
      for(n=i;n<=i+Aver_Bars-1;n++) // Цикл суммирования значений 
        {
         Sum_H=Sum_H + High[n];     // Накопление суммы макс.значений
         Sum_L=Sum_L + Low[n];      // Накопление суммы мин. значений
        }
      Buf_0[i]=(Sum_H-Sum_L)/Aver_Bars;// Знач. 0 буфера на i-ом баре
      i--;                          // Расчёт индекса следующего бара
     }
//--------------------------------------------------------------------
   return;                          // Выход из спец. ф-ии start()
  }
//--------------------------------------------------------------------


 
prom18:

Hello. I'm reading a textbook. There are some examples of how to write indicators. I have a question concerning the separatewindow.mq4 indicator. You can set the number of calculated bars there. What if you need to specify the calculation from the opening price of the day (or from zero) to the closing price of the day? How should I do it? I tried to search for the solution, but did not find it.


I would calculate the candlesticks with the correct time. (I am a relative beginner myself)

 
Andrey Sokolov:

I would count the candles with the right timing. (I'm a relative beginner myself)

Maybe there are examples. Visually it would be easier to understand. Thank you.