Errors, bugs, questions - page 533

 

there is such a lamer question.

When doing ArrayResize array of objects (pointers), CheckPointer does not return ==POINTER_INVALID and !=POINTER_DYNAMC.
That is, an array of pointers of the normal type.

is this a bug ?

it helps if all new elements=NULL, but new created pointers must return POINTER_INVALID at least
I think it's a bug. Pointers are initially blank... (although not explicitly set to NULL by ArrayResize)

 
marketeer:
Another related question: sell positions are shown on the chart with blue lines and buy with red lines. In MT4 it was the other way round. What is the idea?
The error has been fixed. The correction will be available in the next build.
 
Rosh:
I can't see the whole story. Perhaps the size of the position opened for sale was much larger than what was then bought. So after the buy operation the position was still short. It is hard to guess from the screenshot in this case how things were.
You can see it yourself - it is Championship 800170. The position was opened immediately and closed completely at once. All the more it should be red if more was sold than bought.
 

Speaking of fractals... https://www.mql5.com/ru/code/30.

According to the definition, "An upward fractal is a series of at least five consecutive bars with two bars of lower highs in front of and behind the highest high." Do I understand correctly that the -2nd and +2nd highs don't have to be even lower than the -1st and +1st respectively? That is, the main thing is that the -2nd, -1st, +1st, +2nd highs are strictly below the 0th (the highest, middle one), but between each other the two left highs, as well as the two right highs, can have an arbitrary relative height? This is the first question.

Second question: even if the answer to the first question is that the extreme side fractals do not need to line up below the penultimate one, describing in aggregate a strict pyramid of 5 consecutive bars, then in any case at least 5 consecutive bars should be considered to form a fractal. Then how do you explain this?

is it fractals too?!

But if there is a reasonable explanation for this too, then there is a third question for an appetizer: can a fractal be up and down on one bar at once?

both fractals on the same bar

At first sight, all conditions seem to be fulfilled, it is just a rare coincidence. However, does it not contradict not the technical definition, but common sense or some hidden and fundamentally important logic?

Fractals
Fractals
  • votes: 8
  • 2010.01.26
  • MetaQuotes Software Corp.
  • www.mql5.com
Фракталы (Fractals) — это один из пяти индикаторов торговой системы Билла Вильямса, позволяющий обнаруживать дно или вершину.
 

x100intraday:

doesn't it contradict not the technical definition, but common sense or some hidden logic?

so it's thechanalysis. it's all that, contradictory.
 
sergeev:
it's thechanalysis. it's all so contradictory.

Then let's rephrase the question: does Bill Williams mean the same thing in his description of the five-part torus system? Because he's talking about Thomas, but the programmers who implemented this indicator are talking about Eureka... We won't bother Bill, that's why we will address the question to those who are familiar with his theoretical works.

Besides, this indicator is a classical one, that's why contradictoriness is not in the first place.

 

In general, if you dig into the rather simple code of the fractal indicator, it is symmetrical about the middle (the fractal itself) as for High:

         if(High[i]>High[i+1] && High[i]>High[i+2] && High[i]>=High[i-1] && High[i]>=High[i-2])
as well as for Low. And, at first glance, the areas highlighted with red rectangles shouldn't seem to arise...

Suspect >/>=.

 

Good afternoon.

Interesting point: in mql4 the variable at the end of { int var; } block is not destroyed, hence the question if it is correct to declare the variable in a loop ???

Example:

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

{

int var; // what happens to the variable during iteration?

}

Apologies for being a bit out of the way, but I don't know where else there is a dialog with developers.

Thanks.

 
220Volt:

Good afternoon.

Interesting point: in mql4 the variable at the end of { int var; } block is not destroyed, hence the question if it is correct to declare the variable in a loop ???

Example:

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

{

int var; // what happens to the variable during iteration?

}

Apologies for being a bit out of the way, but I don't know where else there is a dialog with developers.

Thank you.

At each loop integration in this case the variable will be reset. This depends on the task. If you are organizing any counter, the variable must be declared outside the loop

int var=0;

for(int i = 0; i < 500; i ++)
{
 var++;
}
 
sergey1294:

The variable will be reset to zero at each loop integration. This depends on the task. If any counter is being organized, the variable must be declared outside the loop

it will not

Справочник MQL5 / Основы языка / Переменные / Инициализация переменных      
  

Инициализация переменных

Любая переменная при определении может быть инициализирована. Если не произведена явная инициализация переменной, то значение, 
хранящееся в данной переменной может быть каким угодно. Неявная инициализация не производится.
Reason: