I live in a penthouse. The terrace could be accessed from adjoining properties.
I bought four infra red beam units from a place in UK (which specialise in perimeter protection, fence line, gates etc.
I have set them up so that they cover movement across the entire terraces. This meant two areas. So two double beams.
I wired the beams so that if one beam was broken it did not trigger the alarm (bird flying through) two broken would. The bottom beam is set about 15 inches from the ground the second about 15 inches above that.
The alarm is an off the shelf DIY kit. The whole thing was under £100
In the ten years I have not had the system triggered by an intruder but I have every confidence I am protected.
PS
I had initially tried a very expensive movement detector but found that when it was hot it failed to detect any difference between body temperature and the surrounding temp. Its in a box somewhere.