Why is this code counting every bar in the closed_trades loop, see attached? I just want it to count for each condition and reset the counter to 1 when the condition has been met.

for(closed_trades)
{
if ((total_equity[0]<max_equity[0]))
{
Count++;
}
else
Count = 1; //Trying to reset counter to 1 for loop.

}

Attached Files
Count.JPG (28 downloads)