Excel Benchmark 2011: An Excel Speed Test (with trading functions)

Live Analysis of Benchmark Results

Of 4556 Benchmark results, currently the Excel version with the highest *average Total Score of 58.42 is Excel 2013. Excel 2010 has an average Total Score of 49.33. Excel 2002 has an average Total Score of 47.46. Excel 2003 has an average Total Score of 42.94 and the worst average Total Score is Excel 2007 at 23.6.

Of the top 30 scores, 90% of the processors brand name is Intel. Followed by AMD which is the processor in 10% of the top 30 results. The exact processor with the current top score of 123.8243 is Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz. It's likely that this processor is overclocked beyond what is shown on the benchmark results page and is not necessarily the top performing processor at default settings.

Of the six tests used to determine Total score, Test 3 shows the most variance between Excel Versions. For example the best score for test 3 in Excel 2003 is 56785 while the best test 3 score for 2010 is 24137896 so for test three, Excel 2003 performs 0.24% better when only the best scores are considered. Test 3 measures how many ticks can be displayed on a stock chart within a 30 second time period. The other tests composing Total Score involve more intensive calculation tests than this charting display test. Although this difference is large, Test 3 should only be considered over Total Score for the most charting intensive Excel programs where VBA and/or formula based calculations are relatively minimal. For most Trading applications Total Score which is a composite of the 6 tests is the most useful score to use for evaluating Excel versions/Processors/OS etc.

Of the 4556 current results 738 are below 0. I would not consider any system scoring below 0 adequate for running an excel based trading system. A modern system scoring below 0 should be checked for unnecessary startup programs, spyware, viruses etc.

*Scores below 0 are set to zero for purposes of calculating average total score.

BenchMark_ET.xls measures Excel performance with 6 trading related Excel/VBA tests. Once the benchmark is complete, your results can be submitted to the Database (just press “Submit”). All submitted results are available here (all results are sortable). The default view is most recently submitted result topmost (so your result should be on top until you sort). System Information is listed along with each test result (processor name, OS, Clock Speed, Cores, Excel Version, File type). A composite Scoring system is in place, but each individual test result is also listed in the results database. All results can be sorted in ascending/descending order by clicking each result’s title. For best results disable autosave and background error checking in Excel options.

Instructions:

  1. Download Benchmark_ET.xls.
  2. Open Benchmark_ET.xls and press the button “Start Benchmark”
  3. (optional) Submit and view your results.

Benchmark for Excel by Exceltrader

Below is an explantion of each test:

Test 1: Data Build Time

Measures the time it takes VBA to create 5 columns * 65535 rows of random tick data.

Test 2: MACD VBA Calculation

Measures the time it takes VBA to calculate the MACD indicator for the 5 columns * 65535 rows of data created in test one. (The VBA code for the MACD calculation is here.)

Test 3: Dispayed Ticks (30 Sec)

Measures the number of ticks (price changes) than can be displayed in 30 seconds. In my original benchmark this was the only type of test. The results varied so greatly that newer versions of excel took hours to complete the benchmark while older versions took just minutes making the benchmark annoying to run. By limiting this test to 30 seconds the total time to run the benchmark will be similar among all systems tested.

Test 4: 63000 ticks converted to OHLC

After 63000 ticks are created, this test converts the tick data to OHLC data. The result is measured in time.

Test 5: Live formula Test

This test begins with with 5000 bars of OHLC and a series of formula based indicators. The last price changes in E5000 as rapidly as possible but waits for all formulas to calculate between each price change.  The benchmark result is the number of price changes that can be completed with formula recalculations within 30 seconds.  Below is the list of indicators calculated with live formulas in this test.

  1. SMA (100,200,300)
  2. RSS
  3. RSI
  4. Fisher Transform of RSI

Test 6: Live formula Test

This test is identical to test 5 except that all formulas also refer to and are dependent on the changing cell, E5000. Test 6  compared to Test 5  is meant to test the “smart recalculation engine” promoted by Microsoft.  More info can be found in this Microsoft article under the section titles “Understanding Calculation Methods in Excel”.

Scoring:

A composite scoring system is in place and the result is listed in column two on the results data base page and also at the top of the benchmark results form upon completion. With the exception of test 3 all tests are counted equally. Test 3, which tests displayed ticks on a stock chart is counted 3 times because for trading it’s an important result to consider. To establish the composite score 20 tests were run on various systems and excel versions. The best and worst scores for each test were used to establish the benchmark score. The best scores from the initial tests resulted in a score of 100 and the worst scores resulted in a score of 0 therefore scores greater than 100 and below 0 are possible.  On the results page idle processor speed is shown and overclocked systems may not show the true processor speed. If you see two systems that look the same with significantly different scores, the higher score is likely from an overclocked system. Thanks for trying my Excel benchmark and submitting your system’s result!

 

Stochastics Indicator – Excel VBA and Formula versions

This post includes  two example excel files that show both VBA and Formula based calculations for the indicator "Stochastics".

Both files contain the exact same set of Open High Low Close data. The formula based version should be easier to understand and serves as a way to verify that the VBA code that I wrote is correct. Both methods give the same result for both %k and %D.  The major benefit of using VBA is that the parameters for Stochastics can be easily changed from the input boxes. In addition the VBA method shows only the final result rather than take up five columns.

The VBA based version can be downloaded here.

The formula version can be downloaded here. Below is an image of the formulas used in the formula based version.

StochasticFormula

Below is the code that I wrote for the VBA based version.

Sub ETstochastic() 'written by Exceltrader www.exceltrader.net
Dim StochSetting As Integer, Ksetting As Integer, Dsetting As Integer
Dim A() As Double, B() As Double, C() As Double, D() As Double, E() As Double
Dim Count As Long
Dim Xcounter As Integer, Xavg As Double
Dim Zcounter As Integer, Zavg As Double
Dim x As Integer, y As Integer, z As Integer
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''  The below three lines are the Stochastic settings.
''  The Values can either be changed here or uncomment the inputbox lines to be prompted.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
StochSetting = 14 'InputBox(Prompt:="Enter Stoch settings Number of Periods.", Title:="Stochastic Period", Default:="13")
Ksetting = 2 'InputBox(Prompt:="Enter Moving Average For %K", Title:="%K Setting", Default:="5")
Dsetting = 3 'InputBox(Prompt:="Enter Moving Average For %D", Title:="%D Setting", Default:="6")
Set ws = ThisWorkbook.Worksheets("Svba")
    With ws
    LR = .Cells(Rows.Count, "A").End(xlUp).Row
'does the same as formula =E15-(MIN(D1:D15))
        For Each DataRange In ws.Range(.Cells(2, "A"), .Cells(LR, "A"))
        Count = DataRange.Row
        ReDim Preserve A(1 To Count)
                If Count >= StochSetting + 1 Then
                     A(Count) = .Cells(Count, "E") - Application.Min(ws.Range(.Cells(Count - StochSetting, "D") _
                     , .Cells(Count, "D")))
                End If
        Next DataRange
     'does the same as formula   =MAX(C36:C50)-MIN(D36:D50)
        For Each DataRange In ws.Range(.Cells(2, "A"), .Cells(LR, "A"))
        Count = DataRange.Row
        ReDim Preserve B(1 To Count)
                If Count >= StochSetting + 1 Then
                     B(Count) = Application.Max(ws.Range(.Cells(Count - StochSetting, "C"), .Cells(Count, "C"))) _
                     - Application.Min(ws.Range(.Cells(Count - StochSetting, "D"), .Cells(Count, "D")))
                     End If
        Next DataRange
        '=100*(I50/J50)
        ReDim Preserve C(StochSetting + 1 To UBound(B))
            For Count = StochSetting + 1 To UBound(B)
                   C(Count) = (A(Count) / B(Count)) * 100
            Next Count
        '=AVERAGE(K49:K50)
        ReDim Preserve D(StochSetting + Ksetting To UBound(B))
            For Count = StochSetting + Ksetting To UBound(B)
                For Xcounter = Count - Ksetting + 1 To Count 'just go back and get the first C and go forward to current
                    Xavg = C(Xcounter) + Xavg
                Next Xcounter
                D(Count) = Xavg / Ksetting
                Xavg = Empty
            Next Count
            ReDim Preserve E(StochSetting + Ksetting + Dsetting - 1 To UBound(B))
            For Count = StochSetting + Ksetting + Dsetting - 1 To UBound(B)
                For Zcounter = Count - Dsetting + 1 To Count 'just go back and get the first C and go forward to current
                    Zavg = D(Zcounter) + Zavg
                Next Zcounter
                E(Count) = Zavg / Dsetting
                Zavg = Empty
            Next Count
  x = Empty: y = Empty: z = Empty
  x = LBound(E)
  y = UBound(E)
  'put the stochastics on the workbook. Change column Letter as needed
  .Cells(x - 1, "J") = "%D"
  .Cells(x - 1, "I") = "%K"
  For z = x To y
  .Cells(z, "J") = E(z)
  .Cells(z, "I") = D(z)
  Next z
End With
End Sub
            
            
            

MACD VBA

This post includes links to two example xls files that show both VBA and Formula based calculations for the indicator MACD or Moving Average Convergence Divergence.

Both files contain the exact same set of Open High Low Close data. The formula based version is easier to understand and serves as a way to verify that the VBA code that I wrote is correct. Both methods give the same result.  The major benefit of using VBA is that the parameters for MACD can be easy changed from the input boxes. In addition the VBA method shows only the final result rather than take up five columns.

The VBA based version can be downloaded here.

The formula version can be downloaded here. Below is the code from the VBA based version.

Sub ETmacd() 'written by Exceltrader www.exceltrader.net
Dim EMAslow As Double, EMAfAst As Double, ws As Worksheet, LR As Integer
Dim eMaF() As Double, eMaS() As Double, EMAdif(), emaPer() As Double, MacDper As Double, coUnt As Integer
Dim DataRange As Range
Dim ExPSlowWeight As Double
Dim ExPFastWeight As Double
Dim PerWeight As Double
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''  The below three lines are the MACD settings.                                         ''
''  The Values can either be changed here or uncomment the inputbox lines to be prompted.''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
EMAslow = 13 'InputBox(Prompt:="Enter Macd Slow settings.", Title:="MACD SLOW", Default:="13")
EMAfAst = 5 'InputBox(Prompt:="Enter Macd Fast settings.", Title:="MACD Fast", Default:="5")
MacDper = 6 'InputBox(Prompt:="Enter Macd Period settings.", Title:="MACD Period", Default:="6")
ExPSlowWeight = 2 / (EMAslow + 1)
PerWeight = 2 / (MacDper + 1)
ExPFastWeight = 2 / (EMAfAst + 1)
Set ws = ThisWorkbook.Worksheets("VBA") 'or use exact sheet name for example ThisWorkbook.worksheet("Sheet1")
'slow
    With ws
    LR = .Cells(Rows.coUnt, "A").End(xlUp).Row
        For Each DataRange In ws.Range(.Cells(2, "A"), .Cells(LR, "A"))
        coUnt = DataRange.Row + 1
        'fill the eMA slow Array
        ReDim Preserve eMaS(1 To coUnt)
                If coUnt = EMAslow + 1 Then
                    'get the first value which is the Simple Moving average
                     eMaS(coUnt) = Application.Average(ws.Range(.Cells(2, "E"), .Cells(coUnt, "E")))
                ElseIf coUnt > EMAslow Then
                    eMaS(coUnt) = (.Cells(coUnt, "E") * ExPSlowWeight) + (eMaS(coUnt - 1) * (1 - ExPSlowWeight))
                End If
        Next DataRange
'fast
        For Each DataRange In ws.Range(.Cells(2, "A"), .Cells(LR, "A"))
        coUnt = DataRange.Row + 1
        'fill the eMA slow Array
        ReDim Preserve eMaF(1 To coUnt)
                If coUnt = EMAfAst + 1 Then
                    'get the first value which is the Simple Moving average
                     eMaF(coUnt) = Application.Average(ws.Range(.Cells(2, "E"), .Cells(coUnt, "E")))
                ElseIf coUnt > EMAfAst Then
                    eMaF(coUnt) = (.Cells(coUnt, "E") * ExPFastWeight) + (eMaF(coUnt - 1) * (1 - ExPFastWeight))
                End If
        Next DataRange
        ReDim Preserve EMAdif(EMAslow To UBound(eMaF))
            For coUnt = EMAslow + 1 To UBound(eMaF)
                EMAdif(coUnt) = eMaF(coUnt) - eMaS(coUnt)
            Next coUnt
'MacD Period
        Dim x As Integer, y As Integer, z As Integer, Avee As Double
        y = EMAslow + MacDper - 1
            For x = y To UBound(EMAdif) - 2
                'get the SMA for first value
                If x = y Then
                        For z = EMAslow + 1 To EMAslow + MacDper  '(EMAslow + MacDper - 1)
                        Ave = Ave + EMAdif(z)
                        Next z
                        ReDim emaPer(x To LR)
                        emaPer(x) = Ave / MacDper
                ElseIf x > y Then
                emaPer(x) = (EMAdif(x + 1) * PerWeight) + (emaPer(x - 1) * (1 - PerWeight))
                End If
            Next x
  x = Empty: y = Empty: z = Empty
  x = LBound(emaPer)
  y = UBound(emaPer)
  For z = x To y - 1
  .Cells(z + 1, "J") = EMAdif(z + 1) - emaPer(z)
  Next z
End With
End Sub 'written by Exceltrader www.exceltrader.net

Suggested Excel Setup for Trading

The following are the settings that I recommend for using Excel for live trading and/or running my files such as simulator.xls etc.

  1. Disable Auto recover by selecting Tools>Options and selecting the “Save” tab. Uncheck “Save AutoRecover info every:”.  Instead make it a practice to always save backups of your trading files anytime you make changes.
  2. Once your file is complete and you are ready to trade, disable error checking by selecting Tools>Options and selecting the “error checking” tab. Uncheck “Enable background error checking”.
  3. Disable Macro Security, by selecting Tools>Macro>Security and setting it to low. If you are going to download excel files off the internet from untrusted sources, you will want to temporarily re enable macro security.
  4. As previously posted, I would not suggest using Vista/2007 unless you have a newer computer with extremely fast processor.