"Have a good day" when you part implies that you hope you friend will have a good day after you part.
On the other had," I hope you are having a good day" means you hope they are having a good day right now and it does not necessarily mean you are about to part. For example you might be at an event and you hope your friend is enjoying themselves at the event. You could also say "I hope you are having a good time".
"Have a good day" is also a stock phrase that shop assistants etc are trained for say to customers so they not not always mean it sincerely.