Solved

Linear Programming / Simplex, and Stock Options | How to Set up Problem

Posted on 2010-11-08
4
869 Views
Last Modified: 2013-11-25
Good morning,

I found an article online, which I thought would be fun to play along with, and replicate the results
that the author got. However, I can't seem to figure out how he set up how his problem.

http://www.durangobill.com/LP_Options.html

the gist of the article is that if you owned a brokerage firm (I don't), its possible to create a basket of stock option combinations that will guarantee profit regardless of how the underlying security moves.

Maximize p = x13
s.t.

 - 1500x1 - 1130x2 - 1020x3 + 1500x4 + 1130x5 + 1020x6 + 56920x7 + 57200x8 + 57450x9 - 56920x10 - 57200x11 - 57450x12 - 1x13 >= 0
 - 1500x1 - 1130x2 - 1020x3 + 1500x4 + 1130x5 + 1020x6 + 920x7 + 1200x8 + 1450x9 - 920x10 - 1200x11 - 1450x12 - 1x13 >= 0
 - 1000x1 - 1130x2 - 1020x3 + 1000x4 + 1130x5 + 1020x6 - 1080x7 - 1300x8 - 1050x9 + 1080x10 + 1300x11 + 1050x12 - 1x13 >= 0
 + 1500x1 + 1370x2 + 980x3 - 1500x4 - 1370x5 - 980x6 - 1080x7 - 1300x8 - 1550x9 + 1080x10 + 1300x11 + 1550x12 - 1x13 >= 0
 + 40500x1 + 40370x2 + 39980x3 - 40500x4 - 40370x5 - 39980x6 - 1080x7 - 1300x8 - 1550x9 + 1080x10 + 1300x11 + 1550x12 - 1x13 >= 0
 + 1x1 + 1x2 + 1x3 + 1x4 + 1x5 + 1x6 + 1x7 + 1x8 + 1x9 + 1x10 + 1x11 + 1x12 - 0x13 <= 1
 + 1x1 + 1x2 + 1x3 + 1x4 + 1x5 + 1x6 + 1x7 + 1x8 + 1x9 + 1x10 + 1x11 + 1x12 - 0x13 >=1

Open in new window


for the life of me, I can't get my head wrapped around how to set this up.
I can't think of how to set it up in excel for solver

I've tried dumping it as is into this web site which has a  JS solver utility, and it bombs out.
:http://www.zweigmedia.com/RealWorld/simplex.html

Any help is super appreciated.
thanks
-JW
0
Comment
Question by:JustinW
  • 3
4 Comments
 
LVL 22

Expert Comment

by:NovaDenizen
Comment Utility
The problem is specified in AMPL (http://en.wikipedia.org/wiki/AMPL).  So just you need to get a linear programming solver.
0
 
LVL 31

Expert Comment

by:GwynforWeb
Comment Utility
Your solver is fussy about the format at start of each equation. I got it to "work" for below but basically the problem is too big. You need to find a better solver. You may have to download one. All the online ones are the same code as far as I can see.

Maximize p = x13 subject to

-1500x1 - 1130x2 - 1020x3 + 1500x4 + 1130x5 + 1020x6 + 56920x7 + 57200x8 + 57450x9 - 56920x10 - 57200x11 - 57450x12 - 1x13 >= 0
-1500x1 - 1130x2 - 1020x3 + 1500x4 + 1130x5 + 1020x6 + 920x7 + 1200x8 + 1450x9 - 920x10 - 1200x11 - 1450x12 - 1x13 >= 0
-1000x1 - 1130x2 - 1020x3 + 1000x4 + 1130x5 + 1020x6 - 1080x7 - 1300x8 - 1050x9 + 1080x10 + 1300x11 + 1050x12 - 1x13 >= 0
1500x1 + 1370x2 + 980x3 - 1500x4 - 1370x5 - 980x6 - 1080x7 - 1300x8 - 1550x9 + 1080x10 + 1300x11 + 1550x12 - 1x13 >= 0
 40500x1 + 40370x2 + 39980x3 - 40500x4 - 40370x5 - 39980x6 - 1080x7 - 1300x8 - 1550x9 + 1080x10 + 1300x11 + 1550x12 - 1x13 >= 0
 1x1 + 1x2 + 1x3 + 1x4 + 1x5 + 1x6 + 1x7 + 1x8 + 1x9 + 1x10 + 1x11 + 1x12  >=1
 1x1 + 1x2 + 1x3 + 1x4 + 1x5 + 1x6 + 1x7 + 1x8 + 1x9 + 1x10 + 1x11 + 1x12  <=1
0
 
LVL 31

Accepted Solution

by:
GwynforWeb earned 500 total points
Comment Utility
ps to put it in standard form

replace the last 2 equations by

 1x1 + 1x2 + 1x3 + 1x4 + 1x5 + 1x6 + 1x7 + 1x8 + 1x9 + 1x10 + 1x11 + 1x12  - x14 <=1

the objective function to

Minimize p = -x13 + x14

and multiply the 1st 5 equations by -1 so they are <= 0
0
 
LVL 31

Expert Comment

by:GwynforWeb
Comment Utility
correction multiply w14 by a large number ( as big as you can) eg

Minimize p = -x13 + 1000000x14

this is to force x14 to be 0 so the equality holds. sorry about that.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now