首页 >
> 详细

Assignment 3

Due: Oct 21st, 2019 at 9:59 am

Question 1: Quantmod package (30 Points)

Quantmod is a powerful package when downloading daily equity data. During the class time, I

only present part of the functions from this package. To solve this question, you are required

to use functions from this package.

1. Download 1 year length data for an equity (You can select any equity you like), set the

start time as Jan. 1st, 2018 and end time as Dec 31st, 2018.

2. Calculate daily return using functions from this package. In this question, you shall calculate

both simple return and log return. (The two return sequences will be used in the

next question.)

3. Use chartseries() to add a Relative Strength Index line one the equity you selected. When

visualize this index, please use the default setting. Later, explain how to use this index in

equity trading.

Question 2: Basic statistics value and self-defined function (20

Points)

In this question, you need to design a self-defined function to calculate the first moment up to

the fourth moment for the return sequences you obtained from Question 1. To help you build

this function, please following instructions:

1. Your input should be a vector. Other than this format, your function should stop working

and send the user a warning message.

2. Calculate the first moment up to fourth moment for your input.

3. The object you want to return should be a “report”, this report should contain values

from step 2. Meanwhile, you should tell the user the data is left skew or right skew, heavy

tail or short tail.

Question 3: Data visualization (50 points)

In Question 1, you are required to generate the Relative Strength Index using the function from

Quantmod. In this question, you are required to generate this index by yourself without using

any package. Please use the same equity data you downloaded in Question 1.

1. The final goal is generating a figure which contains two plots. One for the equity price

movement. Another one for the index. Make sure you have proper title, x-label, y-label,

legend and etc. in your plot.

2. Investigate how to calculate the RSI index in detail. Make sure you will have the index

value for all trading days between Jan. 1st, 2018 and Dec 31st, 2018. (Hint: you may

need extra equity data to replicate the same result as you have in Question 1)

3. Based on the index value you get, how many times you observe a strong selling signal

(higher than 70)? How many times you observe a strong buying signal? (lower than 30)

Bonus: Discussion on the Relative Strength Index (50 Points)

Let’s do something new on the Relative Strength Index. Instead of using a fixed threshold in

equity trading, we can design a trading algorithm by ourself.

1. In order to accomplish this task, you need to prepare two data sets: A training data set

which contains 1 year length of data, a testing data set which contains 6 months of equity

data. (0 Points)

2. Based on the RSI values you obtained from the training data set. Find out which statistical

distribution it may apply to. In order to achieve this goal, you need to try at least three

different distributions. (10 Points)

3. Determine the threshold for the buying/selling signal. Let’s say this, when the index value

is outside the 95% confidence interval, you will buy/sell this equity accordingly. (10 Points)

4. Implement the threshold you set up from the previous step to the test data set. How much

money you may earn/loss after 6 month trading? Assume every time you observe this

signal, you will buy/sell 1 share of this equity. Please remember, on the last trading day,

you should not hold any equity in your hand. (20 Points)

5. Comment on your final result and discuss about the algorithm performance. In this part,

I want to see your thinking about using this index in equity trading. (10 Points)

联系我们

- QQ：99515681
- 邮箱：99515681@qq.com
- 工作时间：8:00-23:00
- 微信：codinghelp2

- 代写artificial课程作业、Java，Python程序语言作业调试、C 2020-05-27
- Comp Sci 3306作业代写、Python编程语言作业调试、代做jav 2020-05-27
- Data留学生作业代写、代做r课程设计作业、Analytics作业代做、R编 2020-05-27
- Csci 3120作业代做、C++程序语言作业调试、代做c/C++课程作业、 2020-05-26
- 代写algorithms作业、Data留学生作业代做、代写java、Pyth 2020-05-26
- Data Science作业代写、C++程序设计作业代写、Programmi 2020-05-26
- Data课程作业代写、C++编程设计作业调试、C/C++语言作业代做、Alg 2020-05-26
- 代写r留学生作业、代做data课程作业、代写r编程语言作业代做r语言编程|调 2020-05-25
- Cosc473作业代做、Systems作业代写、Python编程设计作业调试 2020-05-25
- Data留学生作业代做、R编程设计作业调试、R语言作业代写、Program课 2020-05-25
- Comp 250 Assignment 3 2020-05-24
- Macm 316 – Computing Assignment 7 2020-05-24
- Sta457 Assignment 2020-05-24
- Homework 10 2020-05-24
- Lab 2 Msc: Time Series Prediction With... 2020-05-24
- Comp2011作业代做、Data Analysis作业代写、C++编程语言 2020-05-24
- 代做compsys201作业、Python，Java，C/C++编程语言作业 2020-05-24
- Program留学生作业代做、Python编程设计作业调试、Data作业代写 2020-05-24
- 代写 Practical 3 Covid-19程序作业，代写... 2020-05-23
- 代写comp3059作业、代做programming作业、Java语言作业代 2020-05-23