Bollinger Bands MTF (Multi Time Frame) for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Warehouse
Someone recently asked if it was possible to plot Bollinger Bands from 15m on the 5m chart. The answer is yes, using this indicator.

Example: Displaying the Bollinger Bands of the Hourly chart on the 5m, 15m, or 30m time frame. The indicator is highly configurable and support multi time frame options.

The original version has the simple moving average set to 50 and standard deviation set to 1.0. I modified it so that it is up to date with the Bollinger Bands indicator in ThinkorSwim. You can adjust the values and settings to your liking.




thinkScript Code

Code:
# DG_MTFBollingerBands
# Paints Bollinger Bands from higher time period
# onto current time period
#
# Copyright (c) 2017 Daniel Granville

input timeframe = AggregationPeriod.DAY;
input period = 20;
input std = 2.0;
input moving_average_type = {default SMA, EMA};

def data = close(period = timeframe);
def band = StDev(data, period);

plot MidLine;

switch(moving_average_type) {
    case SMA:
        MidLine = Average(data, period);
    case EMA:
        MidLine = ExpAverage(data, period);
}

plot BBandTop = MidLine + band;

plot BBandBot = MidLine - band;
Credit:
 
Last edited:
H

horserider

Active member
Warehouse
Please can someone explain how this is useful over using 2 BB studies of same time frame with different dev.
 
markos

markos

Well-known member
VIP
Warehouse
Actually, there was at least one study in TASC a while back by Tushar Chande.
It used 4 different Time Frames in BB's plus a few more studies to create a Combined Signal Approach (CSA).
Usefull? Maybe, but I didn't look at it beyond reading about it.
 

Top