I've written in Children's Book Insider newsletter and on the CBI Clubhouse about the difference between middle grade and young adult books. One hallmark, in my mind, is that in YA fiction the protagonist is faced with an adult situation for the first time, and in living through it crosses a threshold into the adult world. At the end of the book the main character is forever changed–he/she can't go back to being a child or adolescent. The protagonist's eyes have been opened a bit to the larger world, and a certain innocence has been lost. In middle grade fiction, though the main character may emerge a somewhat wiser or more worldly than at the beginning of the book, that character is still fundamentally a child. That internal shift that signals a more adult way of moving through the world hasn't quite taken shape.
But writing isn't an exact science, so a second opinion is always welcome. Agent Michael Stearns' post Middle Grade? Teen? Where Do You Draw the Line? on the Upstart Crow Literary blog offers a slightly different way of measuring where your book fits, and comes with a nifty graph. Check it out.