The Bollinger Band Toolkit for Financial Data Calculator

Basic Market Research Using Bollinger Bands

FDC is proud to be able to offer our users dedicated Bollinger Band functionality.  The descriptions and illustrations below explain how the functions contained in the FDC Bollinger Band Toolkit work.  Thus the explanations are specifically designed for those who have purchased the Bollinger Band Toolkit upgrade.  However the information presented can certainly be of use to everyone, and thus we make it available to all. 

The information presented here is not meant to be a replacement for the text (Bollinger on Bollinger Bands), but merely to be a quick “How to” guide, specifically with regard to using Financial Data Calculator for generating Bollinger Band applications.

Should you have any questions, we encourage you to refer to the text.  In fact, as an inducement, purchasers of the FDC Bollinger Band Toolkit are offered a special discount to purchase the text, if they have not already done so.

What are Bollinger Bands, and why use them?

One of the key determinants of future price action across all markets is volatility, and Bollinger Bands are a self-adjusting method of illustrating market volatility.  The method of their construction is to first establish a smoothed value for the recent market.  Typically this is done by taking a 20-day simple moving average.  The 20-day period is a good place to start, as there are approximately 20 trading days in an average month, and taking a 20-day average removes monthly cyclicality.  Next the 20-day moving standard deviation of the closing price is calculated.  This would be the value that would contain two-thirds of the price action of the close over that 20-day period.  Lastly the moving standard deviation is doubled and both added to and subtracted from the 20-day moving average. 

All versions of FDC have a macro that will produce Bollinger Bands.  If you go into FDC’s Macro Wizard and look up the formula for BBANDS here is what you will see:

@ BBANDS - computes Bollinger bands around moving average
@ syntax: #L  BBANDS  #R, where #L is two values, the first being the
@ time period, and the second being the number of standard deviations
@ the initial recommended values for #L are 20 and 2
@ #R represents the dataset
A: Close #R
N  M:   #L
B: N movave A
C: M * (N movstdv A)
(B + C), B, (B - C)

Note that text on any line following “ @ ” is unexecuted commentary, and letters preceding the colons are local variable names with their definitions following the colons.  The final line (without a local variable) produces the output.  In this macro, the value (B + C) is the upper band, the value B is the moving average, and the value (B – C) is the lower band.

If SPX has a default plot of bar chart, then the command

 SPX WITH ( 20  2  BBAND SPX) will produce the following chart:

Note that the Bollinger Bands do not fence-in all of the data.  Indeed, they are not supposed to.  Through extensive research, John Bollinger has determined that Bollinger Bands constructed with these parameters (20 days and 2 moving standard deviations) fence in about 89 percent of the data.  That’s actually a little surprising, as a statistician would expect approximately 95 percent of “normal” data to lie within the 2 standard deviations.  But over the years, the statisticians have learned that stock market data is not “normal”.

Viewing the price chart with its Bollinger Band envelopes answers the question as to whether the price is high or low on a relative basis.  The more volatile the data becomes, the more room provided in the envelopes.  Of particular interest is when the envelopes narrow down into what Bollinger defines as a “squeeze”.  Breakouts from a squeeze usually have significant carry-through.  You want to be on the right side of one of the squeeze breakouts, since being on the wrong side is painful.  We will show you how to screen for squeeze opportunities below.

The trading philosophy espoused by John Bollinger and the principals of Mathematical Investment Decisions Inc. (developers of FDC) is that traders should use all of the research presented here as a jumping-off point.  That is, the work illustrated here should be viewed as background basics to be experimented with and elaborated upon by the user. 

In that regard, FDC’s developers have deliberately made all parameters of functions in the Bollinger Bands Toolkit accessible, so that the user can change them.  For example, Bollinger recommends starting with a 20-period simple moving average and with bands of 2 moving standard deviations.  However some users may wish to smooth price data over 50 periods, while others will prefer a shorter period such as 10 days.  In those cases, the recommended starting envelope values are 2.5 and 1.5 moving standard deviations, respectively.  But the user is entirely free to try different values.  Indeed he is encouraged to do so.

The Basic Template

Although we recommend that the user experiment with different values for the various Bollinger Band Toolkit indicators, let’s begin with the simplest way to look at things.  Accordingly, the toolkit contains functions that display any dataset with Bollinger bands and a variety of related indicators.  If you request the “BasicTemplate” you will get a chart with four panels, the topmost of which is as follows:

Here we show you the share price of Microsoft (MSFT) as the plotted value.  It was produced by the input bbtk_basic msft ”.  In this top panel you will notice that the daily values are plotted as thick lines and in various colors.  These are Bollinger Bars, and they tell you several things at a glance.  The green area is the area of prices between the open and close, when the close is above the open.  That activity describes a day when the intra-day activity was bullish.  Red represents the same area, but where the close was below the open, representing bearish intra-day activity.  The blue areas represent the price action outside the open-close areas.  The closing price would thus be the uppermost green value or the lowermost red value.  The more such charts you see, the more you will realize that the intra-day activity is highly correlated to inter-day activity.  Thus the color codes help you quickly ascertain potential bullish or bearish activity.  Should you wish, FDC can easily plot daily prices in another format, such as bar charts or candlesticks.

The middle gray line running through the price data is the 20-day moving average.  The gray lines fencing in most of the data are the upper and lower Bollinger Bands.  In this template the Bollinger Bands are 2 moving standard deviations above and below the moving average line, respectively. 

In addition the upper panel has a single line overlay colored light blue, and rescaled to fit in the pane.  This is the Bollinger Relative Strength Indicator (“RS”), and measures the strength of the dataset you are considering relative to the S & P 500 Stock Index. As you will learn, you may easily choose another dataset for comparison.

The second panel plots the Percent B statistic that tells you where your market has closed within its Bollinger Bands. 

The third panel illustrates Bandwidth (these terms will be defined shortly). 

The bottom (fourth) panel displays the volume of the dataset normalized according to its volatility.  You may easily apply a cursor to the entire chart by clicking:

When FDC produces a plot, it also produces that chart’s accompanying data and notes (if any).  These can be viewed by clicking on the tabs at the bottom of the plot window. 

Also, should you wish to make any editing changes, you may do so.  For example, you may click on the Graph Wizard icon     at the upper right of either the data or plot window and change the illustration according to your needs.  Use of these features are explained in the FDC manual and various tours.  A great place to begin is with the instructional FDC CD-ROM.

The key advantage of using the Bollinger Band Toolkit within Financial Data Calculator is that (a) you may use the output of any of the Bollinger Band tools in further operations, and (b) you may use Bollinger Band tools after any FDC operations.  Thus you are presented with a virtual laboratory, which you may use to generate profitable trading ideas and programs. 

Variations of the Basic Template

Instead of viewing the Basic Template with its values %B and Bandwidth, you may wish to see the value AD and the ADLINE.  Those values can easily be viewed by requesting

 bbtk_vol_ad [dataset] ”.   AD is plotted as follows:

The ADLINE is plotted:

Alternatively you may wish to substitute Intraday Intensity for %B and Bandwidth.  In that case, request bbtk_vol_ii [dataset] ”.  II will be plotted as follows:

The IILINE is plotted:

Toolkit Conventions

All of the Bollinger Band Toolkit functions are named with the prefix bbtk ” followed by a shortened form of the actual function.  For example, bbtk_pctb ” describes the function which when applied to a dataset produced the Percent B value.  The syntax is quite simple:  bbtk_basic ibm ” will generate the basic template for IBM.  The easiest way to understand FDC’s syntax is to think of functions as action verbs, and datasets as nouns, such that one applies the action verb to the noun.  Almost all functions in the toolkit can be customized by providing parameters on the left.  We explain this in detail in the Glossary section at the end of these notes.

A quick look at the major numerical tools in the Toolkit

Users are encouraged to use the Bollinger Bands in combination with other indicators.  Care should be taken to avoid using multiple indicators that merely measure the same quality or indicator, such as price momentum.  As a beginning point, we chose to illustrate the functions listed below.  All of the functions (including those below) are listed in the Glossary section, where their syntax is also displayed.

Percent B (“%B”) calculates numerically where the close lies with regard to the bands.  Generally this value will be between 0 and 100.  A value greater than 100 indicates a close above the upper band, whereas a value below 0 indicates a close below the lower band. 

Bandwidth illustrates the width of the bands as a percent of the moving average.  When bandwidth narrows drastically (“the squeeze”), a violent price breakout usually occurs in the near future. 

Autowidth:  Should you specify the length of the moving average, but not the number of moving standard deviations to be used in calculating the width of the Bollinger Bands, the Autowidth function will supply the recommended values.  These values are based on considerable research, but the user is still encouraged to experiment and conduct further research.  Should you wish to learn the Bollinger-recommended number of moving standard deviations to be used with a particular moving average, just enter the following in a command line, where 30 is the number of periods in the moving average:

                                

The answer will be presented in the Last Numerical Value box in the lower right corner of the command palate.

The AD value is the volume-weighted ratio of the difference of the close and open to the range.  The AD LINE is the cumulative value of the AD.

Intraday Intensity (“II”) is a volume-weighted oscillator of the close relative to the range.  The II LINE is the cumulative value of II.

Relative Strength is a term used frequently, and with occasionally different definitions.  For example, a security may be strong relative to where it was 10 weeks ago, or strong relative to its industry sector, or strong relative to the market averages.  In the Bollinger Band Toolkit, “RS” refers to strength relative to the S&P 500, unless otherwise specified.  You could substitute the Dow Jones _ AIG Commodity Index for comparison with futures prices.  If you wished, you could plot Microsoft in the Basic Template and choose General Electric for the comparison. 

An important technique invented by John Bollinger is to use Bollinger Bands for indicators to normalize those indicators.  Normalization, in effect, deforms the vertical scale so that the upper band becomes the constant 1, the lower band becomes the constant 0, and the indicator is proportionally affected.

The Normalize function enables you to normalize any indicator relative to its volatility.  A dataset or indicator that appears at first sight to have hit a new low, when normalized may not have hit a new low.  Often the normalized version is the more truthful, and thus the normalization process may enable you to reduce fake-outs or spurious signals.

Below we show a daily plot of IBM stock, along with the ordinary MACD and the normalized MACD (with the default parameters of 20 and 2).  The end of the data shown is the beginning of an up move.  This corresponds to a new high in the normalized MACD, but not in the ordinary one.

The Bollinger Band toolkit contains a number of functions that produce studies involving volume; and FDC comes with a number of accessible macros, some of which involve volume and some of which do not.  Below are two less-common indicators that we include at the suggestion of John Bollinger.  They appear as ordinary accessible FDC macros.

Q-Stick is an indicator created by Tushar Chande.  It is the n-day moving average of the difference between the close and the open.  A recommended default value for the number of days is 8. 

CMO is the Chande Momentum Oscillator, an indicator created by Tushar Chande.  It is a pure momentum oscillator that is plotted on a bounded scale between -100 and +100.  In general, it is used to help spot extremes in market momentum.   With ease, Bollinger Bands can be plotted with studies such as the CMO:

Experiment at length with the toolkit functions in various combinations and with other studies or indicators of your own.  Eventually, you will begin to see how they provide information about markets, and you will develop some intuition about the relevant chart formations and indicators.  The Bollinger Band Toolkit is part of a laboratory for such research, particularly when combined with the other features of FDC.

Developing and Testing Trading Systems

After you have become familiar with the Bollinger tools, you will want to involve them in a trading plan.  Four interesting methods of generating Buy and Sell signals using Bollinger Bands are developed at length in John Bollinger’s book, and tools for generating them are included in this toolkit. They use band indicators in different ways, and often apply to different market conditions. These techniques are another good starting point for experimentation.  Make your own changes and additions to produce trading techniques that you find comfortable.

Below is the result of applying the function bbtk_method2 to the dataset aapl, the daily Apple stock price. 

 It shows the stock and its Bollinger Bands in the top pane, with the relative strength overlay. The second pane shows any method2 buy or sell signals that have occurred.  The final two panes show the Money Flow Index and the normalized volume.  There are similar but slightly different displays for the other three trading methods.  These basic displays will help you to see the result of the various buy and sell signals for the different trading methods.

Automatic Trade Testing

Financial Data Calculator has a fully developed trade simulator that you can use to back test any trading strategy that can be precisely and unambiguously formulated.  The Trade Wizard   is the operation you will use to fully test how a defined trading approach would have worked in the past.  You define a “trade” which specifies under what conditions you will buy and sell, and which produces the corresponding trade function.  You then apply that trade function to whatever market you wish; and receive output telling you exactly how you would have performed, had you followed all of the trading rules to the letter.  The output will provide summary statistics, complete trade review, plots of positions, equity changes, positive and negative excursions, and more. The Bollinger Band Toolkit comes with three sample trade functions.  One function specifies buy trades only, uses the method2 buy signal, and has a “chandelier” stop.  There are similar sample trade functions for sell trades only, and for a reversal system. The Trade Wizard is well documented in the FDC package (including the CD-ROM, the Manual, and on the FDC Users website.) 

It is important to note again that these templates are not meant to be complete or useful mechanical trading systems.  Indeed, John Bollinger does not provide or endorse any such system.  If you intend to create and test a mechanical system, you may and should carefully consider whether and how to add additional signals and additional stops and modifications.  It takes a lot of work and trial before you have a system that you are comfortable with, and that is robust enough to trade a variety of markets.

Trading Practice – The Walk Forward Trader

Everyone who wants to do a job right, practices.  Athletes, physicians, attorneys and even the counter staff at the coffee shop have some training period.  Ask yourself, would you ever want to be a surgeon’s first patient?  Likewise, would you ever want to be a money manager’s first client/guinea pig?  Let’s assume that you are fulfilling both the roles of the money manager and the client.  Don’t you think it’s appropriate to have a dress rehearsal?  Even if you have a fully worked-out and back-tested trading strategy, your success will depend to a great extent on whether you can follow it.  Daily trading raises uncertainty when your money is on the line.  The twin trading emotions of fear and greed often cause a trader to depart from his or her carefully worked out strategy.

Financial Data Calculator has a way to simulate these conditions, and practice trading under more realistic conditions - the Walk Forward Trader

The Walk Forward Trader   enables you to specify all of the conditions you wish, exactly as you would have done with the Trade Wizard; but it requires that you “pull the trigger”.  You are shown one day at a time (you can alter this if you wish) with all of the tools you wish to see.  You then decide to act (buy, sell, exit a previous trade, or do nothing) before you are shown another day’s activity.  A mechanical trading approach may test well “on paper”, but can you stick with it?  Or alternatively, does using your own intuition together with the tools improve the results?  The Walk Forward Trader will give you the answers to those questions, both in a quick pop-up and with a final detailed summary identical to that of the Trade Wizard. 

The Walk Forward Trader works seamlessly with the Bollinger Band Toolkit.  Its use is illustrated in various FDC materials;1 however we will now give you an example of its use with the toolkit.

Click on the Walk Forward Trader .  You will be presented with a purple palate that requires four steps.  If all you want to do is test your ability to trade the basic template, just enter “bbtk_basic msft last 200” as shown: 

Thus you are requesting the basic template for the last 200 trading days of MSFT.

Then just click on .  You don’t need to specify anything else to see the Walk Forward Trader work.  You will be presented with the default number of starting and advancing days and will see the default plot generated by the bbtk_basic function, shown up to the starting day or date. 

Then click on  and you will see new data appear.  Each step forward will uncover one more day of activity for the various charts displayed by the basic function. When ready, click either the  (go long) or  (go short) buttons.  You will get a template asking you for a specific price or time (the default is the next-day’s opening price).  Then click on:   (This is required – view it as confirming your trading intentions.)  The trade will be executed when you click on the  button.  The  button will get you out of the trade.  Note that if you are long and then click on the SELL button, you will both EXIT and SELL, thus leaving you short.  Likewise, if you were short and clicked on the BUY button, you will both exit and go long.   

At any time you may request the Trading Statistics.  When you QUIT you have the option of seeing a full trading summary. 

Note that errors made in the Walk Forward Trader have no recovery.  If you miss a “buy signal” and need to go back to yesterday’s price, you will not be allowed to do so.  A lost trading opportunity is simply that – lost.  Thus if you make a mistake, you will have to live with that mistake, or start completely over.  We have deliberately constructed the Walk Forward Trader to deal with the reality of mistakes happening.  Once you have started trading, there’s no going back.  This also means that should you have chosen the wrong graph layout, or forgotten a needed variable, you will have to start the Walk Forward Trader over. 

Experimenting On Your Own with the Walk Forward Trader

Let’s assume that you want to see something different than the basic template illustrated above.  The first step asks that you input a dataset into the edit box that contains all of the data that you will need.  The edit box does not appear to be very big, and you are thinking, “How am I going to get all that I need in that box?”  Actually any length line can be input, but the best way to input the dataset is to create a macro to do your work for you.  As an example, let’s suppose that you need all of the following to make your trading decisions:

1.      The price (and chart) of a dataset,
2.      Bollinger Bands around that chart (with parameters of 20 and 2),
3.      a panel illustrating the Bandwidth using the same parameters,
4.      the Chande Momentum Oscillator looking back 10 days, smoothed with a 5-day moving trend, and
5.      a 40-day moving slope (the slope of the regression line over the past 40 days) of the closing price.

Note that we are not recommending these as trading signals; we just want to give you an example of the endless possibilities available because of the flexibility of FDC.

We certainly do not want to write an expression that in one line combines all of these values into one dataset, and we don’t think you will wish to do so either.  So let’s create our needed dataset in a macro.  Go to the Macro Wizard , and click .  Then, in the edit box enter the following:

Then click .  Enter the name of your choice   and   .

Let us explain the text in the macro:  The first line is simply a comment.  In FDC, everything following a “@” is non-executed text on a given line.  Thus it’s an easy way to leave yourself notes in place.  In this case, you’ve just reminded yourself the name of the macro.

The second line defines local variable “a” as columns 1 2 3 and 4 of whatever dataset you are going to name to the right of whenever you use “my_Bollinger” in a statement.  Thus by stating “my_Bollinger indu”, the local variable “a” will produce the open, high, low and close of the Dow Industrials.  We could have simply specified the actual dataset, but then this macro would only apply to one dataset.  By using “#R” we make it applicable to any dataset.

The third line defines local variable “b” as the Upper Bollinger Band, Middle Bollinger value, and Lower Bollinger Band of “a”.  These are calculated using the 20 2 parameters.  The output of “b” will be three columns of data.

The fourth line produces the bandwidth as “c”, a single column of data.  Note that we have not entered the parameters.  Indeed if we are going to use the normal defaults for the Bollinger Band Toolkit functions, we need not enter them and FDC will assume them to be 20 and 2.  Thus, “20 2 bbtk_bandwidth a” would produce the same result as “bbtk_bandwidth a”

The Chande Momentum Oscillator is a pre-defined macro in FDC, whose definition you can see in the Macro Wizard.  In line 5 we have asked to define “d” as the 5 period moving trend (a non-lagged smoother) of the 10 day CMO, one column of data. 

The sixth line defines “e” as the 40-day moving slope of the close of “a”. 

The last line merely specifies what output we require, which in this case happens to be all of the local variables we have defined above.  It will result in a 10-column dataset. 

Now let’s go back to our Walk Forward Trader and enter what we need in the dataset box:

We are therefore going to simulate trading Apple Computer stock, with the indicators described above. For this example, let us ignore Step 2, and skip down to Step 3 to specify a plot.  Click:

The Graph Wizard palate has appeared.  Now you have to think about how you wish to plot your indicators.  You may like the “basic” template shown above, perhaps modified, or you may wish to create something entirely different.   If the latter, we suggest that you take a quick look at: 

  http://www.fdcusers.com/Graphing_101.pdf

However, here we will assume that you are more-or-less satisfied with the look of the

basic” template.  Click on , and you will be presented with a window in which all of your previously saved plot descriptions are listed:

Just select “bbtk_basic_form” and .

You will then be presented with a template showing 4 panes.  To get exactly what you want will require a little modification.  In this case we have plotted the price as a bar chart with Bollinger Band overlays in Pane 1.   You may wish a different color scheme, so just click on the color box to change. 

Next click on Pane 2 of the blue-colored schematic on the left.  If this is where you want the CMO plotted, then enter “9” (replacing “6”) in the  box.  It would also be a good idea to describe the data, so enter “CMO” in the caption box.  .

If you wish to plot Bandwidth in Pane 3, enter “8” in the SOLID LINE COLS box, and the caption “Bandwidth”.

Lastly move to Pane 4, and enter “10” however you wish it to appear.  An interesting thing to try is to list “10” in both the SOLID LINE box and the HISTOGRAM box.  Don’t forget to enter an appropriate caption. To save any editing changes, click on  and give it a descriptive name (if you wish) and then a file name, such as “my_bollinger_plot”.  This last step will enable you to use it again and again.  Lastly, click on .  You will then be sent back to the Walk Forward Trader Palate, where you can begin by clicking .

On any given day of the walk forward, you can draw lines on the chart and put on decorations. You can select any visible part of the chart and overlay regression lines or curves, then later extend them.  Things you place on the chart will stay there as you walk, unless you erase them.  Thus you could, for example, draw a trend line into the future, and have it available, when you step forward.

Screening a Database for Patterns

After you have finished researching the indicators and practicing the trades, based on what you have learned from the BBTK and other sources, you will probably want to begin actual trading. In FDC it is a simple matter to screen any desired collection of datasets for any pattern or patterns.  For example, suppose that you wish to screen on a daily basis 800 of the highest-volume Nasdaq stocks, not to mention the 500 S & P stocks, and your goal is to find and view the candidates that are presently experiencing “the squeeze”.  You may want to watch these “squeeze stocks” for signs of price breakouts, and trade according to method1.  We will now walk you through the screening process.

Let’s say that you wish to screen Nasdaq stocks for the Bollinger Band “squeeze” pattern.  You have a list of say 800 of the highest volume stocks (i.e. those with an average daily volume of at least 250,000 shares.)  Through FDC’s List Wizard you have created that list and have named the list nasdaq_stocks ”. 

Go to:    and double-click

The following command set will then load: 

.

This command set has been saved for you.  You may run it as is by clicking the autoplay icon  ; or you may make changes and then click on the autoplay icon.  Let us explain what the lines in the command set do, should you wish to alter them yourself. 

Line 1: resets the numbering of any temporary datasets (had any been previously created)

Line 2: tells FDC to go to the list “nasdaq_stocks” and start a loop operating on each item in that list.  The list name is the item that you will most likely wish to change.  The “#1” is a “placeholder that will be replaced, on each trip through the loop, by the name of the corresponding item on the list.

Line 3: asks if the condition “bbtk_squeeze” is true for each item in the loop, and execute lines in the loop only if the condition is true.  The numbers refer to the “standard” Bollinger Band parameters of a 20-day moving average, 2 moving standard deviations and a look-back period of 127 trading days (6 months of    trading days).

Line 4: tells FDC to display (in hidden form) each item that meets the criteria, and to do so according to the Bollinger Band “basic template”, also using the 20 and 2 parameters. Any dataset thus created will be placed in the  “Current Play List” for you to see at the end.

Line 5: ends the “if” statement.

Line 6: ends the loop.

When the loop is running, the operating lines will be grayed out.  When finished, the gray will disappear and you will see that your operation has produced a loop result.  In this case, FDC has given your product the temporary name “loopres1”, and shown it in the margin:

The output is not immediately visible.  Indeed you don’t want it to be.  Suppose your request had asked for something that was true for all 800 stocks.  The last thing you want on your desktop is 800 charts, which would probably exceed your Windows® Graphics Memory. 

To see this hidden list, go to the List Wizard , choose .  You will then see the following displayed in the viewing window:

 Now, click on .  The List Viewer will now take control of your screen, and you will be shown the display requested:

Here you can easily see the reason for the “squeeze”, notably that the Bandwidth is at a new low, which is also evidenced by the narrowing of the Bollinger Bands in the price chart.  Also you will notice a sidebar on the right, listing the items displayed: 

As the stock EBay is selected, you can see to which stock the chart refers. You can then scroll down through the list either by using the mouse, or by using the directional arrow buttons on your keyboard. 

Okay, let’s go “big time”.  What we have shown you above is for finding Bollinger Band “squeeze” opportunities.    However suppose you wish to search for all of the Bollinger Band Toolkit Buy and Sell signals (all 4 methods)?  That’s easy, just 

 and select or double-click . You will then get the following command set (shown after it has been run by clicking autoplay  ):

The results of the four loops are then put together in one Current Play List, arranged by stock.  As before, go to the LIST WIZARD, , and . You can thus easily see the results of all of your searches, and you may be surprised to find that some stocks may give you a “buy” signal under more than one of the pattern searches.  Each item in the Current Play List will be displayed with the chart appropriate to the pattern searched. 

The above chart illustrates the display associated with “method2” which screens for Bandwidth and the Money Flow Index (MFI).  Note that in this template we have included a “signal bar” in the panel directly underneath the price display.  This signal bar illustrates the date the particular signal was given. 

Once you gain some experience, you will find it quite easy to create your own templates to see exactly the information displayed as you wish.  As we have stated before, these templates are only for your beginning efforts.    

Glossary of Bollinger Band Toolkit Items

Numerical Calculations – to give you a needed value

Should you wish to follow our recommendations to pursue further research, you will need to know how to obtain the other indicator values calculated by the Bollinger Band Toolkit.  The following functions produce output in the form of dated datasets containing numerical output.  Here, they are presented as one would logically learn to use them (rather than alphabetically).  Note that these are dedicated functions and not macros.

All functions which require the calculation of Bollinger Bands have defaults, which are 20 for the moving average smoother and 2 for the number of moving standard deviations.  Some functions such as “squeeze” and “bulge” use three parameters, and the various “buy” and “sell” signals use four parameters.  These other functions also have default values.  If you do not specify any parameters (and you need not do so), the calculations will be performed using those defaults.  However if you choose to specify any parameters, it is best to specify all of them.  Should a particular function require 4 parameters (i.e. N M P Q), and should you only specify 2 parameters, FDC will assume that you have specified the left-most parameters (i.e. N M), and are accepting default values for the remaining ones to the right of the number of values specified. Again, our recommendation is that if you specify any, specify all. 

bbtk_upperbb – returns the upper Bollinger Band for the close of the dataset.
          syntax:  N M bbtk_upperbb [dataset]
N is the length of the moving average; M is the number of standard deviations

bbtk_middlebb - returns the middle Bollinger Band for the close of the dataset.
            syntax: N bbtk_middlebb [dataset]
N is the length of the moving average.

bbtk_lowerbb - returns the lower Bollinger Band for the close of the dataset.
            syntax: N M bbtk_lowerbb [dataset]
N is the length of the moving average; M is the number of standard deviations to subtract.

bbtk_pctb - returns the Bollinger %b indicator.
            syntax: N M bbtk_pctb [dataset]
N is the length of the moving average; M is the number of standard deviations to subtract.  Note that the values N and M are used to calculate the bands, and %b is computed   from the bands.

bbtk_bandwidth- returns the Bollinger Bandwidth indicator.
            syntax: N M bbtk_bandwidth [dataset]
N is the length of the moving average; M is the number of standard deviations to subtract. Note that the values N and M are used to calculate the bands,  and Bandwidth is computed from the bands.

bbtk_autowidth - a default number of standard deviations to add to an N-period moving average to compute Bollinger bands. The default for N = 20 is 2. This function computes a value for any number N. This is used as a default in some functions, but the user will not ordinarily need to use it explicitly.
            syntax: bbtk_autowidth N

bbtk_normvol - Normalized volume; that is, volume divided by a moving average.
            syntax: N bbtk_normvol [dataset]
N is the length of the moving average.

bbtk_ad - This indicator is volume times the quotient of the close minus the open and the range .
            syntax: bbtk_ad [dataset]

bbtk_adcum- The cumulative value of bbtk_ad.
            syntax: bbtk_adcum [dataset]

bbtk_adpct - This indicator is a moving sum of bbtk_ad divided by the same moving sum of volume. The result is then multiplied by 100.
            syntax: N bbtk_adpct [dataset]
N is the length of the moving sum.

bbtk_ii- The intraday intensity. It is twice the difference between the close and the midrange, divided by the range, and multiplied by volume.
            syntax: bbtk_ii [dataset]

bbtk_iicum- The cumulative value of bbtk_iid.
            syntax: bbtk_ii [dataset]

bbtk_iipct - This indicator is a moving sum of bbtk_ii divided by the same moving sum of volume.  The result is then multiplied by 100.
            syntax: N bbtk_iipct [dataset]
N is the length of the moving sum.

bbtk_nvi – The Negative Volume Indicator is the cumulative sum of the rates of change (roc) for those days when volume decreases from the previous day.
            syntax: bbtk_nvi [dataset]

bbtk_pvi – The Positive Volume Indicator is the cumulative sum of the rates of change  (roc) for those days when volume increases from the previous day.
            syntax: bbtk_pvi [dataset]

bbtk_obv - Volume multiplied by 1 when the close is up from the previous day, and -1when it is down.
            syntax: bbtk_obv [dataset]

bbtk_obvcum- The cumulative value of bbtk_obv.
            syntax: bbtk_obvcum [dataset]

bbtk_obvpct - This indicator is a moving sum of bbtk_obv divided by the same moving sum of volume.  The result is then multiplied by 100.
            syntax: N bbtk_obvpct [dataset]
N is the length of the moving sum.

bbtk_normalize – this function will normalize any dataset according to its volatility.
          syntax: N M bbtk_normalize [dataset]
N is the length of the moving average; M is the number of standard deviations.

Logical Calculations – to answer a question

In addition to the numerical functions, there are other functions that produce dated output in a logical format.  That is, these functions when used answer a question; and thus their output is a true/false logical answer, taking the form of the value 1 for true and the value 0 for false.  A typical logical question might be “is the close greater than the upper Bollinger Band?”

bbtk_bulge – does a “bulge” exist?
          syntax:  N M P bbtk_bulge [dataset]
N is the length of the moving average; M is the number of standard deviations;
P is the period over which you are looking (e.g. six months is both recommended and the default, should it not be specified).

bbtk_squeeze – does a “squeeze” exist?
          syntax:  N M P bbtk_squeeze [dataset]
N is the length of the moving average; M is the number of standard deviations;
P is the period over which you are looking (e.g. six months is both recommended and the default, should it not be specified).

bbtk_above – is the close above the upper Bollinger Band?
          syntax:  N M bbtk_above [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_below – is the close below the lower Bollinger Band?
          syntax:  N M bbtk_below [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_backinfromabove – has the close just crossed down the upper Bollinger Band from having been above? 
          syntax:  N M bbtk_backinfromabove [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_backinfrombelow – has the close just crossed up the lower Bollinger Band from having been above? 
           syntax:  N M bbtk_backinfrombelow [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_breakoutabove – has the close just crossed above the upper Bollinger Band from having been below? 
          syntax:  N M bbtk_breakoutabove [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_breakoutbelow – has the close just crossed down the lower Bollinger Band from having been above? 
          syntax:  N M bbtk_breakoutbelow [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_method_1_buy – has the market just had an upside breakout from a squeeze?
           syntax:  N M P Q bbtk_method_1_buy [dataset]
N is the length of the moving average; M is the number of standard deviations.
A squeeze occurs if the (N M) bandwidth is a minimum over the lookback period  P, the default of which is 125 days.  The buy signal occurs if there is a squeeze in the last Q periods (the default of Q is seven), and closing price has broken above the upper band.

bbtk_method_1_sell – the reverse of bbtk_method_1_buy.
          syntax:  N M P Q bbtk_method_1_sell [dataset]

bbtk_method_1_signals – does either a buy or sell signal exist under the parameters of method1?

bbtk_method_2_buy – Are both %B and the Money Flow Index giving bullish
            syntax:  N M R S bbtk_method_2_buy [dataset] 20 2 .8 80
N is the length of the moving average; M is the number of standard deviations.
%B should be > R (default 0.8)and MFI should each be > S (default 80).  MFI   is a relative strength indicator of up volume versus down volume. 

bbtk_method_2_sell – The reverse of bbtk_method_2_buy.  Specifically, %B is less than  T (default 0.2) and MFI is less than W (default 20). 
          syntax:  N M T W bbtk_method_2_sell [dataset]

bbtk_method_2_signals – does either a buy or sell signal exist under the parameters of method2?

bbtk_method_3_buy – is %B at a low value and yet Intraday Intensity is at a high value?  Specifically %B is “tagging” the lower band by having a value less than R (default 0.1), and II is greater than 0.
           syntax:  N M R bbtk_method_3_buy [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_method_3_sell – the reverse of bbtk_method_3_buy, with %B > 0.9 and II < 0.
syntax:  N M S bbtk_method_3_sell [dataset]

bbtk_method_3_signals – does either a buy or sell signal exist under the parameters of method3?

bbtk_method_4_buy – did the previous day’s close break out above its upper Bollinger Band, and is today’s close greater than the previous day’s high? 
           syntax:  N M bbtk_method_4_buy [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_method_4_sell – the reverse of bbtk_method_4_buy
          syntax:  N M bbtk_method_4_sell [dataset]

bbtk_method_4_signals – does either a buy or sell signal exist under the parameters of method4?

bbtk_sos – is today’s volume greater than the N-period moving average of the volume, and is today’s rate of change of the close greater than the N-period moving average of the absolute value of rate of change?  
           syntax:  N bbtk_sos [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_sow – is today’s volume greater than the N-period moving average of the volume, and is today’s rate of change of the close lower than the N-period moving average of the absolute value of rate of change?  
            syntax:  N bbtk_sow [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_pow – is today’s volume greater than the N-period moving average of the volume, and is today’s range greater than the N-period moving average of the range?  
            syntax:  N bbtk_pow [dataset]
N is the length of the moving average; M is the number of standard deviations.

bbtk_hip – is today a high point?  Specifically, is today’s high greater than both the preceding day’s high, and the subsequent day’s high? 
            syntax:  bbtk_hip [dataset]

bbtk_lop – is today a low point?  Specifically, is today’s low less than both the preceding day’s low, and the subsequent day’s low? 
           syntax:  bbtk_lop [dataset]

Display Functions – Package and Display Combinations of Indicators

bbtk_basic – When applied to a dataset having columns that represent at least Open, High, Low, Close, and Volume, produces a four pane window showing the dataset in Bollinger Bars with all Bollinger bands and data in log form – then bandwidth – then %b – and finally normalized volume.
            syntax:  N M {“string”} bbtk_basic [dataset]
N is the length of the moving average; M is the number of standard deviations, and string is an optional expression that evaluates in FDC to a one column dataset.  If “string” is present, the result replaces the usual relative strength overlay on pane1.

bbtk_vol_ad – When applied to a dataset having columns that represent at least Open, High, Low, Close, and Volume, produces a four pane window showing the dataset in Bollinger Bars with all Bollinger bands and data in log form – then the volume-weighted AD – then the cumulative AD – and finally normalized volume.  Recall that the AD figure is:   volume * ((close – open)/(high – low)).
            syntax:  N M {“string”} bbtk_vol_ad [dataset]
N is the length of the moving average; M is the number of standard deviations, and string is an optional expression that evaluates in FDC to a one column dataset.  If “string” is present, the result replaces the usual relative strength overlay on pane1.

bbtk_vol_ii – When applied to a dataset having columns that represent at least Open, High, Low, Close, and Volume, produces a four pane window showing the dataset in Bollinger Bars with all Bollinger bands and data in log form – then the volume-weighted intraday intensity (II) – then the cumulative II – and finally normalized volume. 
            syntax:  N M {“string”} bbtk_vol_ii [dataset]
N is the length of the moving average; M is the number of standard deviations, and string is an optional expression that evaluates in FDC to a one column dataset.  If “string” is present, the result replaces the usual relative strength overlay on pane1.

bbtk_method1 – When applied to a dataset having columns that represent at least Open, High, Low, Close, and Volume, produces a four pane window showing the dataset in Bollinger Bars with all Bollinger bands and data in log form – then the signal bar  –  then bandwidth – and finally normalized volume.  The signal bar illustrates when squeeze conditions exist, and any buy or sell signals resulting from the squeeze. 
            syntax:  N M P Q {“string”} bbtk_method1 [dataset]
N is the length of the moving average; M is the number of standard deviations, P is the lookback period over which you are comparing the most recent Q period for narrowest Bandwidth.  Six months is both the recommended and the default lookback period, should it not be specified.  Q is the recent comparison period, the default of which is seven periods  If “string” is present, the result replaces the usual relative strength overlay on pane1.

bbtk_method2 – When applied to a dataset having columns that represent at least Open, High, Low, Close, and Volume, produces a four pane window showing the dataset in Bollinger Bars with all Bollinger bands and data in log form – then the signal bar  –  then the Money Flow Index – and finally normalized volume.  The signal bar illustrates buy and sell signals given from specific combinations of %B and MFI.
            syntax:  N M R S T W {“string”} bbtk_method2 [dataset]
N is the length of the moving average; M is the number of standard deviations, R S T W are as in the corresponding buy and sell signals, and string is an optional expression that evaluates in FDC to a one column dataset.  If “string” is present, the result replaces the usual relative strength overlay on pane1.

bbtk_method3 – When applied to a dataset having columns that represent at least Open, High, Low, Close, and Volume, produces a four pane window showing the dataset in Bollinger Bars with all Bollinger bands and data in log form – then the signal bar  –  then the Intraday Intensity – and finally normalized volume.  The signal bar illustrates buy and sell signals given from specific combinations of %B and II.
            syntax:  N M R S {“string”} bbtk_method3 [dataset]
N is the length of the moving average; M is the number of standard deviations, R and S are as shown in the corresponding Buy and Sell signals, and string is an optional expression that evaluates in FDC to a one column dataset.  If “string” is present, the result replaces the usual relative strength overlay on pane1.

bbtk_method4 – When applied to a dataset having columns that represent at least Open, High, Low, Close, and Volume, produces a four pane window showing the dataset in Bollinger Bars with all Bollinger bands and data in log form – then the signal bar  –  then %B – and finally normalized volume.  The signal bar illustrates buy and sell signals given from breakouts (and their continuation) outside of the Bollinger Bands.
           syntax:  N M {“string”} bbtk_method4 [dataset]
N is the length of the moving average; M is the number of standard deviations, and string is an optional expression that evaluates in FDC to a one column dataset.  If “string” is present, the result replaces the usual relative strength overlay on pane1.

Ordinary (visible) FDC Macros that come with the Toolkit
The definitions of these macros are visible (and alterable), as are all macros in FDC.  To view their definitions, go to the Macro Wizard , which will give you the ability to see pre-defined macros, along with their definitions, and of course, to define you own.

       

bbands – creates the upper and lower Bollinger Bands, along with the middle value.
          syntax:  N M  bbands [dataset]
N is the length of the moving average; M is the number of standard deviations.

typical – produces a daily price that is the average of the high, low and close.
           syntax:  typical [dataset]

typical4 – produces a daily price that is the average of the open, high, low and close.
           syntax:  typical4 [dataset]

wtdclose – produces a daily price that is the average of the close and midrange.
           syntax:  wtdclose [dataset]

roc – the rate of change is the N-day change, divided by the price N days ago.
            syntax:  N roc [dataset]
N is the time period.  (e.g. 5 roc gives the rate of change over 5 days)

cmo – the Chande Momentum Oscillator indicates the strength of the up-days to the down-days.
            syntax:  N cmo [dataset]
N is the length of the look-back period.

qstick –  is an average of intraday momentum, defined by Tushar Chande.
           syntax:  N qstick [dataset]
N is the length of the moving average.

FDC Trade Functions that come with the Toolkit

The functions listed below are pre-programmed trades that search datasets (or lists of datasets) for buy signals, sell signals or both signals, respectively, according to method1, and then simulate the performance of those signals on the dataset.  The output of these functions is an extremely detailed trading summary.  To see their construction, go to the Trade Wizard  , and click on the name of the trade function.  The syntax, when applied to a single dataset is:  bbtk_bothtrade [dataset].

bbtk_buytrade
bbtk_selltrade
bbtk_bothtrade

Their inclusion here is not to suggest that you trade according to method1, but to illustrate how one constructs such a trading function.  Included in the trade functions are entry and exit definitions.  The exits chosen are the “chandelier” stop, or (in one case) reversal, whichever occurs first.

FDC Command Sets that come with the Toolkit

All of the command sets listed below may be loaded by going to:

Each call up a particular routine that can be run on autoplay  .  All of the routines are written to examine a list for particular occurrences of patterns.  All you need to do is supply the name of the list.

bbtk_signals
bbtk_tests
bbtk_signals1
bbtk_signals2
bbtk_signals3
bbtk_signals4
bbtk_bulge
bbtk_squeeze
bbtk_above
bbtk_below
bbtk_backinfromabove
bbtk_backinfrombelow
bbtk_breakoutabove
bbtk_breakoutbelow

The Bollinger Band Toolkit also comes with 15 plottypes used by various bbtk functions – 102 items in all.