I am trying to make use of Alteryx to calculate the Profit and Loss based on FIFO close out methodology.
below are my input files and expected output.
Input 1
This file contains new transactions.
- no. of contracts - -ve means sell, +ve means buy
Input 2
This file contains existing positions.
- no. of contracts - -ve means sell, +ve means buy
Output
- FIFO
First In First Out, by trade date (oldest buys vs oldest sells) and by trade price (lowest price buys vs lowest price sells)
Therefore, only if the new transactions results in a close out of positions of the existing positions based on FIFO, will it then appear in the output file
- i should only see the ones that are relevant as my output file is only to tell me what positions have been closed out