Automatically Compare Multiple Combinations of Options to Discover Best Spread Investments

Bobaree6

New Member
Joined
Dec 23, 2020
Messages
18
Office Version
  1. 365
Platform
  1. Windows
This the purpose of this VBA program would be to automatically compare buy/sell stock option combinations to search for option spread opportunities within a given option chain. The goal is to compare any of the buy opportunities in cells B&C against all the combinations of selling opportunities in cells D&E.

*Allow user to start at any two contiguous cells in rows B&C. For example:
1. Go to selection B9:C9 (or begin at various cells in columns B&C), and copy values to the cells beginning 24 cells to the right of B column. Next, 2. Go to selection D9:E9 and copy values to the cells 24 cells to the right of the D column. 3. The program would then automatically move down to selection D10:E10 and copy to cells 24 cells to the right of D column. 4. Continue copying the two cells in D and E columns to the cells 24 cells to the right again. Continue down to the last row containing data in D and E Columns. An image is included to help visualize the procedure. 5. I would then choose another set of cells in the B&C columns to automatically compare the data against the data in all D&E in rows below the currently selected cells.

I am a newcomer to VBA and would appreciate any help. I made a post/question prior to this on the same subject, but this post explains the situation better, so please ignore my post of yesterday, 2/23/2021. If I have not explained this clearly, please let me know and I'll clarify.
 

Attachments

  • Option Search Engine.jpg
    Option Search Engine.jpg
    195.5 KB · Views: 7

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
What you described sounds a trivial task to me so I am not sure I have really understood what you want. These three lines of code copy all the data for columns B,C D and E 24 rows to right
VBA Code:
lastrow = Cells(Rows.Count, "B").End(xlUp).Row
inarr = Range(Cells(9, 2), Cells(lastrow, 5))
Range(Cells(9, 2 + 24), Cells(lastrow, 5 + 24)) = inarr
 
Upvote 0
Solution

Forum statistics

Threads
1,215,510
Messages
6,125,228
Members
449,216
Latest member
biglake87

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top