$openorders += $record[5] - $record[7];