Solved

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

Posted on 2010-11-08
4
874 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
ID: 34094712
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
ID: 34224288
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
ID: 34224318
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
ID: 34228010
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Is doing tutor.com teaching in my situation advisable? 2 84
Work with App store 7 51
One Standard Deviation from the Mean 2 24
VB.net and sql server 4 34
This is an explanation of a simple data model to help parse a JSON feed
This is about my first experience with programming Arduino.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

774 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