This is not a stomach ulcer. Red blood coming out when you poop looks scary as hell but is usually nothing serious.
When blood comes out of your stomach, it turns completely black from the digestive process LONG before it reaches your anus. Blood from an ulcer makes your poop black and it looks sort of like tar. It is NOT dark red, it's completely black.
So, any red you see is NOT from your stomach, or from your small intestine. Most likely, it's an anal fissure or hemorrhoid. If you had any constipation, hard stools or painful bowel movements recently, it's probably the 'rhoid or fissure.
If it is a hemorrhoid or fissure, drink lots of water and eat lots of fiber.