Is nortryptyline a good medicine for derealization caused by migraines and also anxiety? How long do I have to be on it to know whether it helps?

Anxiety. It has a good chance of helping with anxiety. If your derealization is related to your anxiety, it has a good chance of helping with that as well. But it is dose dependent. You may need to be on it for a few weeks to know -- again, dose dependent. It is possible that yoo will get no significant side effects, but discuss this with your prescriber.