For probably the majority of the past year I have had this stabbing pain that was originally at the top of my buttocks on the right side. This pain appeared whenever I was lying down and sometimes sitting down. Recently (past month or so) it has moved to the top of that thigh, underneath the buttock. Whenever I'm lying down in one position and not moving a muscle I'm pretty ok, but when I try to move even a tiny bit it stabs very sharp and I quite often need help getting up, sometimes not being able to get out of bed at all. 

Is this muscular ? Are there certain exercises I could do to improve this ? 

I have noticed that it has started hurting when I am standing and leaning on that leg, and I stand up straight when I notice that happening, if that helps at all.