President boasts about stock market before handing out medals for ‘conspicuous gallantry and intrepidity at the risk of life above and beyond the call of duty’