Excel Workbook | ||||
---|---|---|---|---|
Open | Close | Signal | ||
1330 | 1290 | BUY | ||
1310 | 1270 | BUY | ||
1170 | 1170 | BUY | ||
1200 | 1120 | BUY | ||
1120 | 1160 | - | ||
1130 | 1150 | - | ||
1140 | 1150 | - | ||
1150 | 1160 | - | ||
1150 | 1130 | - | ||
1140 | 1090 | - | ||
1120 | 1050 | - | ||
1050 | 980 | BUY | ||
980 | 1000 | - | ||
1010 | 990 | - | ||
990 | 950 | - | ||
940 | 940 | - | ||
920 | 970 | - | ||
990 | 1020 | - | ||
990 | 990 | - | ||
1000 | 1020 | - | ||
1030 | 1070 | SELL | ||
1090 | 1070 | - | ||
Hello,
As you can see, I have quite a problem on formulating the buy/sell calculation from the table below.
Sheet1 |
I would like to make a calculation formula where if the third column (Signal) assign "BUY", then the numeric value from the first column on the next row after the "BUY" signal (opening price of the next day) would be the subtrahend for the numeric value from the first column on the next row after the "SELL" signal, and the given result would be shown in the next column of Signal column.
If the numeric value after the buy signal is bigger than the value after the sell signal, it would search for another bigger value after another sell signal. And if those requirements do not meet, it would produce "unrealized" text instead.
Is it possible? I'm sorry for the trouble on my first thread post. Just a college kid trying to finish a task.
Thank you so much.