MTF Bollinger Bands (Multi Time Frame) Indicator for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
With this indicator, you can follow your Bollinger Bands indicator from higher timeframe while viewing charts on the lower time frame.

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.

Default settings
  • 50 SMA
  • Daily as the time frame for the Bollinger Bands
  • 1.0 from Standard Deviation
Standard settings from the built-in BB in ThinkorSwim:
  • 20 SMA
  • 2.0 from Standard Deviation
If you want to stick to the regular settings that you're used to, I would suggest adjusting the SMA and StdDev inputs.




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 = 50;
input std = 1.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;

Shareable Link


Credit:
 

Top