My guppy won't eat and stays on one side of the tank

Apr 16, 2017
Hi, this is my first post so sorry if it's not the best :p

So, I have 2 male guppies, both in a 5 gallon tank. There's also 2 ghost shrimp with them.
I've had them for a few months but my other 2 guppies in the same tank died unexpectedly after a couple weeks. These current guppies were in the same tank in the pet store while the others were both in their own tank. I usually feed them a couple flakes in the morning and turn their light on at the same time. The light gets turned off at night when I go to bed. I don't know what the water info is, but the pet store where I got them gives free water tests if you bring them a sample of the water.

So my orange guppy usually likes to wait a few minutes to eat after the flakes are put in, but lately he hasn't been eating at all. Sometimes, he will see the food and seem to go for it but turn away at the last second. He also is usually up against one side of the tank, just putting his face on it and swimming around. The yellow guppy does usually leave him some food though, but the ghost shrimp sometimes try to swim to the surface to steal the food. The yellow guppy eats normally and swims all around the tank, but sometimes will stay near the surface or on top of the heater.

The tank looks clean (although the water stuffs like nitrates and whatever could be messed up because I can't actually see it) and yellow algae usually grows but it comes off easily and I always try to get as much off as I can. I did take out all the gravel along the bottom of the tank because a lot of the algae was growing on it and it's hard to get all the gravel out every time, but there is a couple decorations including a large shell with live plants and gravel in it to secure the plants so they don't float away.