Trading risk calculator written in PHP