Trade return calculator written in php