if (close == open && close != 0 && open != 0)
{
sum = sum + close, close = 0, open = 0;
}
}
else
if (open > close)
{
sum = sum + close, close = 0, open = 0;
}
if (open < close)
{
sum = sum + open, close = 0, open = 0;
}