Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4. Write a VBA subroutine to calculate cumulative returns (CR) over 1, 5, 10 and 30 days after each crossover. This subroutine also outputs
4. Write a VBA subroutine to calculate cumulative returns (CR) over 1, 5, 10 and 30 days after each crossover. This subroutine also outputs results for each buy signal in a new worksheet "buy", and for each sell signal in a new worksheet "sell", in the format below. Figure 2 A B C D E F G H 1 1-day CR # of buy 5-day CR # of buy 10-day CR # of buy 30-day CR # of buy 2 -0.00232 1 -0.01009 1 0.006793 1 0.053378 1 3 0 1 -0.0784 1 -0.06131 1 -0.09264 1 4 -0.01875 1 0.064984 1 0.327727 1 0.192697 1 Then, using excel, construct a summary result table across all the signals using the format in Table 2. Table 2 Summary statistics Holding Number period Strategy of Buy Number of Sell Average Average buy CR sell CR Buy-Sell 1 SMA 50, 200 5 SMA 50, 200 www 10 SMA 50, 200 30 SMA 50, 200 Note: Buy-Sell is the difference in returns between average buy CR and average sell CR.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started