fix loss/gain per day, remove ecdf code