Find side projects. Writing software is a great distraction and also rewarding both in direct terms and intellectually.
Interesting replies from everyone.
This one hit home a bit. Trading gets quite boring and once you figure out your interpretation of the puzzle, you lose the mental stimulation. At least in my case. I've personally found the best approach is keeping trading as a backdrop to other projects; i.e. progression in another way, via personal projects (like your coding suggestion) or other sources of income to keep the mind busy.
I am not looking for help for my own case, even though it is difficult, but I was more interested to see if others have experienced these types of struggles as well and different approaches.