University | Singapore University of Social Science (SUSS) |
Subject | Python Programming |
Question 1
An analyst wants to test the simple moving average (MA) strategy. She has a hypothesis— if a stock has many instances of long-MA and short-MA crossover in a month, it is a bullish signal. She wanted to test if her hypothesis is correct by back-testing it with historical stock prices.
Figure 1 illustrates the crossover of a long MA and a short MA. The details of calculating MA values using daily closing stock prices are given in Appendix A. In the figure, there are three (3) instances in May-2010 where the 7-days and 3-days MA crossed over. The crossovers are observed on dates denoted by the vertical blue lines.
Figure 1. The crossover instances of the 7-day and 3-day MA of an unknown
stock.
The MA values are calculated using daily closing prices.
Given the following Python inputs, determine if the analyst’s hypothesis is correct.
Make use of the alpha vantage module to download the prices of stock from start_dt to end_dt.
Hire a Professional Essay & Assignment Writer for completing your Academic Assessments
Native Singapore Writers Team
- 100% Plagiarism-Free Essay
- Highest Satisfaction Rate
- Free Revision
- On-Time Delivery
Question 2
Evaluate the values of short- and long-MA for stock in the analysis period.
Question 3
Evaluate all the instances where the long- and short-MA cross over. Hence, calculate the number of crossover instances in every month of the analysis period.
Question 4
To test her hypothesis, the analyst needs to know the return of each month in the analysis period. The return for a month t, r(t) is calculated using
where Pt, start and Pt, end are the stock prices at the first and last trading date of the month t. Evaluate the monthly return for each month in the analysis period using Equation (1).
Buy Custom Answer of This Assessment & Raise Your Grades
Singaporeassignmenthelp.com is the best place to turn to when you need college assignment help. With a team of experts and an extensive library of resources, we have all of your best interests at heart to ensure your paper meets academic requirements with accuracy and precision. Our commitment to excellence ensures that the finished product exceeds expectations, so you can confidently submit it for the best possible grade. For students looking for a trusted online assignment writing service, we have you covered.
Looking for Plagiarism free Answers for your college/ university Assignments.
- ECE210 Advocacy and Collaborations with Families Assignment: Supporting Young Children Through Grief and Family-Centered Partnerships
- ACC707 Accounting and Finance Assignment: Evaluating Investment Decisions, Budgeting Strategies, and Financial Performance Analysis
- NCO201 Learn to Learn, Learn for Life TMA-01: Developing Self-Directed Learning Through the Journey of Mastering Public Speaking
- PSS219 Public Safety and Security in Singapore Group-Based Assignment: Strengthening National Resilience Through Policy Responses from the 2025 Committee of Supply Debate
- MTH240 Engineering Mathematics I Assignment: Heat Transfer, Chemical Balancing, Circuit Analysis, Signal Processing, and Matrix Theory
- Engaging Youth with IBM Skills Build Assignment: Designing Innovative Strategies for Skill Development and Career Growth
- BUS368 Innovation Management and Digital Transformation Assignment: Managing Innovation in Foldable, Trifold, and Stretchable Display Technologies
- BUS366 Assignment: Process Improvement and Recruitment Optimization Using Lean Six Sigma Methodology
- HBC203 Statistics and Data Analysis for the Social and Behavioural Sciences TMA-01: A Comparative Analysis of Workplace Wellbeing Interventions and Their Impact on Employee Productivity
- BCAF003 Business Accounting Assignment: A Comprehensive Study on Bank Reconciliation, Cash Controls, Inventory Valuation, and Financial Analysis