Investors have been buying oil to counter the risks of inflation posed by the weak dollar .