The stock market on Friday closed in the green, erasing the losses it made in the opening session.