Engineering 25
This presentation is the property of its rightful owner.
Sponsored Links
1 / 13

Bruce Mayer, PE Licensed Electrical & Mechanical Engineer [email protected] PowerPoint PPT Presentation


  • 32 Views
  • Uploaded on
  • Presentation posted in: General

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

Download Presentation

Bruce Mayer, PE Licensed Electrical & Mechanical Engineer [email protected]

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Bruce mayer pe licensed electrical mechanical engineer bmayer chabotcollege edu

Engineering 25

Prob 7.18SolutionStock Market Simulation:

Buy? Sell? Hold?

Bruce Mayer, PE

Licensed Electrical & Mechanical [email protected]


Scenario

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


Key to problem

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


Matlab code method 1

MATLAB Code: Method-1


Method 1 results 1 run

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 


Method 1 day by day

Method-1 Day-by-Day


Method 1 single run

Method-1 Single Run


Matlab code method 2

MATLAB Code: Method-2


Method 2 results

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


Method 2 plots

Method-2 Plots


Matlab code method 1 multirun

MATLAB Code: Method-1 →MultiRun


Method 1 499 runs

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


Method 1 499 runs1

Method-1: 499 Runs


  • Login