In this assignment, you will use Python to analyze the dis- tribution of returns and a number of trading strategies. Thi

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

In this assignment, you will use Python to analyze the dis- tribution of returns and a number of trading strategies. Thi

Post by answerhappygod »

In this assignment, you will use Python to analyze the dis-tribution of returns and a number of trading strategies. Thisassignment has to be done in Python only (no NumPy or Pan- das)except for generating daily returns data and saving it to a file.As part of the preliminary assignment, you have generated a dailystock file for your stock and a daily file ”spy.csv” for theS&P-500 (using the symbol ”spy”). For both files, you have datafor 2015 - 2019 (5 years). In this assignment, you will investigate2 sets of questions con- cerning daily returns If you buy a stockfor just one day, what is the best day of the week to do so.Specifically you will analyze the daily returns for each day of theweek. A ”Monday” return is the percent change in (adjusted) closingprice from previ- ous Friday to Monday. A ”Tuesday” return is thepercent change in price from Monday to Tuesday and so on.comparison of returns if you have an ”oracle” that can pre- dictthe future behavior of your stock price We start with introducingsome notation. Let R = {r1, . . . , rn} denote your daily returnsfor your stock for n days. The mean of the daily returns μ(R) = (r1+ . . . + RN)/N To compute the standard deviation σ(R) we can use21n2 σ (R) =(r^2+... + r^2)/n − μ ^2(R) Let us split the dailyreturns R into two sets 1. R−: all negative returns 2. R+: allnon-negative returns Finally, let |R−| denote the number of dayswith negative re- turns, and |R+| denote the number of days withnon-negative returns. For the next questions, suppose that you havean ”oracle”. On any day, this oracle could tell you whether priceof any stock 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 Specifically, let usconsider the following three scenarios: (a) Oracle gave you wrongresults for the best 10 trading days. In other words, you missedthe best 10 days and your overall profit will be lower.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply