Explore BrainMass

# MATLAB Signal Analysis for Stock Closing Price

Not what you're looking for? Search our solutions OR ask your own Custom question.

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

%% see attached file for EWMA filter definition and closing price for Q csv file%%

Using the closing prices for Q for the 50 business day period from March 1, 2004, up to May 10 2004,

a. For the 40 day time period 11 < n < 50, compute the difference D[n]=y1[n] - y2[n] where y1[n] is the response of the 11 day EWMA filter with b=0.7.

b. Suppose that the stock is bought at the close on Day n when the value of D[n] rises above zero, and then the stock is sold at the close on day n when D[n] falls below zero. Determine the days when there is a buy and the days when there is a sell.

c. For each buy/sell signal found in part (b.), determine the loss or gain per share.

d. using your results in part (c.) determine the net gain or loss per share over the 40 day period.