Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2010-11-08
4
Medium Priority
?
911 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This article covers the basics of data encryption, what it is, how it works, and why it's important. If you've ever wondered what goes on when you "encrypt" data, you can look here to build a good foundation for your personal learning.
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.
Introduction to Processes
Suggested Courses

636 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