Keltner Channel 200 SMA Period for ThinkorSwim

germanburrito

Active member
This is pretty much a keltner channel set to a 200 period expanded, this is a way that Mr. yen trades the channels need to be adjusted for each individual stock, I know its a pain, but I believe to be worth it, the setting are for the QQQ and SPY.

zIBcDpa.png


Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2020
#

declare weak_volume_dependency;

input displace = 0;
input factor = 5.0;
input length = 200;
input price = close;
input averageType = AverageType.SIMPLE;
input trueRangeAverageType = AverageType.SIMPLE;

def shift = factor * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length);

def average = MovingAverage(averageType, price, 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));

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

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

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

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

avg.setdefaultColor(color.yellow);
upper_Band.SetDefaultColor(Color.white);
upper_Band2.SetDefaultColor(Color.red);
upper_Band3.SetDefaultColor(Color.red);
lower_Band.SetDefaultColor(Color.White);
lower_Band2.SetDefaultColor(Color.green);
upper_Band3.SetDefaultColor(Color.white);
lower_Band3.SetDefaultColor(Color.white);

avg.Setlineweight(2);
upper_Band2.Setlineweight(2);
lower_Band2.Setlineweight(2);

AddCloud( upper_Band2, upper_Band, Color.LIGHT_ORANGE );
AddCloud( lower_Band, lower_Band2, Color.LIGHT_ORANGE );

AddCloud( upper_Band2, upper_Band3, Color.light_RED );
AddCloud( lower_Band2, lower_Band3, Color.light_green );
 
Last edited:

germanburrito

Active member
so what prefer settings for other stocks? any examples?
it works on a lot of tickers those settings, but for example snap has bigger swings, so i would do something like 6.5 factor, what i usually change is the factor, and the time frame i use is a 5 minute is a really powrful tool.
 

germanburrito

Active member
Can you please explain where to enter and exit lil bit in detail will be helpful? thanks
well basically the idea behind this indicator is with a counter reversal trend strategy, thats how i trade, I trade against the trend (trend is relative to the time frame you are watching) basically if the price is moving between those levels then is not ready to reverse yet, what you can do is wait for price to go into those levels those levels are a sign the stock is over extended, you can combine this with an oscilator, i would look at a higher time frame to make sure that the ticker didnt just break any major levels, because if it did it might just ride the bands and not come back into the middle or center of the bands and it will tend to ride the outer bands. look at this it helps filter bad trades sometimes.
7qoiqo2.jpg

heres a video on how to set it up on a tick chart, this is the man behind this idea.

 

DPM

Member
VIP
@germanburrito Thanks for this. I trade similarly.
Looks like the Exponential setting works a bit better for the index futures on the lower timeframes.
Question -- is there a way to disable the cloud and just have the bands?
 

germanburrito

Active member
@DPM No problem, and yeah just delete

Code:
AddCloud( upper_Band2, upper_Band, Color.LIGHT_ORANGE );
AddCloud( lower_Band, lower_Band2, Color.LIGHT_ORANGE );

AddCloud( upper_Band2, upper_Band3, Color.light_RED );
AddCloud( lower_Band2, lower_Band3, Color.light_green );
 

Similar threads

Top