1 / 13

Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu

Engineering 25. Prob 7.18 Solution Stock Market Simulation: Buy? Sell? Hold?. Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu. Scenario. Behavior of Certain Stock Price, P, is randomly set by NORMAL distribution µ = $100 σ = $5

hallie
Download Presentation

Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Engineering 25 Prob 7.18SolutionStock Market Simulation: Buy? Sell? Hold? Bruce Mayer, PE Licensed Electrical & Mechanical EngineerBMayer@ChabotCollege.edu

  2. Scenario • Behavior of Certain Stock • Price, P, is randomly set by NORMAL distribution • µ = $100 • σ = $5 • Simulate Stock behavior over 250 days (1 trading year) • Trading Algorithm • If P<100, → BUY 50 Shares • If P>105 → SELL ALL shares • If 100< P < 105 → HOLD • Add to Profit the Value of Stock HELD at END of Year

  3. Key to Problem • The Critical Issue required to get close to the BOOK answer is to realize: • That at YEAR’S END we must Assess the Value of Any Shares NOT SOLD • We will Very Likely (84.13% chance) have shares “Left Over” if P250 < $105 • Add the Held-Over Value to the previous selling profit

  4. MATLAB Code: Method-1

  5. Method-1 Results (1-Run) =Stock purchase Profit summary = SellDays = 38 BuyDays= 133 HoldDays= 79 NoSharesLeftInPortfolio= 50 YearEndPrice= 98.9097 YearEndValue= 4.9455e+003 DailyProfit= 6.4715e+004 TotalProfit= 6.9660e+004 

  6. Method-1 Day-by-Day

  7. Method-1 Single Run

  8. MATLAB Code: Method-2

  9. Method-2 Results mean_yearly_profit= 6.5054e+004 min_yearly_profit= 4.9024e+004 max_yearly_profit= 9.0948e+004 std_profit= 5.7442e+003 MEAN_YrEnd_Price= 99.8867 AVG_YrEnd_Shares= 154.4088 MIN_YrEnd_Shares= 0 MAX_YrEnd_Shares= 1250

  10. Method-2 Plots

  11. MATLAB Code: Method-1 →MultiRun

  12. Method-1: 499 Runs = Stock purchase Profit summary = MAXProfit= 8.5555e+004 MINProfit= 4.6147e+004 AvgProfit = 6.4593e+004 StdPprofit= 5.7947e+003 AvgEndShares= 168.0361

  13. Method-1: 499 Runs

More Related