Dennisss11
New Member
- Joined
- Nov 25, 2022
- Messages
- 9
- Office Version
- 365
- Platform
- MacOS
Hi all,
I have been struggling with this excel puzzle for a while now. Hopefully someone can help me out!
I am testing a trading strategy where sometimes we have to 'get out' and later 'get back in' again based on some rules that I would like to put together in a formula. I've tried to highlight some relevant cells, which I will explain now:
Step 1: In column T, we see the Put payoff. As soon as this turns negative (first at T33), we have to "roll" the option, meaning that on that (end of) day, we get out of the market. We got out on a strike of 435 (Q32) at a closing price of 430,73 (F33).
Step 2: The days after the "roll" signal, we check whether the "close" (column F) exceeds our 435 (Q32) strike. This could take a day, but also 200 days..... If it doesn't, we should see "out" in column W and a 0 in column X.
Step 3: If the closing price exceeds our strike, which happens in this example at 435,94 (F38), column W should give a subtotal of the difference between our get out closing price 430,73 (F33) and the 435,94 (F38) which I just mentioned.
Step 4: After this, so the day after "subtotal" in column W, we can start at step 1 again. In the attached example, I highlighted 3 such events of getting out and back in again. The next event starts at W41. The one after that at W47.
I know my way around if formulas, but I can't seem to figure out how to use them with these kind of constraints. I would be very greatful!
Thank you all in advance.
I have been struggling with this excel puzzle for a while now. Hopefully someone can help me out!
I am testing a trading strategy where sometimes we have to 'get out' and later 'get back in' again based on some rules that I would like to put together in a formula. I've tried to highlight some relevant cells, which I will explain now:
Step 1: In column T, we see the Put payoff. As soon as this turns negative (first at T33), we have to "roll" the option, meaning that on that (end of) day, we get out of the market. We got out on a strike of 435 (Q32) at a closing price of 430,73 (F33).
Step 2: The days after the "roll" signal, we check whether the "close" (column F) exceeds our 435 (Q32) strike. This could take a day, but also 200 days..... If it doesn't, we should see "out" in column W and a 0 in column X.
Step 3: If the closing price exceeds our strike, which happens in this example at 435,94 (F38), column W should give a subtotal of the difference between our get out closing price 430,73 (F33) and the 435,94 (F38) which I just mentioned.
Step 4: After this, so the day after "subtotal" in column W, we can start at step 1 again. In the attached example, I highlighted 3 such events of getting out and back in again. The next event starts at W41. The one after that at W47.
I know my way around if formulas, but I can't seem to figure out how to use them with these kind of constraints. I would be very greatful!
Thank you all in advance.
Test xxxx.xlsx | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | F | Q | T | W | X | Y | ||||||||||||||||||||
29 | Date | Close | Strike | Put payoff | Preferred in formula | ||||||||||||||||||||||
30 | 1/4/93 | Monday | 435.38 | 435 | 0 | 0.00 | |||||||||||||||||||||
31 | 1/5/93 | Tuesday | 434.34 | 434 | 0.25 | 0.25 | |||||||||||||||||||||
32 | 1/6/93 | Wednesday | 434.52 | 435 | 0.92 | 0.92 | |||||||||||||||||||||
33 | 1/7/93 | Thursday | 430.73 | 431 | -2.93 | Roll | -2.93 | ||||||||||||||||||||
34 | 1/8/93 | Friday | 429.05 | 429 | -0.62 | out | 0 | ||||||||||||||||||||
35 | 1/11/93 | Monday | 430.95 | 431 | 1.87 | out | 0 | ||||||||||||||||||||
36 | 1/12/93 | Tuesday | 431.04 | 431 | 1.06 | out | 0 | ||||||||||||||||||||
37 | 1/13/93 | Wednesday | 433.03 | 433 | 1.01 | out | 0 | ||||||||||||||||||||
38 | 1/14/93 | Thursday | 435.94 | 436 | 0.99 | Subtotal | 5.21 | ||||||||||||||||||||
39 | 1/15/93 | Friday | 437.15 | 437 | 1.01 | 1.01 | |||||||||||||||||||||
40 | 1/18/93 | Monday | 436.84 | 437 | 1.38 | 1.38 | |||||||||||||||||||||
41 | 1/19/93 | Tuesday | 435.13 | 435 | -0.85 | Roll | -0.85 | ||||||||||||||||||||
42 | 1/20/93 | Wednesday | 433.37 | 433 | -0.71 | out | 0 | ||||||||||||||||||||
43 | 1/21/93 | Thursday | 435.49 | 435 | 0.81 | out | 0 | ||||||||||||||||||||
44 | 1/22/93 | Friday | 436.11 | 436 | 0.73 | out | 0 | ||||||||||||||||||||
45 | 1/25/93 | Monday | 440.01 | 440 | 1.52 | Subtotal | 4.88 | ||||||||||||||||||||
46 | 1/26/93 | Tuesday | 439.95 | 440 | 0.88 | 0.88 | |||||||||||||||||||||
47 | 1/27/93 | Wednesday | 438.11 | 438 | -0.92 | Roll | -0.92 | ||||||||||||||||||||
48 | 1/28/93 | Thursday | 438.66 | 439 | 0.93 | out | 0 | ||||||||||||||||||||
49 | 1/29/93 | Friday | 438.78 | 439 | 0.94 | out | 0 | ||||||||||||||||||||
50 | 2/1/93 | Monday | 442.52 | 443 | 1.85 | Subtotal | 4.41 | ||||||||||||||||||||
51 | 2/2/93 | Tuesday | 442.55 | 443 | 0.83 | ||||||||||||||||||||||
52 | 2/3/93 | Wednesday | 447.20 | 447 | 1.25 | ||||||||||||||||||||||
53 | 2/4/93 | Thursday | 449.56 | 450 | 0.92 | ||||||||||||||||||||||
54 | 2/5/93 | Friday | 448.93 | 449 | 0.20 | ||||||||||||||||||||||
55 | 2/8/93 | Monday | 447.85 | 448 | 0.74 | ||||||||||||||||||||||
56 | 2/9/93 | Tuesday | 445.33 | 445 | -1.49 | ||||||||||||||||||||||
57 | 2/10/93 | Wednesday | 446.23 | 446 | 0.97 | ||||||||||||||||||||||
58 | 2/11/93 | Thursday | 447.66 | 448 | 1.01 | ||||||||||||||||||||||
59 | 2/12/93 | Friday | 444.58 | 445 | -2.18 | ||||||||||||||||||||||
60 | 2/16/93 | Tuesday | 433.91 | 434 | -9.11 | ||||||||||||||||||||||
61 | 2/17/93 | Wednesday | 433.30 | 433 | 0.63 | ||||||||||||||||||||||
62 | 2/18/93 | Thursday | 431.90 | 432 | 0.05 | ||||||||||||||||||||||
63 | 2/19/93 | Friday | 434.22 | 434 | 1.31 | ||||||||||||||||||||||
64 | 2/22/93 | Monday | 435.24 | 435 | 1.99 | ||||||||||||||||||||||
65 | 2/23/93 | Tuesday | 434.80 | 435 | 0.88 | ||||||||||||||||||||||
66 | 2/24/93 | Wednesday | 440.87 | 441 | 1.33 | ||||||||||||||||||||||
67 | 2/25/93 | Thursday | 442.34 | 442 | 1.28 | ||||||||||||||||||||||
SPX |
Cell Formulas | ||
---|---|---|
Range | Formula | |
Q30:Q67 | Q30 | =ROUND(P30,0) |
T31:T67 | T31 | =(R30-MAX(0,(Q30-F31)))*$B$12 |
X30:X33,X46:X47,X39:X41 | X30 | =T30 |
X38 | X38 | =F38-F33 |
X45 | X45 | =F45-F41 |
X50 | X50 | =F50-F47 |
B30:B67 | B30 | =TEXT(A30,"dddd") |