Guest User

Untitled

a guest
Nov 15th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. 1. Trader opens position shown as "a" (marked as 'OPENING' in the Direction column) in some security (SQ in this case) then closes it "marked as "b" ( 'CLOSING' in the Direction column).
  2. 2. After he closes that position Running total becomes 0
  3. 3. I need to calculate Profit & Lost on "1", "2" as "Money Paid to open that position" minus "Money received to close that position". And do it for every pair of OPENING/CLOSING
  4. 4. Please note PnL needs to be calculated BETWEEN TWO Zeroes in the RunningTotal column. In the attached example as between rows id 1 and 7, then between 8 and 21 etc.
Add Comment
Please, Sign In to add comment