Gem to calculate trading profits