Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Vector Calculus for Engineers CME100, Fall 2004 Problem Set #6 (Double Integrals in Polar Coordinates, Triple Integrals) Date: 11/3/2004 Due: 11/10/2004 Reading: Thomas 12.3-12.4 Exercises: Section 12.2: p. 997 Exercises 8, 24, 34, 43, 49, 54 Section 12.3: p. 1005 Exercises 6, 16, 18, 24, 32 Section 12.4: p. 1014 Exercises 4, 8, 32, 36 MATLAB Workbook (optional): Exercises 20, 21 Problem 1 Suppose the price of a certain stock has been observed over a period of time and, based on past performance, is modeled as a random number centered around $100 per share. Write a MATLAB program to simulate the effects of buying 50 shares of this stock whenever the price is below $100 per share, and selling all the shares whenever the price is above $105 per share. The broker charges 6 cents per share bought or sold with a minimum fee of $40 per transaction. Assume you only make one transaction per day. a) Determine the expected outcome of this strategy over 250 days (the approximate number of business days in a year) by averaging the total profit at the end of the year over 100 runs. The profit is equal to the yearly income from selling stock plus the value of the stock you own at the end of the year b) Plot the typical daily behavior over the period of one year of the stock price, the amount of cash available, and the number of shares owned c) Comment on the above trading strategy based on the results of your simulation Hints: 1) To generate a vector of 250 daily stock prices centered around $100, use the following function: normrnd(100,5,250,1) 2) Define two vector quantities: cash available and shares owned. At each step (trading day) implement the decision logic to buy shares (increase the total number of shares owned while reducing the amount of cash available), sell shares (decrease the total number of shares to zero while increasing the amount of cash available), or do nothing, based on the value of the stock price on a given day.