A mood improvement technique I have been trying is quitting on a high point. If things go really well, call it a night. If things are as good as they can reasonably get, don’t wait for them to get worse, just take your win and leave. The two things you remember most of your experiences are the most extreme case and the last thing that happened; if you make them both the same positive event, you double-win.
Title reference: in Margaret Weis’s Star of the Guardians trilogy is the claim that the Greeks used this phrase to express “this is the high point in your life.” That is a bit more extreme than logging off.