US stocks swung Monday as oil prices kept climbing because of uncertainty about when the war with Iran could end.