21
TASC Traders’ Tip: Buff Average
Buff average was an indicator example I have written back in February, 2001, it was written in VBScript and did not take advantage of existing indicators, which make the code more complex than it needs to.
So I will take this chance to show how to convert VBScript into formula language, since vbscript version of this indicator is similar to some of the other software indicators out there, by providing this example I hope it could hlep with converting indicator from other platform in the future.
See below for source in VBScript:
What VBScript code does is it has to loop through all values of a data series to get an accumulation result, this will be a slow process when data series have a large number of bars.
See below for source in formula:
The revised buff average formula code show how using summation indicator can get accumulation of values without going back and looping through historical data. Also since summation is a build in indicator along with the use of formula language, this indicator will have a speed advantage over the indicator written in VBScript.
Download