31.07.2021 Views

Ultimate Algorithmic Trading System

Using automated systems for trading in stock markets

Using automated systems for trading in stock markets

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sub BollingerBand(dataList, length, numDevs, avg, upBand, dnBand,

index, offset)

Sub BollingerBand(dataList, length, numDevs, avg, upBand,

dnBand, index, offset)

Dim i As Integer

Dim sum, sum1, myDev As Double

For i = (index - offset) - (length - 1) To (index - offset)

sum = sum + dataList(i)

sum1 = sum1 + dataList(i) ^ 2

Next i

avg = sum / length

myDev = ((length * sum1 - sum ^ 2) / (length * (length - 1))) ^ 0.5

306

upBand = avg + myDev * numDevs

dnBand = avg - myDev * numDevs

EXCEL SYSTEM BACKTESTER

End Sub

Function Average(dataList, length, index, offset)

Function Average(dataList, length, index, offset)

Dim i As Integer

Dim sum, sum1, myDev As Double

For i = (index - offset) - (length - 1) To index - offset

sum = sum + dataList(i)

Next i

Average = sum / length

End Function

www.rasabourse.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!