*Glen Bradford *IE 335 set Date /"6/1/2007","3/1/2007","12/1/2006","9/1/2006","6/1/2006"/; set Stock /"MMM","AA","MO","AXP","AIG","T","BA","CAT","C","DD"/; Parameter qtyOwnedMax /5/; parameter qtyTotal /10/; Parameters SlopeOverPrice(Date,Stock)/"6/1/2007"."MMM" 0.003765, "6/1/2007"."AA" 0.011143, "6/1/2007"."MO" 0.005789, "6/1/2007"."AXP" 0.006154, "6/1/2007"."AIG" 0.005114, "6/1/2007"."T" 0.020043, "6/1/2007"."BA" 0.014259, "6/1/2007"."CAT" 0.007852, "6/1/2007"."C" 0.007752, "6/1/2007"."DD" 0.009947, "3/1/2007"."MMM" 0.0012, "3/1/2007"."AA" 0.007549, "3/1/2007"."MO" 0.010388, "3/1/2007"."AXP" 0.003754, "3/1/2007"."AIG" 0.007302, "3/1/2007"."T" 0.017343, "3/1/2007"."BA" 0.013946, "3/1/2007"."CAT" -0.00714, "3/1/2007"."C" 0.00645, "3/1/2007"."DD" 0.004875, "12/1/2006"."MMM" -0.00125, "12/1/2006"."AA" 0.003116, "12/1/2006"."MO" 0.009605, "12/1/2006"."AXP" 0.002714, "12/1/2006"."AIG" 0.005257, "12/1/2006"."T" 0.013698, "12/1/2006"."BA" 0.015369, "12/1/2006"."CAT" -0.01683, "12/1/2006"."C" 0.004136, "12/1/2006"."DD" -0.00343, "9/1/2006"."MMM" -0.00306, "9/1/2006"."AA" -0.00113, "9/1/2006"."MO" 0.012062, "9/1/2006"."AXP" -0.0007, "9/1/2006"."AIG" 0.002235, "9/1/2006"."T" 0.007981, "9/1/2006"."BA" 0.017654, "9/1/2006"."CAT" -0.01783, "9/1/2006"."C" 0.00293, "9/1/2006"."DD" -0.00785, "6/1/2006"."MMM" -0.00199, "6/1/2006"."AA" -0.00283, "6/1/2006"."MO" 0.015591, "6/1/2006"."AXP" 0.000735, "6/1/2006"."AIG" -0.00181, "6/1/2006"."T" 0.002473, "6/1/2006"."BA" 0.017948, "6/1/2006"."CAT" -0.01242, "6/1/2006"."C" 0.002734, "6/1/2006"."DD" -0.00516/; Parameters STD(Date,Stock)/"6/1/2007"."MMM" 5.010395, "6/1/2007"."AA" 4.152745, "6/1/2007"."MO" 6.333902, "6/1/2007"."AXP" 3.737109, "6/1/2007"."AIG" 3.873814, "6/1/2007"."T" 6.080183, "6/1/2007"."BA" 10.3466, "6/1/2007"."CAT" 7.73738, "6/1/2007"."C" 3.267597, "6/1/2007"."DD" 4.266817, "3/1/2007"."MMM" 3.850304, "3/1/2007"."AA" 2.716643, "3/1/2007"."MO" 7.042435, "3/1/2007"."AXP" 2.705901, "3/1/2007"."AIG" 4.941039, "3/1/2007"."T" 5.150714, "3/1/2007"."BA" 9.384192, "3/1/2007"."CAT" 11.53758, "3/1/2007"."C" 2.942641, "3/1/2007"."DD" 3.57126, "12/1/2006"."MMM" 4.731982, "12/1/2006"."AA" 2.402004, "12/1/2006"."MO" 6.433097, "12/1/2006"."AXP" 2.568917, "12/1/2006"."AIG" 5.086035, "12/1/2006"."T" 3.879988, "12/1/2006"."BA" 10.29384, "12/1/2006"."CAT" 13.97131, "12/1/2006"."C" 2.525878, "12/1/2006"."DD" 3.84759, "9/1/2006"."MMM" 4.767502, "9/1/2006"."AA" 2.672129, "9/1/2006"."MO" 7.44226, "9/1/2006"."AXP" 1.805689, "9/1/2006"."AIG" 4.445695, "9/1/2006"."T" 2.483461, "9/1/2006"."BA" 10.42303, "9/1/2006"."CAT" 14.83402, "9/1/2006"."C" 1.916008, "9/1/2006"."DD" 3.801939, "6/1/2006"."MMM" 4.437891, "6/1/2006"."AA" 2.848097, "6/1/2006"."MO" 9.151405, "6/1/2006"."AXP" 1.97421, "6/1/2006"."AIG" 5.091366, "6/1/2006"."T" 1.292197, "6/1/2006"."BA" 10.80262, "6/1/2006"."CAT" 14.60001, "6/1/2006"."C" 1.894074, "6/1/2006"."DD" 3.64037/; Parameters QTRCHNG(Date,Stock) /"6/1/2007"."MMM" 0.078235, "6/1/2007"."AA" -0.03479, "6/1/2007"."MO" -0.0087, "6/1/2007"."AXP" -0.02958, "6/1/2007"."AIG" -0.03399, "6/1/2007"."T" 0.019518, "6/1/2007"."BA" 0.091826, "6/1/2007"."CAT" 0.00166, "6/1/2007"."C" -0.09008, "6/1/2007"."DD" -0.02518, "3/1/2007"."MMM" 0.135549, "3/1/2007"."AA" 0.195575, "3/1/2007"."MO" -0.20123, "3/1/2007"."AXP" 0.084752, "3/1/2007"."AIG" 0.041803, "3/1/2007"."T" 0.052498, "3/1/2007"."BA" 0.081543, "3/1/2007"."CAT" 0.168134, "3/1/2007"."C" -0.00097, "3/1/2007"."DD" 0.028525, "12/1/2006"."MMM" -0.01925, "12/1/2006"."AA" 0.129623, "12/1/2006"."MO" 0.023188, "12/1/2006"."AXP" -0.07038, "12/1/2006"."AIG" -0.06196, "12/1/2006"."T" 0.102937, "12/1/2006"."BA" 0.000788, "12/1/2006"."CAT" 0.09294, "12/1/2006"."C" -0.07828, "12/1/2006"."DD" 0.014781, "9/1/2006"."MMM" 0.047165, "9/1/2006"."AA" 0.070257, "9/1/2006"."MO" 0.121097, "9/1/2006"."AXP" 0.081847, "9/1/2006"."AIG" 0.081497, "9/1/2006"."T" 0.097973, "9/1/2006"."BA" 0.126696, "9/1/2006"."CAT" -0.06793, "9/1/2006"."C" 0.121401, "9/1/2006"."DD" 0.137021, "6/1/2006"."MMM" -0.07862, "6/1/2006"."AA" -0.1335, "6/1/2006"."MO" 0.042489, "6/1/2006"."AXP" 0.053739, "6/1/2006"."AIG" 0.1221, "6/1/2006"."T" 0.167444, "6/1/2006"."BA" -0.03736, "6/1/2006"."CAT" -0.11654, "6/1/2006"."C" 0.02943, "6/1/2006"."DD" 0.029808/; *This is the quantity of stocks owned for each quarter *This is the indicator variable for which stocks are owned during which period binary variable own(Date,Stock); *This is the average Standard Deviation for a Quarter positive variable averageSTD(Date); *This is the variable that we want to maximize, it's the sum of the slopes free variable slope; *This variable gives the profit using the algorithm that we designed to maximize profits free variable rotationprofit; *This variable is the average profit of the entire system, ideally rotation profit is greater than the average profit free variable averageprofit; equations calcAvgSTD(Date), MaxSTD(Date), calcRotationProfit, calcAverageProfit, calcSlope; *This equation calculates the slope that we are trying to maximize calcSlope.. slope =e= sum((Date,Stock),own(Date,Stock) * SlopeOverPrice(Date,Stock) / qtyOwnedMax); *This equation calculates the rotation profit calcRotationProfit.. rotationprofit =e= sum((Date,Stock),own(Date,Stock) * QTRCHNG(Date,Stock) / qtyOwnedMax); *This equation calculates the average profit calcAverageProfit.. averageprofit =e= sum((Date,Stock), QTRCHNG(Date,Stock) / qtyTotal); *This calculates the average standard deviation (or risk) calcAvgSTD(Date).. averagestd(Date) =e= sum(Stock, STD(Date,Stock) / qtyTotal); *This keeps the STD of the basket of stocks chosen below the average MaxSTD(Date).. sum(Stock,own(Date,Stock) * STD(Date,Stock)) / qtyOwnedMax =l= averageSTD(Date); model finalproject /all/; solve finalproject using mip maximizing slope;