First I would like to say I'm very sorry that you are dealing with this. I delt with this issue a lot with my boys at the same age. I would love to have some sort of fix-it-all answer for you, but I don't. However, I do have some advice as to what NOT to do which I learned through my own experiences.
1) Stop beating YOURSELF up...we all do it. Parental guilt, making it our fault, wearing our selves out mentally and emotionally with "I should have..." or "I shouldn't have..." It's just a waste of time.
2) Do NOT engage in yelling, fighting, empty threats or unrealistic negotiations. You are an adult. Behave like one. Do not allow your teen age child to pull you down to that level. If you find yourself getting there, walk away. Also, never allow anyone, especially your own child, to yell at you. When she starts yelling, cursing or throwing a fit. Stop. Turn around. WALK AWAY. When she's finished, she can have your attention.
3) Stop enabling her. She is only 17 years old...what are her resources? You. One of the best things I ever did was stop funding my teens poor choices and behavior. Were they mad...OH YA!! They were furious and it was all my fault (In their minds any way) It was also very hard to do. We have this ingrained parental reflex to jump when our children say jump. This is necessary when they are infants but we tend to forget that as they grow so must the way and the what of what we provide for them. We forget to stop putting their shoes on for them, fixing their plates, making their beds....the list is endless. We keep saying we want them to be independent, capable adults but don't give them the necessary opportunities to learn what they need to learn to do that. What are some ways to stop enabling? Stop financing her, no cash. Stop making it so easy for her to just come and go as she pleases. Stop providing transportation so easily. If your paying any of her bills...STOP. Don't threaten, just stop. She's 17. If she wants to waste time and money, let her start doing it with her own time and money.
4) This is the big one...LET GO. Yes, she is only 17, but she is right on that edge where you can no longer make and control her choices (however you can stop funding it and making it easy). As much as Answer #2 sounds like "damage control"...at least it will give you SOME control. I just recently had the terrifying experience of watching my 18 year old son take a paternity test......I can not put into words how stressful this was. Thankfully I made sure to drill safe sex into my kids and he swore he was safe...he is not the father btw.
The simple fact is there is a point in parenting where all your doing is praying a lot. We have created a society where we keep trying to make our children's lives easier by over providing, over stimulating and over extending our selves in the name of love for our children. Are they our children? Yes...but they are also human beings and human beings learn by trial and error. You can't do it for her. We all have this fantasy that our children should learn from our mistakes, so did our parents. But last I checked we are all still out there making the same basic mistakes. How does that song go..."Jesus take the wheel".
Again, this is just what I've learned from my own experience. My youngest is now 16 and the things her brothers taught me have made things so much easier when dealing with her. My boys have survived and are still making mistakes, but I have learned how to deal with them so I don't go crazy and I'm a better parent for it. I wish you the best of luck and remember to breathe!