Investors & landlords

I was not a US resident when purchasing the apartment. Its market value appreciated before I moved to the US. Can I use the market value at that moment as the cost base? 

 

Also, can long-term capital loss in stock markets offset this capital gain?