I am trying to setup a spreadsheet to calculate profits and losses for futures trades. The challenge is in matching up the trades. There are 3 scenarios. c=contracts
1.) 1c Buy c - 1c Sell - 0c remain - Sell price - Buy Price = grossProfit
2.) 2c Buy - 1c sell a x price - 1 sell at next x price- 0c remain- Sell Price x - Buy + Sell Price nx -Buy = g profit
3.)2c Buy - 1c sell at x price - 2c sells at next x price. - 1c remains making net short 1c - Sell Price x - Buy + Sell Price nx -Buy + Buy price - sell - gprofit.
Of course the can all be flipped as well - 1c Sell - 1c Buy - 0c remain ……
Hope this makes sense. Can someone please help me figure out the logic for this as well as a way to implement the trade matching. Thank you.
Bookmarks