写作MET CS-677程序、 辅导Python编程设计程序

” 写作MET CS-677程序、 辅导Python编程设计程序BU MET CS-677: Data Science With Python, v.2.0 CS-677: Day Trading with OracleAssignmentIn this assignment, you will use Python to analyze the distributionof returns and a number of trading strategies. Thisassignment has to be done in Python only (no NumPy or Pandas)except for generating daily returns data and saving it toa file.As part of the preliminary assignment, you have generated adaily stock file for your stock and a daily file spy.csv for theSP-500 (using the symbol spy). For both files, you havedata for 2015 – 2019 (5 years).In this assignment, you will investigate 2 sets of questions concerningdaily returns1. If you buy a stock for just one day, what is the best day ofthe week to do so. Specifically you will analyze the dailyreturns for each day of the week. A Monday return isthe percent change in (adjusted) closing price from previousFriday to Monday. A Tuesday return is the percentchange in price from Monday to Tuesday and so on.2. comparison of returns if you have an oracle that can predictthe future behavior of your stock priceWe start with introducing some notation. Let R = {r1, . . . , rn}Page 1BU MET CS-677: Data Science With Python, v.2.0 CS-677: Day Trading with Oracledenote your daily returns for your stock for n days. The meanof the daily returns(R) = r1 + + rnnTo compute the standard deviation (R) we can useLet us split the daily returns R into two sets1. R: all negative returns2. R+: all non-negative returnsFinally, let |R| denote the number of days with negative returns,and |R+| denote the number of days with non-negativereturns.Question 1:1. for each of the 5 years, compute the mean and standarddeviation for the sets R, R and R+ of daily returns foryour stock for each day of the week2. summarize your results in the table as shown below (5 tablestotal).3. are there more days with negative or non-negative returns?Page 2BU MET CS-677: Data Science With Python, v.2.0 CS-677: Day Trading with OracleDay (R) (R) |R| (R) (R) |R+| (R+) (R+)MondayTuesdayWednesdayThursdayFriday4. does your stock lose more on a down day than it gainson an up days.5. are these results the same across days of the week?Question 2: Examine your 5 tables.1. are there any patterns across days of the week?2. are there Any patterns across different years for the sameday of the week?3. what are the best and worst days of the week to be investedfor each year.4. do these days change from year to year for your stock?Question 3: Compute the aggregate table across all 5 years,one table for both Your stock and one table for SP-500 (usingdata for spy).1. what is the best and worst days of the week for each?Page 3BU MET CS-677: Data Science With Python, v.2.0 CS-677: Day Trading with Oracle2. are these days the same for your stock as they are for SP-500?For the next questions, suppose that you have an oracle.On any day, this oracle could tell you whether price of anystock would increase or decrease the next day. Assume thatyou have no transaction costs. You start with $100 on the firsttrading day of 2015 to trade your stock and another $100 totrade spy.Question 4: You listen to the oracle and follow its advice.How much much money will you have on the last trading dayof 2019:1. your stock?2. SP-500 stock?Question 5: Consider buy-and-hold strategy: you buyon the first trading day and sell on the last day. So you do notlisten to your oracle at all. As before, assume that you startwith $100 for both your stock and spy.1. how much money will you have on the last trading day of2019?2. how do these results compare with results obtained in question4?Page 4BU MET CS-677: Data Science With Python, v.2.0 CS-677: Day Trading with OracleQuestion 6: Your oracle got very upset that you did notfollow its advice. It decided to take revenge by giving youwrong Advice from time to time. Specifically, let us considerthe following three scenarios:(a) Oracle gave you wrong results for the best 10 trading days.In other words, you missed the best 10 days and your overallprofit will be lower.(b) Oracle gave you wrong results for worst 10 trading days. Inother words, you missed the worst 10 days and your overallprofit will be higher.(c) Oracle gave you wrong results for best 5 days and for theworst 5 days.Please answer the following:1. for each of the scenarios above (a,b and c), compute thefinal amount that you will have for both your stock andspy2. do you gain more by missing the worst days or by missingthe best days?3. are the results in part (c) different from results that youobtained in question 4.如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导