Shares gain on bank and real estate stocks