yokeloonlo01
New Member
- Joined
- Jul 10, 2018
- Messages
- 1
Hi,
Need some help if can do this in VBA or Pivot. Unable to figure out the way on this.
I have the following Data: from Column A to K for Equity Option Trading:
[TABLE="class: mce-item-table"]
<tbody style="box-sizing: border-box;">[TR]
[TD]No[/TD]
[TD]Date/Time[/TD]
[TD]Strategy[/TD]
[TD]Method[/TD]
[TD]Qty[/TD]
[TD]Pos Effect[/TD]
[TD]Equity[/TD]
[TD]Expiry Date[/TD]
[TD]Strike Price[/TD]
[TD]Transaction
Type
[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]7/6/2018 21:45[/TD]
[TD]VERTICAL[/TD]
[TD]SELL[/TD]
[TD]-10[/TD]
[TD]TO OPEN[/TD]
[TD]GOOGL[/TD]
[TD]13-Jul-18[/TD]
[TD]1100[/TD]
[TD]PUT[/TD]
[TD]2.86[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]BUY[/TD]
[TD]10[/TD]
[TD]TO OPEN[/TD]
[TD]GOOGL[/TD]
[TD]13-Jul-18[/TD]
[TD]1097.5[/TD]
[TD]PUT[/TD]
[TD]2.64[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]7/6/2018 21:30[/TD]
[TD]VERTICAL[/TD]
[TD]SELL[/TD]
[TD]-10[/TD]
[TD]TO OPEN[/TD]
[TD]TSLA[/TD]
[TD]13-Jul-18[/TD]
[TD]280[/TD]
[TD]PUT[/TD]
[TD]2.64[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]BUY[/TD]
[TD]10[/TD]
[TD]TO OPEN[/TD]
[TD]TSLA[/TD]
[TD]13-Jul-18[/TD]
[TD]277.5[/TD]
[TD]PUT[/TD]
[TD]2.34[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]7/5/2018 21:33[/TD]
[TD]VERTICAL[/TD]
[TD]SELL[/TD]
[TD]-5[/TD]
[TD]TO OPE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1[/TD]
[TD]TO OPEN[/TD]
[TD]BIDU[/TD]
[TD]22-Jun-18[/TD]
[TD]250[/TD]
[TD]PUT[/TD]
[TD]0.45[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]BUY[/TD]
[TD]1[/TD]
[TD]TO OPEN[/TD]
[TD]BIDU[/TD]
[TD]22-Jun-18[/TD]
[TD]247.5[/TD]
[TD]PUT[/TD]
[TD]0.29[/TD]
[/TR]
</tbody>[/TABLE]
You can see that based on Column A (No), there were 15 set of trades and each set of trades can have more than one line, example:
For No 1 - 7/6/2018 21:45
We have a trade that involve Sell and Buy for GOOGL equity option that happen in a single trade, i,e., row 2 is Sell trade and row 3 is a buy trade. Note that cell C2 has no date (same as per Cell E2 and so on)
The requirement are:
1) Whether to use combination of VBA or otherwise, for combination of different value of B (Date/Time), and Column C (Vertical or Vert Roll), Column G (Equity), Column H (Expiry Date), Column D (Sell/Buy), cut and paste the Buy row to Column L to V, so we have the result like this:
Example: For 7/6/2018 @ 21.45pm, for GOOGL with expiry @ 13 Jul 2018, copy the row 2 to the right
(Scroll to the right further)
A B C D E F G H I J K L M N O P
[TABLE="class: mce-item-table"]
<tbody style="box-sizing: border-box;">[TR]
[TD]No[/TD]
[TD]Exec Time[/TD]
[TD]Spread[/TD]
[TD]Side[/TD]
[TD]Qty[/TD]
[TD]Pos Effect[/TD]
[TD]Symbol[/TD]
[TD]Expiry [/TD]
[TD]Strike[/TD]
[TD]Type[/TD]
[TD]Price[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]7/6/2018 21:45[/TD]
[TD]VERTICAL[/TD]
[TD]SELL[/TD]
[TD]-10[/TD]
[TD]TO OPEN[/TD]
[TD]GOOGL[/TD]
[TD]13-Jul-18[/TD]
[TD]1100[/TD]
[TD]PUT[/TD]
[TD]2.86[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]BUY[/TD]
[TD]10[/TD]
[TD]TO OPEN[/TD]
[TD]GOOGL[/TD]
[TD]13-Jul-18[/TD]
[TD]1097.5[/TD]
[TD]PUT[/TD]
[TD]2.64[/TD]
[/TR]
</tbody>[/TABLE]
So the row 3 goes to row 2 and paste to L2 to V2
2) Note that in above data, no 13 has 4 rows (Sell- Buy- Buy-Sell) on the same date, so just arrange by Sell-Sell (A-K) and Buy-Buy (L-V) side by side based on added criteria (Column C - Vert RolL)
Any help is appreciated.
Thanks
Lo
Need some help if can do this in VBA or Pivot. Unable to figure out the way on this.
I have the following Data: from Column A to K for Equity Option Trading:
[TABLE="class: mce-item-table"]
<tbody style="box-sizing: border-box;">[TR]
[TD]No[/TD]
[TD]Date/Time[/TD]
[TD]Strategy[/TD]
[TD]Method[/TD]
[TD]Qty[/TD]
[TD]Pos Effect[/TD]
[TD]Equity[/TD]
[TD]Expiry Date[/TD]
[TD]Strike Price[/TD]
[TD]Transaction
Type
[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]7/6/2018 21:45[/TD]
[TD]VERTICAL[/TD]
[TD]SELL[/TD]
[TD]-10[/TD]
[TD]TO OPEN[/TD]
[TD]GOOGL[/TD]
[TD]13-Jul-18[/TD]
[TD]1100[/TD]
[TD]PUT[/TD]
[TD]2.86[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]BUY[/TD]
[TD]10[/TD]
[TD]TO OPEN[/TD]
[TD]GOOGL[/TD]
[TD]13-Jul-18[/TD]
[TD]1097.5[/TD]
[TD]PUT[/TD]
[TD]2.64[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]7/6/2018 21:30[/TD]
[TD]VERTICAL[/TD]
[TD]SELL[/TD]
[TD]-10[/TD]
[TD]TO OPEN[/TD]
[TD]TSLA[/TD]
[TD]13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BIDU[/TD]
[TD]22-Jun-18[/TD]
[TD]250[/TD]
[TD]PUT[/TD]
[TD]0.45[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]BUY[/TD]
[TD]9[/TD]
[TD]TO OPEN[/TD]
[TD]BIDU[/TD]
[TD]22-Jun-18[/TD]
[TD]247.5[/TD]
[TD]PUT[/TD]
[TD]0.29[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]6/20/18 21:51:43[/TD]
[TD]VERTICAL[/TD]
[TD]SELL[/TD]
[TD]-1[/TD]
[TD]TO OPEN[/TD]
[TD]BIDU[/TD]
[TD]22-Jun-18[/TD]
[TD]250[/TD]
[TD]PUT[/TD]
[TD]0.45[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]BUY[/TD]
[TD]1[/TD]
[TD]TO OPEN[/TD]
[TD]BIDU[/TD]
[TD]22-Jun-18[/TD]
[TD]247.5[/TD]
[TD]PUT[/TD]
[TD]0.29[/TD]
[/TR]
</tbody>[/TABLE]
You can see that based on Column A (No), there were 15 set of trades and each set of trades can have more than one line, example:
For No 1 - 7/6/2018 21:45
We have a trade that involve Sell and Buy for GOOGL equity option that happen in a single trade, i,e., row 2 is Sell trade and row 3 is a buy trade. Note that cell C2 has no date (same as per Cell E2 and so on)
The requirement are:
1) Whether to use combination of VBA or otherwise, for combination of different value of B (Date/Time), and Column C (Vertical or Vert Roll), Column G (Equity), Column H (Expiry Date), Column D (Sell/Buy), cut and paste the Buy row to Column L to V, so we have the result like this:
Example: For 7/6/2018 @ 21.45pm, for GOOGL with expiry @ 13 Jul 2018, copy the row 2 to the right
(Scroll to the right further)
A B C D E F G H I J K L M N O P
[TABLE="class: mce-item-table"]
<tbody style="box-sizing: border-box;">[TR]
[TD]No[/TD]
[TD]Exec Time[/TD]
[TD]Spread[/TD]
[TD]Side[/TD]
[TD]Qty[/TD]
[TD]Pos Effect[/TD]
[TD]Symbol[/TD]
[TD]Expiry [/TD]
[TD]Strike[/TD]
[TD]Type[/TD]
[TD]Price[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]7/6/2018 21:45[/TD]
[TD]VERTICAL[/TD]
[TD]SELL[/TD]
[TD]-10[/TD]
[TD]TO OPEN[/TD]
[TD]GOOGL[/TD]
[TD]13-Jul-18[/TD]
[TD]1100[/TD]
[TD]PUT[/TD]
[TD]2.86[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]BUY[/TD]
[TD]10[/TD]
[TD]TO OPEN[/TD]
[TD]GOOGL[/TD]
[TD]13-Jul-18[/TD]
[TD]1097.5[/TD]
[TD]PUT[/TD]
[TD]2.64[/TD]
[/TR]
</tbody>[/TABLE]
So the row 3 goes to row 2 and paste to L2 to V2
2) Note that in above data, no 13 has 4 rows (Sell- Buy- Buy-Sell) on the same date, so just arrange by Sell-Sell (A-K) and Buy-Buy (L-V) side by side based on added criteria (Column C - Vert RolL)
Any help is appreciated.
Thanks
Lo