Is elavil (amitriptyline) good for stopping nightmares? I have ptsd and was prescribed it

Not usually. Elavil (amitriptyline) or Amitriptyline can help for insomnia, depression and some pain conditions. There has not been much data to suggest that it helps for nightmares. Prazosin may be a better choice for ptsd related nightmares.
See that you have. Also been treated with atypical antipsychotics which often help with insomnia. Elavil (amitriptyline) is sometimes prescribed off label to help with sleep. Prazosin has been very useful for the combination of nightmares ; insomnia in people with complex ptsd. Use good sleep hygiene as well.