Answered step by step
Verified Expert Solution
Question
1 Approved Answer
My Solutions > Task 1 (Stock prices, working with data, plotting) Load a Matlab data file named NYSEstock. It contains two arrays, stocki and stock2,
My Solutions > Task 1 (Stock prices, working with data, plotting) Load a Matlab data file named NYSEstock. It contains two arrays, stocki and stock2, each having 1738 rows and 6 columns. The columns contain the following information for each stock and each day in this order): time stamp in numeric form (you can see it in date form using Matlab's function datestr) opening price . maximal price minimal price closing price trade volume a) Count on how many days the closing price of stock 1 was higher than the closing price of stock2 (result variable sihigh), and on how many days it was lower (51low). b) Calculate returns of each stock (differences between given day's and previous day's closing price). You can use Matlab's function diff. Call the results siret and s2ret. c) Which of the stocks has the highers average returns? Variable mret should have value 1 if it's stock1 and value 2 if it's stock 2. d) Which of the stocks has the highest single day return? Variable dret should have value 1 if it's stock1 and value 2 if it's stock 2 e) Plot the data in one figure having the stock closing prices together, and in another one having the returns together. My Solutions > Task 1 (Stock prices, working with data, plotting) Load a Matlab data file named NYSEstock. It contains two arrays, stocki and stock2, each having 1738 rows and 6 columns. The columns contain the following information for each stock and each day in this order): time stamp in numeric form (you can see it in date form using Matlab's function datestr) opening price . maximal price minimal price closing price trade volume a) Count on how many days the closing price of stock 1 was higher than the closing price of stock2 (result variable sihigh), and on how many days it was lower (51low). b) Calculate returns of each stock (differences between given day's and previous day's closing price). You can use Matlab's function diff. Call the results siret and s2ret. c) Which of the stocks has the highers average returns? Variable mret should have value 1 if it's stock1 and value 2 if it's stock 2. d) Which of the stocks has the highest single day return? Variable dret should have value 1 if it's stock1 and value 2 if it's stock 2 e) Plot the data in one figure having the stock closing prices together, and in another one having the returns together
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started