Skip to Content
Mastering Python for Finance - Second Edition
book

Mastering Python for Finance - Second Edition

by James Ma Weiming
April 2019
Intermediate to advanced
426 pages
11h 13m
English
Packt Publishing
Content preview from Mastering Python for Finance - Second Edition

A maximization example with linear programming

Suppose that we are interested in investing in two securities, X and Y. We would like to find out the actual number of units to invest for every three units of the security X and two units of the security Y, such that the total number of units invested is maximized, where possible. However, there are certain constraints on our investment strategy:

  • For every 2 units of the security X invested and 1 unit of the security Y invested, the total volume must not exceed 100
  • For every unit of the securities X and Y invested, the total volume must not exceed 80
  • The total volume allowed to invest in the security X must not exceed 40
  • Short-selling is not allowed for securities

The maximization problem ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python for Finance - Second Edition

Python for Finance - Second Edition

Yuxing Yan
Python for Finance

Python for Finance

Yves Hilpisch

Publisher Resources

ISBN: 9781789346466Supplemental Content