Instruction
I have chosen Amazon as my stock index. I attached the data as a pdf. Below are the step by step instructions.
Analyzing market trends
In this section, we will use one of the well-known composite indices (e.g. Nasdaq, S&P 500, Dow Jones) to try to gauge the trends of the market. We will assume that the index of your choice is a good representative of the stock market as a whole. You will use data points of the chosen index to create your own transition matrix for any changes in future market trends, and use this knowledge to predict market behaviour.
We will divide the market trend into 3 categories:
• If the index performs > 1% better than the previous week, classify the current week as bullish.
• If the index performs ≤ 1% better or worse than the previous week, classify the current week as stagnant. • If the index performs > 1% worse than the previous week, classify the current week as bearish.
GOAL: Use the known market to data to predict whether the market trend will be bullish, stagnant, or bearish in upcoming weeks.
Step 1.
Download and organize your data. Ask your hive TA which stock index your pod should use in your hive meeting on Wed, Oct. 21. Go to finance.yahoo.com and search for your index. Click Historical Data, then select a Weekly frequency. Set the time period to be exactly one year ago up to today. Click apply, then download. You may open up this data as a spreadsheet. Create another column and use a formula in Excel to determine whether each week is bullish, stagnant, or bearish.
Step 2.
Estimate transition probabilities. In order to make predictions, we’ll need to estimate the probabilities that the market will change from one state (bullish, stagnant, or bearish) to another.
Let pij represent the probability that the market will transition to state i next week, given that the market is currently in state j. Here, i and j may each be equal to 1, 2, or 3, to represent a bullish, stagnant, or bearish state respectively. We assume that these probabilities are constant in time.
In order to estimate each pij, start by focusing on all weeks in state j. Out of all the weeks in state j, in how many of them did the market move to state i in the following week? Divide this number by the total number of weeks in state j to obtain an estimate for pij. (For example, to compute p12, divide the number of times that the market moved from stagnant to bullish by the total number of stagnant weeks.)
Find the transition matrix which consists of entries pij.
Step 3
Use the information above to classify the market trend of the current week. What are your predictions for the the next week and for the week after that? Please use your transition matrix and be as precise as possible. Interpret your answer using English sentences.