In which direction and angle should solar panel be kept?

I was always wondering two things about solar panels on rooftops of nearby homes. One was why it is kept at an elevation rather than flat on the roof. Second is the slanting nature and direction. Of course the lightning arrestors were another query, but easier to answer as solar panels are usually the highest structures on the home, needing lightning protection. Reason for keeping the panels elevated is quite simple, it allows air to flow on the under surface of the panel and gives good cooling. Overheating in bright sunlight is known to reduce the efficiency of solar panels. Solar panels in Northern hemisphere should face South and those in Southern hemisphere should face North, to get maximum sunlight.

The angle of mounting is generally equal to the latitude of the region. So I should be mounting it at around 11 degrees. If you go all the way up to Himachal Pradesh or Uttarakhand, much higher angle of 30-36 degrees may be needed. It is also necessary to avoid shaded regions while mounting the panels. Now I know why my DIY 180W off grid solar power system has not been doing well. It is shaded for most part of the day by terrace fencing and much more by my water tank before noon. Moreover, it has been kept horizontally on a stool on the terrace! With this new learning points at hand, I am brainstorming options to optimise energy generation in my setup!