In the Red

What does the idiom “in the red” mean?

Definition: Losing money; (of a market index) below a specified starting point

For example: The company isn’t bankrupt yet, but it’s in been in the red for several years now, and investors aren’t happy.

The stock market ended in the red after being up for most of the day.