Oil swung from gains to losses on Friday to cap a week filled with tariff worries and concerns over US policy against oil producer Iran.