Wednesday, 25 January 2017

Addition of Graph to Backtesting in Excel

Further to the post on backtesting using Excel, we will add a nice graph that shows the plot of SMA and LMA. Like in the last post, we will work with Excel 2016 for this post as well.

There are at least two reasons why we should be looking at graphs:

1) They are visually appealing. Graphs communicate better than just data.

2) They can be used as a first check to see if something is amiss.

We will continue with the results of this post. Adding the graph is quite simple with the following steps:

1) Add a new worksheet called Graph to the excel file by clicking + button as show below:



















2) Then, click on Graph worksheet and invoke the graphing feature as shown below:


3) Right click the empty area in the graph and click on Select Data as shown below:



















4) Then, click on appl worksheet and select data in Date, SMA and LMA columns as shown below:













5) Then, click on OK button to confirm the data source

6) This will take one to the Graph worksheet as shown below:















7) Then, extend it as shown below:














8) Click on y-axis and Right Click to select Format Axis as shown below:













9) Enter 80 in Minimum as shown below:




















This will alter the graph and it will be more informative on when the SMA line intersects the LMA line.

10) Then, click the + sign and check the box next to Axis Titles and Legend as shown below:












11) Change x-axis title to Date and y-axis title to SMA and LMA. Change the Chart Title to SMA & LMA versus Date as shown below:












12) Lastly, two boxes with text as "BUY" and "SELL" have been added to show the time line around which the transactions happened
















The graph looks okay. This concludes the addition of graph to backtesting of Excel post.