首页 >
> 详细

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
- 微信：codinghelp

- Jit104留学生作业代做、代写it Systems作业、代做sql语言作业 2019-11-13
- 代做stat 3675Q作业、代写statistical课程作业、代做r程序 2019-11-13
- Csc 360作业代写、代做operating Systems作业、代写py 2019-11-13
- 代写cpt120留学生作业、代写programming课程作业、Java程序 2019-11-13
- Comp9444作业代做、Python程序设计作业调试、Python语言作业 2019-11-13
- 代做cs1026留学生作业、Analysis课程作业代写、代写python语 2019-11-13
- Lp002留学生作业代做、代写data Structures作业、代写jav 2019-11-13
- 代写comp 250作业、代做java编程设计作业、代写kdtree课程作业 2019-11-13
- Cmt107留学生作业代做、代写informatics课程作业、代做java 2019-11-12
- Econometrics作业代做、代写statistics课程作业、R程序语 2019-11-12
- 代做dataset课程作业、代写statistical Model作业、Py 2019-11-12
- 代写in1900留学生作业、代写python编程语言作业、Python实验作 2019-11-12
- Gv900留学生作业代写、代做r程序设计作业、代写r语言作业、Dataset 2019-11-12
- Cs255留学生作业代做、代写python语言作业、Timetabling作 2019-11-12
- 代做comp7510作业、Programming课程作业代写、Python， 2019-11-12
- 代写math1041作业、代做r程序语言作业、Moodle留学生作业代写、代 2019-11-12
- Comp3331作业代做、代写computer Networks作业、代做j 2019-11-12
- 代写stock Market作业、R编程设计作业代做、代写r语言作业、Dat 2019-11-11
- Cse130-01作业代做、代写c++实验作业、C/C++编程语言作业代做、 2019-11-11
- 代做module留学生作业、代写python程序设计作业、代做python语 2019-11-10