My baby is 18 days old and hasn't pooped for 3 days now. Is this ok?

No! See doc now... This is highly abnormal. You need to call your child's doctor immediately.
Breast or bottle ? Breast fed babies can have a little smear with each feed or have one big blowout every 7-10 days.Bottle fed kids will poo more predictably & should go daily. If the poo is soft it is not considered constipation. I don't get hung up on babies timing, I like to look at them to see how they feel.