Question about iHighest when the range to count is 0
user3822:
When the number of bars to count is == 0, iHighest counts the whole array. However, in certain situations, the candle with the highest value is the same candle from which to start counting. As you can see, this is a problem. As a result, I've added the highlighted part to make sure that the range of candles to count will always be at least 1. |
|
|
user3822: x is a variable representing a Sunday Gap Open. i is a variable representing a Sunday Gap Fill. What's not clear? |
|
Hi everyone,
First time working with iHighest.
When the number of bars to count is == 0, iHighest counts the whole array.
However, in certain situations, the candle with the highest value is the same candle from which to start counting.
As you can see, this is a problem.
As a result, I've added the highlighted part to make sure that the range of candles to count will always be at least 1.
My question is: will adding +1 to the range of candles to count skew the results of always grabbing the highest value between the range I want to search through? I was wondering if I should stick with this or just add an if statement that makes 'maeShift' = 1 if x-i is equal to 0.
In case you're wondering what the variables x and i are:
x = H1 Sunday Gap Open Candle
i = H1 Sunday Gap Fill Candle