Keltner Channel multiple timeframe in ThinkorSwim?

E

ezrollin

Member
Does anyone have a script or can tell me how to build one that shows the 4hr kelts on all timeframes? My friends use theirs alot

Thanks
 
horserider

horserider

Well-known member
VIP
Code:
# KeltnerChannels Channels with aggregation Period
# Horserider 4/7/2020

declare weak_volume_dependency;

input displace = 0;
input factor = 1.5;
input length = 20;
input averageType = AverageType.SIMPLE;
input trueRangeAverageType = AverageType.SIMPLE;
input agg = aggregationPeriod.FOUR_HOURS;
def shift = factor * MovingAverage(trueRangeAverageType, TrueRange(high(period = agg), close(period = agg), low(period = agg)), length);

def average = MovingAverage(averageType, close(period = agg), length);

plot Avg = average[-displace];
Avg.SetDefaultColor(GetColor(1));

plot Upper_Band = average[-displace] + shift[-displace];
Upper_Band.SetDefaultColor(GetColor(8));

plot Lower_Band = average[-displace] - shift[-displace];
Lower_Band.SetDefaultColor(GetColor(5));
 
horserider

horserider

Well-known member
VIP
Do not use mobile so no idea. Thought someone had said aggregations do not work on mobile. I do know mobile is hit or miss for many custom studies. Maybe a mobile user can chime in here.
 

Top