My suggestion is:
for long terms, say 20-30 years, then買樓.
It is because you use 1M for 買樓 (30%, and 70% mortgage). Then, the rent can cover 供樓.
i.e. 20 years later, you will have a flat with 3M (assume the price is unchange)
If you are sure that you can earn 2M or more 20 years later by 股票, then go ahead.