In the incrementation, the first object is fixed and compared to the following others. After the first object was compared to others, the second one is fixed and compared also to the following others (except to the first one which is the previous). This process continues until the two last objects of the series are compared.
Now let imagine that I have five bars and I want to compare them. But here, I want to compare only two consecutive objects. In other words, I want to compare Object[0](first object of the series) to Object[1](second object of the series); From here, Object[1] in the previous comparison will be Object[0] and the third objet of the series will be Object[1]. The first object of the series is not more taken into consideration. We could have the following illustration for the comparison for the objects at positions: (0-1); (1-2); (2-3); (3-4); (4-5) and not: (0-1-2-3-4-5); (1-2-3-4-5); (2-3-4-5); (3-4-5); (4-5) of the simple incrementation.
I have this code:
for(int i = 0; i < 5; i++)
{ for (int j= i+1; j < 4; j++)
{if(Close[i] > Close[j]
{DoSomething;
i++;
j++
}
}
}
Any help would be very appreciated.
Thanks!

Comment