[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 711

 
miha-28:

Hello gentlemen. Question, if there is a function or something to determine how previous positions closed with plus or minus???? If the topic has been raised drop the link. Thanks in advance....


https://www.mql5.com/ru/forum/107476/page21#79649

https://www.mql5.com/ru/forum/107476/page21#79908

 
There is a PeakUP[] array. We write values of extrema into it in the loop. If on the output after the loop, array size ==1 (i.e. if only one value is found), we do an additional loop to search for values and add the additional values found to the same array. I do the following:
BubleUP=TempIND[i-2];               // Возьмём значение "бугорка" - Это найденное дополнительное значение, которое нужно вписать в массив
                              
asize=ArraySize(PeakUP);           // Размер массива значений пичков... (именно он содержит только одно значение, а нужно минимум два)
ArrayResize(PeakUP, asize+1);       // ... увеличим его на 1
PeakUP[0]=BubleUP;                  // ... и впишем в него значение "бугорка"

In the output after all these manipulations in the printout we see:

PeakUP Size = 3 - it means that two additional values were found and the peaks array size increased to 3 - everything is correct here, next:
PeakUP[0] = 49,9119 - this is the value found when searching for additional values. here it should be; next:
PeakUP[1] = 0 - this should be the value of the first extrema found (about 82 pennies)
PeakUP[2] = 0 - this should be the value of a single extreme found (about 173 pennies)

Question - where did I loose two values? And in general - am I trying to put them in correctly? The code initially filling the PeakUP array with values of extrema works correctly,
the second part - repeated addition of additional values to the array - does not work.

Can you tell me what is wrong?

 
artmedia70:


Question - where did I lose two values? And in general - am I trying to put them in correctly? The code that initially fills the PeakUP array with extremum values works correctly,
the second part - repeated addition of additional values to the array - does not work.

Could you tell me what's wrong?



That's it, no need, thanks, I've got it...
 
cyclik33:

Please tell me how to do it. I tried to copy it as a report, but it gives in htm and does not show the number of losing trades in a row all the same.

I do not need to copy anything. In deinit() is inserted the necessary code which analyses results and saves them in the file. Sometimes I use this method when I need to get my own optimization criterion.
 
I can not figure it out. I just need to visualize the calculations by placing points on the AD indicator chart in the places where extrema are found.
The function
bool ObjectCreate( string name, int type, int window, datetime time1, double price1, datetime time2=0, double price2=0, datetime time3=0, double price3=0)
I'm stumped... :(

It is written black and white that OBJ_ARROW uses only one coordinate. WHICH??? Where do I take the datetime value from the indicator? Or should I memorize it along with the extremum found? In short - a mountain of questions and misunderstanding, and I did not find an answer on the site, except for working with other types of graphical elements...

Help, point fingers please... :)

 
artmedia70:

It's written in black and white that OBJ_ARROW uses only one coordinate. WHICH??? Where do I get the datetime value from the indicator? Or should I memorize it along with the extremum found? In short - a mountain of questions and misunderstandings, I did not find an answer on the site, except for working with other types of graphical elements...

Help, point the finger please... :)

When an extremum is found, it is located at a certain bar and you paste it in:

datetime time1=extreme value, double price1=Time[bar number].

 
Roger:

When you find an extremum, it is at a certain bar, so you insert it:

datetime time1=extreme value, double price1=Time[bar number]

No, I look for extrema on the indicator chart, in this case A/D
 
artmedia70:

It's written in black and white that OBJ_ARROW uses only one coordinate. WHICH ONE???

This is an inaccuracy in the Helpe. Of course, not one coordinate, but one point (which has two coordinates).
 
Mathemat:
This is an inaccuracy in Helpe. Of course, not one coordinate, but one point (which has two coordinates).

Thanks, Alexey, half of it has been clarified :) Now I want to know how to take and where to get these coordinates to draw them on the indicator chart. The price chart is clear and understandable, but the indicator is a mess...
 

A graph of an indictor? It's essentially the same thing. Extremes are only on the bars anyway, not between them.

Inducator is a separate window (if you draw it separately, below the price window). This window has the same coordinates - indicator value and time.

Reason: