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

 
Alexandr Sokolov:

***

Here I've just alerited, and just multiplying by EMPTY_VALUE results in inf

***

О! Very good example! Need to save ...

   double a=EMPTY_VALUE;
   Print("- - -");
   Print("EMPTY_VALUE / 2 = ",a/2.0);
   Print("EMPTY_VALUE * 2 = ",a*2.0);
   Print("EMPTY_VALUE - 2 = ",a-2.0);
   Print("EMPTY_VALUE + 2 = ",a+2.0);
   Print("EMPTY_VALUE = ",a);

and the result:

2019.11.02 07:50:48.131 INF (ATD.B.XTSE,H1)     - - -
2019.11.02 07:50:48.142 INF (ATD.B.XTSE,H1)     EMPTY_VALUE / 2 = 8.988465674311579 e+307
2019.11.02 07:50:48.142 INF (ATD.B.XTSE,H1)     EMPTY_VALUE * 2 = inf
2019.11.02 07:50:48.142 INF (ATD.B.XTSE,H1)     EMPTY_VALUE - 2 = 1.797693134862316 e+308
2019.11.02 07:50:48.142 INF (ATD.B.XTSE,H1)     EMPTY_VALUE + 2 = 1.797693134862316 e+308
2019.11.02 07:50:48.142 INF (ATD.B.XTSE,H1)     EMPTY_VALUE = 1.797693134862316 e+308
 

https://www.mql5.com/ru/docs/constants/namedconstants/otherconstants

EMPTY_VALUE  Пустое значение в индикаторном буфере DBL_MAX


inf is an overflow
 
werter:

Hilarious.

This is BuySellVolume. The total volume is not equal to the sum of Buy and Sell, but only slightly more.

You describe the problem in detail, remove unnecessary things from the code...

I don't want to dig into such shitty code, even if it's small...

 
Vladimir Pastushak:

You describe the problem in detail, remove unnecessary things from the code...

I don't want to dig through such shitty code, even if it's small...

Don't need any more, thanks, found the mistake.
 
LuckyTrader:

Array out of range

The error occurred after adding strict

The compiler tells you the line and the cursor position where the error will occur, if you don't learn how to use ME, there is no point in continuing to do this

 
LuckyTrader:
I have shown you the line:

it means that the variable i in the loop

for(int i=0; i<62; i++)

has become larger than array numberFibo[]

look for where you describe the array or change the size of this array

you can prefix the loop with

Print("Размер массива numberFibo = " , ArraySize(numberFibo));
 

How to make this message readable?

Alert("Тестовое \r\nсообщение №1");
Alert("Тестовое \r\nсообщение №2");


The point is that the last message in the alert window near the big bell can be read in full, but the previous ones only in the expert log (but then you need to focus your attention to sort them from each other)


What can be done to make it convenient for a regular user? Imagine what will happen if I, for example, show a symbol, timeframe, trade direction, open price, stop and profit?

 
LuckyTrader:

Array out of range

The error occurred after adding strict

This

   for(int i=0; i<62; i++)
     {
      numberFibo            [i]=0;
      numberPesavento       [i]=0;
      numberGartley         [i]=0;
      numberGilmorQuality   [i]=0;
      numberGilmorGeometric [i]=0;
      numberGilmorHarmonic  [i]=0;
      numberGilmorArithmetic[i]=0;
      numberGilmorGoldenMean[i]=0;
      numberSquare          [i]=0;
      numberCube            [i]=0;
      numberRectangle       [i]=0;
      numberExt             [i]=0;
     }

can be replaced by

ZeroMemory(numberFibo);
ZeroMemory(numberPesavento);
ZeroMemory(numberGartley);
ZeroMemory(numberGilmorQuality);
ZeroMemory(numberGilmorGeometric);
ZeroMemory(numberGilmorHarmonic);
ZeroMemory(numberGilmorArithmetic);
ZeroMemory(numberGilmorGoldenMean);
ZeroMemory(numberSquare);
ZeroMemory(numberCube);
ZeroMemory(numberRectangle);
ZeroMemory(numberExt);

And then, for some reason, I don't see the array resizing. Before filling, what size is the array assigned?

 
Alexandr Sokolov:

How to make this message readable?


The point is that the last message in the alert window near the big bell can be read in full, but the previous ones only in the expert log (but then you need to focus your attention to sort them from each other)


What can be done to make it convenient for a regular user? Imagine what will happen if I, for example, show a symbol, timeframe, trade direction, open price, stop and profit?

I would like the developers to make in the next update to display a message next to the large bell that the user clicked below in the alert window

 
LuckyTrader:

You had an error when you were working in a loop

Forum on trading, automated trading systems & strategy testing

Any questions from newbies on MQL4 and MQL5, help and discussion on algorithms and codes

LuckyTrader, 2019.11.04 09:08

String shown (compiler shows nothing, error appears in indicator when testing, found in log):

      numberFibo            [i]=0;

and you show a completely different example. There should be no error in that scribble on the previous page.
Reason: