[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 975

 
tuma88:


Yes, I understand about the indicator buffers.

But how to put in a loop to check this buffer?

Oh, man... :) If you know which buffer to take data from, then cycle through this buffer from the current bar deep into the history and if the buffer has a non-zero value - then the arrow...
 
tuma88:


Well, yes, I understand about the indicator buffers.

But how to put it into a loop to check this buffer? How about this?

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

{

signal = iCustom (NULL,0 etc. )

if (signal>0)

return(signal)

break

}

Somewhat like this.

double DataIndUP, DataIndDN;
int    i, BarWithArrowUP, BarWithArrowDN, nBars = 250 ;  // nBars = количество проверяемых баров вглубь истории

for (i=0; i<nBars; i++) {
   DataIndUP = iCustom(Symbol(),Period(),"Имя индюшонка", через запятую все параметры индюка , номер буфера стрелки вверх, i)
   DataIndDN = iCustom(Symbol(),Period(),"Имя индюшонка", через запятую все параметры индюка , номер буфера стрелки вниз, i)
   if (DataIndUP !=EMPTY_VALUE)     // или if (DataIndUP !=0) // найдена стрелка вверх
                                    // всё зависит от того, что выдаёт буфер при отсутствии стрелки 
                                    // нажмите Ctrl+D и посмотрите что вам в окне данных будет показано
      BarWithArrowUP=iBarShift(Symbol(),Period(),Time[i]); // найден бар со стрелкой вверх
   if (DataIndDN !=EMPTY_VALUE)     // или if (DataIndDN !=0) // найдена стрелка вниз
                                    // всё зависит от того, что выдаёт буфер при отсутствии стрелки 
                                    // нажмите Ctrl+D и посмотрите что вам в окне данных будет показано
      BarWithArrowDN=iBarShift(Symbol(),Period(),Time[i]); // найден бар со стрелкой вниз
      }

This code will not do anything useful - each time the arrow is found in the loop, it will assign to the variables BarWithArrowUP and BarWithArrowDN the number of the bar where the arrow is found. It is up to you to decide how to handle them. You can create an array where you will save the bars with arrows up and down, and then take numbers of the bars with arrows from this array; or you can, or you can, whatever you want... :)

Your code will find the very first arrow from the beginning of the loop. break will interrupt the loop, while return is needed only if it is a function and will return the value of the found arrow buffer to you, not the number of the bar where this arrow stands.

 
artmedia70:
What a mess... :) If you know which buffer to take data from, then arrange a loop through this buffer from the current bar deep into the history and if the buffer has a non-zero value - then the arrow...

0 and 1 indicator buffers are used to draw the arrows.

If you look at the figure, there are no arrows between points A and B, then I wonder if there will be nothing in the buffers either .Will there be zero?

And the last buffer value is saved?

 
tuma88:

0 and 1 indicator buffers are used to draw the arrows.

If you look at the figure, there are no arrows between points A and B, then I wonder if there will be nothing in the buffers either .Will there be zero?

Is the last buffer value saved?

Ctrl+D and drag the mouse over the graph. You will see what values the buffers of the indicator have under what circumstances. The last buffer value is its value on the current bar.
 

Dear experts. Could you please suggest a function that shows only the breakeven level for market orders of the same type?

 
fanat:

Dear experts. Could you please suggest a function that shows only the breakeven level for market orders of the same type?

Is your site search not working???
 
artmedia70:

Somewhere like this...

This code won't do anything useful - every time an arrow is found in the loop, it will assign the BarWithArrowUP and BarWithArrowDN variables the number of the bar where the arrow is found. It is up to you to decide how to handle them. You can create an array where you will save the bars with arrows up and down, and then take the numbers of arrow bars from these arrow arrays, or you can, or you can, whatever you want... :)


Thanks !

Or, can you find the first arrow and then exit the loop?

 
artmedia70:
Is your site search not working???

It works!!! Only that I found a lot of unnecessary stuff, and I don't know how to sift it out.
 
fanat:
It's working!!! Only that I found a lot of unnecessary things, and I don't know how to sift out the unnecessary things.
Select what you need.
 

THANKS to the title of the thread, I might add "Nowhere with you either".

Reason: