I need a relatively simple Java program written. Another programmer has attempted it - his code is attached, but does not work at all. You can use his code or ignore it.
Some knowledge of stock prices and stock portfolio management concepts is required to understand the requirements.
## Deliverables
The attached schema and data is for a MySQL database of stock prices containing one year of data for 7,500+ U.S. stocks.
I need a program which will establish the lowest-risk investment allocation given a fixed set of parameters and historical data.
The program which will accept a parameter list as follows:
PS s1 s2 s3 ... sN
WHERE:
PS (Integer) is the Portfolio Size
s1 .. sN (Strings) are a universe of stocks (list of symbols for this run of the program)
The CONSTANT value of $100,000.00 shall be used as the investment amount.
Call the symbol list the "computation universe" (CU). The program will query the database to get the price histories for the given symbols in the CU. The program will then calculate, for every possible combination, forming portfolios with a number (PS) of stocks chosen from CU. From all the generated portfolios, the program will calculate for each one, the "Risk" (defined below) of the portfolio. The program will then finally choose the portfolio with the lowest Risk and display it. The exact sequence of steps will be determined by the programmer, but the initial inputs and final outputs must be as specified above.
DEFINITION OF "RISK":
Risk shall be calculated with the following algorithm. Given a portfolio (list of stocks) and given a time period (one year). Loop through all of the dates in the time period. Calculate the value of the portfolio today compared to the value 7 days ago. For example if the value was $100,000.00 (always the starting value - this is a constant) and today it is $99,000.00, then the value has dropped 1%. The largest such drop (i.e. "largest decrease in value in a single 7-day period") for the entire year for a given portfolio is considered the Risk value of that portfolio.
Example:
The program could be executed with a list of 100 stocks and portfolio size of 10. There are approximately 75,000,000 possible combinations of 10 stocks out of a universe of 100. The program will loop through all 75,000,000 combinations, and for each, it will form a portfolio of 10 stocks allocated equally and totalling $100,000.00, and will calculate the Risk for each porfolio. The program will find the portfolio combination with the lowest Risk and display it.
**Please help me select the best bidder, by posting one paragraph that explains how you will tackle this project. Keep it simple - this project is not hard. Thanks**
## Platform
Java - Eclipse 3.2.2