if (counted_bars<0) return(-1);
if (counted_bars>0) counted_bars--;
if (limit<0) limit=0;
I'm writing because I would like to understand what activates the signals of buy and sell of an indicator… is there anyone who has the patience to explain to me the yellow highlighted text? Attached is the file of the indicator from which I extracted the part that I can't understand.
thank you, whroeder, for your reply
I'm a discretionary trader, using several rules, in my mind not written in any programming language... my programming skills are next to zero level... so, I've read, and will read again the link you've put on
I think to have undestood the meaning of the counted bars
But what do you mean when you say "i-dist/2 is looking at future bars"?
if, for example, dist = 10, I understand that the " hhb=Highest(NULL,0,MODE_HIGH,dist,i-dist/2);" is the highest level between the last 10 bars, or the last 5 (10/2), after the indicator had been launched last… is it wrong?
Hoping to have explained my thought
For bar 10, it looks at bars [14..5]. For bar 5 it looks at bars [9..0]. It uses future bar values for a specific bar output. Wrong.
For bars 4 to zero it fails. The future does not exist.
I like this indicator very much, if used with other indicators or instruments (for example, pivot, Fibonacci retracements, etc)
I'm not clear yet… probably, it will be clear with the help of a chart… I've set 'dist' value at 10...
can you explain me only the last two 'up arrow', please?
Many thanks again, for your patience
I think to have understood!!
I have tried several set values, it's a sort of swing indicator, with needs confirm during the next "dist/2" bars after the signal… is it right?
can anyone help with solving the formula from code below,,how it actually works ,, i want to understand its calculations in excel sheet or if anyone can help to solve it..