Odd bug
-
So I was working on the way to get monday first 8 hours high and low as a variable.
I all seemed to work until i notice very bizzare bug.So the ea is simple rather, it filters days and gives it ID, then it filters hours and gives it id too, then a bunch of if functions to determine how many candles there were from Monday open. So all works until now.
When I try to get the values if I do not make itStart_ID = ID_Count - 1;
End_ID = ID_Count - 2;candle IDs are correct but variables give completely bizarre out-of-the-range numbers.
but if you'd only make it into
Start_ID = ID_Count ;
End_ID = ID_Count;it works as intended.
It will make more sense when you take a look for yourself.
I honestly don't understand where the problem is coming from. -
Never mind, I figured it out.
Apparently when setting the modified variables the start and then end goes backwards, meaning you need to start with the end and end with start values which is odd but make sense since it's how it works. -
@william29 At start Start_ID = ID_Count - 1 = 0 (current candle);
End_ID = ID_Count - 2 =-1(candle doesn't exist);
I think you only complicated your life with that system.
If you are interested in the min and max on Monday you just have to take them once and keep them in a variable.